View Full Version : Running a Strategy on German Stocks with Interactive Brokers
EvolveK
12-03-2007, 04:10 PM
Hi,
I am trying to get an automated strategy to run with stocks traded on Xetra in Germany. I have already got a similar strategy running for NDX100 stocks via InteractiveBrokers. The problem seems to be getting the real-time data link to TraderWorkstation to work for the German stocks.
When I start the strategy, it won't start, and I am only getting the following error message in the log:
The strategy 'DataLoad' has called the Add() method with an invalid instrument. Either 'ADS' does not exist in the Instrument Manager or the specified exchange has not been configured.
What I have done so far:
created a symbol list with the instrument manager for all the German stocks I want to trade
mapped each symbol to the IB-internal symbols (e.g. LXS on Xetra is LANX at IB)
configured each symbol to trade on Xetra
imported historical data for all symbols (and it works for backtesting)
Where is the problem?
Thanks
Martin
NinjaTrader_Ray
12-03-2007, 04:27 PM
Can you try and select the instrument ADS from within the Control Center order tab, do you get any data?
EvolveK
12-03-2007, 04:31 PM
To do that, does it matter whether the market is currently open or not?
Thx
Martin
NinjaTrader_Ray
12-03-2007, 04:33 PM
Yes, I would test that when the market is trading.
EvolveK
12-04-2007, 02:17 AM
Hi,
I have tried to access real-time data in the "Order" tab for German stocks and it works. So it's not the connection to IB that causes the problem.
However, when I try to start the strategy, I still get the same error message ("strategy has calles the Add() method with an invalid instrument...")
Since the strategy is running on multiple instruments at the same time, the script contains a list of symbols in which I keep the names of the master symbols. For the NDX100, this has worked perfectly. What is the problem for German stocks?
Thanks
Martin
NinjaTrader_Dierk
12-04-2007, 03:28 AM
- what is the exact Add() syntax you apply?
- which exchanges have you assigned to your instrument in question in instrument manager?
EvolveK
12-04-2007, 04:27 AM
Hi,
to add securities, I have a two-step process:
I define the lists of securities in an array:
public string[][] MarketLists = {
new string[] {"AAPL", "ADBE", "ADSK", "AKAM"},
new string[] {"ATVI", "CSCO", "ISRG", "XRAY"} [many other lists here] };
Then I walk through these lists, adding the securities for the respective Index of the list which contains the securities I want to trade - for NDX100 stocks, this works perfectly
// Market initialization
marketList = MarketLists[marketListIdx];
instrumentState = new InstrumentState[marketList.Length+1];
for( int i=0; i<marketList.Length; ++i )
{
Log("Using Instrument " +
marketList[i],NinjaTrader.Cbi.LogLevel.Information);
Print("Adding " + marketList[i]);
instrumentState[i+1] = new InstrumentState();
Add(marketList[i],PeriodType.Minute,1);
}Regarding the exchanges, I have assigned only Xetra to the German stocks.
Regards,
Martin
NinjaTrader_Dierk
12-04-2007, 04:32 AM
You need to assign Xetra and Default exchanges in the instrument manager (as with any other stock which always has Default and the native exchange assigned).
EvolveK
12-04-2007, 04:39 AM
OK, I will try that then. The thing is: when I start the strategy I obviously have to select ONE instrument under the option "Data Series" to initialize it (this is usually one that is part of the respective marketlist array, but does not matter really for trading). What exchange do I have to chose there? "Xetra" or "Default"?
NinjaTrader_Dierk
12-04-2007, 04:41 AM
I would try Default.
EvolveK
12-04-2007, 05:13 AM
I have added the "Default" exchange some of the Instruments. This does not change anything about the problem. In the "New Strategy" Dialog, I cannot select the German stocks unless I change the Exchange from "Default" to "Xetra" (using the former, even if I use the search dialog to select the instrument directly from the instrument list, the field Dataseries/Instrument just turns blank). Using "Xetra" I can add the strategy, but if I click "Start", I still get the same error message.
Other ideas? Thanks,
Martin
NinjaTrader_Dierk
12-04-2007, 05:15 AM
You added the instruments in question to your (default) instrument list no?
EvolveK
12-04-2007, 05:27 AM
No, none of the German instruments is in the "Default" instrument list. However, none of the NDX100 instruments is in the "Default" list either, and as mentioned before, it's all working fine with NDX100 stocks.
Rather, I have separate lists for these stocks for backtesting purposes (NDX100, and HDAX). My understanding is that these lists are irrelevant for anything but backtesting on portfolios, since I directly access the instruments in my code using the "MarketLists" when running the strategies.
The problem must be something else, I guess?
NinjaTrader_Dierk
12-04-2007, 05:34 AM
With NT6 you need to add them to an instrument list. NT6.5 does not have this requirement.
EvolveK
12-04-2007, 05:40 AM
I have NT 6.0. My "Default" instrument contains nothing but those 6 demo instruments (like "ER2 12-07"), and despite that, I have been trading Nasdaq100 stocks for about a month without a problem.
What should I do?
Also, I think this process is getting a little tedious via the forum: is there any possibility to do this via chat or phone?
Thanks and best regards
Martin
NinjaTrader_Dierk
12-04-2007, 05:43 AM
>> What should I do?
Please see my post below: add your XETRA instruments to any instrument list if you are on NT6 or try NT6.5.
EvolveK
12-04-2007, 05:50 AM
But I have already done that: all the instruments I want to trade are in an instrument list called "HDAX Liquid". The Nasdaq instruments are in a list called "Nasdaq 100". Everything seems to be configured the same way now for the German stocks as for those US stocks which I am already trading. The only difference is the exchange (Xetra instead of Nasdaq) and the currency (EUR instead of USD).
Again: is there any way to do this via chat or phone? That would be very helpful.
Thanks
Martin
NinjaTrader_Dierk
12-04-2007, 05:53 AM
Please send a mail with your phone number to "support AT ninjatrader DOT com" a member of our team will contact you.
Don't forget to refer to this post.