I'm getting this error for m_MyCustomInstrument2, while m_MyCustomInstrument which uses an easier constructor works ok. Note that in the real code I placed the instanciation of Sym under Create().
Code: Select all
protected override void StartCalc()
{
Sym = new MTPA_MCSymbolInfo2();
Sym.SymbolCategory = MTPA_MCSymbolCategories.eMTPA_MCSC_FUTURE;
Sym.SymbolName = "ES";//ESH5
Sym.SymbolExchange = "GLOBEX";
Sym.SymbolExpiry = new DateTime(2015,3,20);
Sym.SymbolCurrency= MTPA_MCSymbolCurrency.eMTPA_MCSC_USD;
Sym.BigPointValue = 50;
m_MyCustomInstrument = new CustomInstrument(this,new Resolution {Size = 30, Type= EResolution.Minute});
m_MyCustomInstrument2 = new CustomInstrument(Bars,"IB",Sym,new Resolution {Size = 30, Type= EResolution.Minute},false);
}