Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy Log: get_order_book error

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

    Strategy Log: get_order_book error

    Hi there,

    I am about to code and test a strategy for NT8. I would say I am about to be finished with it, but I want to get the function "get_order_book" running. Every time I activate the strategy it says: "get_order_book error: 13"
    Does anybody know what is missing? Maybe it´s Level 2 data, but I am not sure. I have a standard Rithmic connection set up, which is working so far, but with the strategy enabled, the log prints the above error.

    Thanks in advance!
    Alex

    #2
    Hello atcler,

    There is not a method in NinjaScript called get_order_book, is that a custom method you made?

    If you are working with the level 2 override named OnMarketDepth that requires having a subscription to level 2 data.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse,

      yes the method get_order_book is a custom method. I received that part of the code from the guys who made my indicator and I was not aware that it is not part of NinjaScript. So it seems to be the missing LVL2 data. I will test with market depth tomorrow, thanks again for the quick reply

      Alex

      Comment


        #4
        Hello atcler,

        A quick way to test your level 2 is to use the New -> Level 2 window. If you find that you don't have a subscription and are using NinjaTrader brokerage you can manage your data subscriptions from the client portal. You can otherwise email support[at]ninjatrader.com for information on how to get level 2 data. Alternatively you can email the broker you are using.

        You may also need to add some error handing into your custom method in case you do have level 2 data and still get that message.

        JesseNinjaTrader Customer Service

        Comment


          #5
          No I am sure that I do NOT have LVL 2 data at the moment, only LVL 1. I just want to know if this missing LVL 2 data is the problem which makes the error to come up. If this is the reason I will subscribe to LVL 2

          Comment


            #6
            Hello atcler,

            It would appear that is the reason, I couldn't really say because I don't know what code is being used or where that method is being called in your script.

            The error you provided has no detail besides the method name and a number which isn't helpful to know what happened.

            If you want to use that method for part of your trading and that method is using level 2 data then yes you absolutely need to have level 2 data. If that is not specifically needed you can either disable that portion of the code or add error checking to prevent the error when level 2 data is not present.

            You will likely need to find in the file where the method get_order_book is being called from to get a better idea of why that error is happening. In NinjaScript whenever you use level 2 data you will be using the OnMarketDepth override but that won't be called if you don't have level 2 data. If your custom method is being called from OnBarUpdate or somewhere else that is likely the problem, that method would likely need to go in the OnMarketDepth override.

            There is a sample of using level 2 data in the following link which shows how OnMarketDepth is used to build an orderbook which may help at determining where in your script the problem is coming from. https://ninjatrader.com/support/help...vel_ii_dat.htm
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AaronKoRn, Today, 09:49 PM
            0 responses
            6 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Today, 08:42 PM
            0 responses
            9 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Today, 07:51 PM
            0 responses
            10 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,977 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Today, 06:48 PM
            0 responses
            9 views
            0 likes
            Last Post rbeckmann05  
            Working...
            X