Announcement

Collapse
No announcement yet.

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?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            345 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            558 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X