Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
My second data series is added here, and the values themselves aren't being optimized but i expect this is a limitation of the strategy analyzer?
else if (State == State.Configure) { string instrumentNameLabel = ""; ClearOutputWindow(); int periodValue = BarsPeriod.Value; if (Instrument.MasterInstrument.InstrumentType == InstrumentType.Future) // we have to add expiry to futures { instrumentNameLabel = Instrument.MasterInstrument.Name+" "+Instrument.MasterInstrument.GetNextExpiry(DateTi me.Now).ToString("MM-yy"); } else if (Instrument.MasterInstrument.InstrumentType == InstrumentType.Forex) { instrumentNameLabel = Instrument.MasterInstrument.Name; // no expiry on forex } if(instrumentNameLabel == "") { Print("BigError"); return; } AddVolumetric(instrumentNameLabel, BarsPeriodType.Minute, periodValue, VolumetricDeltaType.BidAsk, 1);
Comment