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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X