Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy will not enable

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

    Strategy will not enable

    Having an issue with a strategy that will not enable. I have a nearly identical strategy for going long that works great with no issues. I am using the cumulative delta indicator and using

    AddDataSeries(Data.BarsPeriodType.Tick, 1); and also


    if (BarsInProgress != 0)
    return;

    if (CurrentBars[0] <3)
    return;

    I get Error on calling OnBarUpdate method on bar 68 (different number everytime). Index is outside the bounds of the array.

    Thanks

    #2
    Hello Kudos,

    Thanks for your post.

    What line is the script erroring on? What data series is it being called on? Seeing what line is throwing the error can give a good hint at what index was being referenced that was out of bounds.

    You may use debugging prints to identify the line your script errors on.

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    Also keep in mind that when adding a single tick data series, OnBarUpdate processes each data series in the script, including the added data series. We would use BarsInProgress checks to have logic run on individual data series, and we would use CurrentBars checks as opposed to just CurrentBar checks to make sure there are enough bars processed in the data series we are accessing.

    Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

    Making sure there is enough data in the Data Series you are accessing - https://ninjatrader.com/support/help...nough_bars.htm

    We look forward to assisting.

    Comment


      #3
      Thanks Jim

      Found problem it was with a custom indicator I use for backtesting for entry limits

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X