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 Stanfillirenfro, Today, 07:23 AM
            9 responses
            23 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by George21, Today, 10:07 AM
            0 responses
            8 views
            0 likes
            Last Post George21  
            Started by DayTradingDEMON, Today, 09:28 AM
            3 responses
            19 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by navyguy06, Today, 09:28 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            8 responses
            32 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X