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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X