Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Array dimensions exceeded supported range

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

    Array dimensions exceeded supported range

    I have an indicator that uses 4 additional secondary series of the primary instrument for MTF purposes. It works fine on a chart but when I try to add it to a strategy I get the error: Array dimensions exceeded supported range. The error goes away when I reduce the number of days to backtest. Any ideas on what causes this?

    #2
    Hello Lance El Camino,

    Is there other code in the script?

    Could the script be calling a Draw method with a negative barsAgo value or barsAgo value that is greater than CurrentBar or outside of BarsInProgress 0?

    Is there proper checking in the code that CurrentBars[barsInProgressIndex] is greater than any barsAgo values for the Series of that BarsInProgress?

    https://ninjatrader.com/support/help...inprogress.htm
    https://ninjatrader.com/support/help...urrentbars.htm

    Use prints to determine the specific line of code causing the error.
    Using Prints and TraceOrders to understand behavior.

    What is that specific line causing the error?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, there are Draw.Rectangle methods where the endBarsAgo value is -100000 so it extends beyond current time. Is there a way to have it keep extending with each new bar that prints?

      Comment


        #4
        Hello Lance El Camino,

        Using negative indexes for barsAgo values is not supported and would be causing that error.

        You can use barsAgo 0 to draw to the current bar.

        If you are wanting to render to the edge of the chart, you may want to custom render in OnRender() instead of using a Draw method.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Is that specific to strategy scripts because it works when the indicator is on the chart.

          Comment


            #6
            Hello Lance El Camino,

            This would be unsupported for any script including strategies and indicators, so there would not be any expected behavior.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            43 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            65 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X