CustomerInstrument

Questions about MultiCharts .NET and user contributed studies.
3strategy
Posts: 22
Joined: 31 Dec 2014
Has thanked: 2 times
Been thanked: 1 time

CustomerInstrument

Postby 3strategy » 31 Dec 2014

When trying to use a CustomInstrument it compiles ok, but I'm getting "Message: Error in study ...: Symbol not found."
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);
}

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: CustomerInstrument

Postby Henry MultiСharts » 05 Jan 2015

Hello 3strategy,

There are some errors in the code - the "datafeed" name is incorrect, MTPA_MCSymbolInfo2 is also filled incorrectly.

For MTPA_MCSymbolInfo2 you can get the data directly from the data base using the ISymbolsStorage.GetSymbols method.

3strategy
Posts: 22
Joined: 31 Dec 2014
Has thanked: 2 times
Been thanked: 1 time

Re: CustomerInstrument

Postby 3strategy » 05 Jan 2015

What string should I fill for Datafeed (For example for InteractiveBrokers, and for IQFeed)

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: CustomerInstrument

Postby Henry MultiСharts » 06 Jan 2015

You can see the data feed name next to the instrument in the QuoteManager instrument list. By default it is Interactive Brokers and IQFeed.


Return to “MultiCharts .NET”