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

Error on calling 'OnMarketDepth'

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

    Error on calling 'OnMarketDepth'

    I have installed the version 7.0.18 and I have performed a strategy that up to the version 17 worked. Now it appears me the following error:

    **NT** Error on calling 'OnMarketDepth' method for strategy 'BrunoBooksBase0012_Stop_simulato/821b97711d4b44068cf59ee3b9c9e57e': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

    From thing it is due and as I can correct?
    thanks.

    #2
    Hello onurbbruno,

    Can you share the code that is causing this?

    To resolve, can use Try-Catch to identify where the exception is.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Perhaps I have already resolved the problem. I had a window of opened DOM. Closing is not repeated her/it anymore the error. If it will still happen I will do as you have pointed out me, I will send you the code, to individualize the exception. Thanks you are always very fast and effective.

      Comment


        #4
        Thanks for letting know. I will pass it on to Ryan.

        Enjoy the upcoming Holiday weekend and Happy Trading!!
        Vince B.NinjaTrader Customer Service

        Comment


          #5
          I have implemented the 'OnMarketDepth' method in three strategies. Activating only all and three the strategies the first one in order of activation is activated, in regular way and without errors. The others instead two jam and introduce the following error :
          " You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart. ".


          As it is possible to avoid this error and block of the strategies?
          Thanks.

          Comment


            #6
            onurbbruno, to clarify - are you working alongside the NT7 code sample for OnMarketDepth() here?

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            21 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X