In order to use predictable data to test with, I am attempting to create a Bars class and populate it with bars. Here is a snippet of my code:
public static Bars MakeChart(string[] matrix) { DateTime today = DateTime.Today; Period period; MasterInstrument mi; Instrument instrument; Bars bars; period = new Period(PeriodType.Day, 1, MarketDataType.LastClose); mi = new MasterInstrument("TST", InstrumentType.Future); instrument = new Instrument(mi, Exchange.Amex, today.AddYears(1), 4, Right.Call); bars = new Bars(instrument, period, today, today.AddDays(matrix.Length), true, true); ... }
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll A first chance exception of type 'System.TypeInitializationException' occurred in ConsoleApplication1.exe An unhandled exception of type 'System.TypeInitializationException' occurred in ConsoleApplication1.exe Additional information: The type initializer for '<Module>' threw an exception.
Is there some kind of a mandatory initialization that I have to include in order to be able to use any components from NinjaTrader.Core, outside of the NinjaTrader editor?
I am open to any dirty hacks any workarounds.
Thanks.
Comment