Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running a Strategy on German Stocks with Interactive Brokers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Running a Strategy on German Stocks with Interactive Brokers

    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

    #2
    Can you try and select the instrument ADS from within the Control Center order tab, do you get any data?
    RayNinjaTrader Customer Service

    Comment


      #3
      To do that, does it matter whether the market is currently open or not?

      Thx
      Martin

      Comment


        #4
        Yes, I would test that when the market is trading.
        RayNinjaTrader Customer Service

        Comment


          #5
          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

          Comment


            #6
            - what is the exact Add() syntax you apply?
            - which exchanges have you assigned to your instrument in question in instrument manager?

            Comment


              #7
              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

              Comment


                #8
                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).

                Comment


                  #9
                  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"?

                  Comment


                    #10
                    I would try Default.

                    Comment


                      #11
                      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

                      Comment


                        #12
                        You added the instruments in question to your (default) instrument list no?

                        Comment


                          #13
                          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?

                          Comment


                            #14
                            With NT6 you need to add them to an instrument list. NT6.5 does not have this requirement.

                            Comment


                              #15
                              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

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by KenneGaray, Today, 03:48 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post KenneGaray  
                              Started by thanajo, 05-04-2021, 02:11 AM
                              4 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Working...
                              X