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

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.

    JimNinjaTrader Customer Service

    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 pechtri, 06-22-2023, 02:31 AM
      10 responses
      124 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Yesterday, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Yesterday, 03:01 PM
      2 responses
      22 views
      0 likes
      Last Post helpwanted  
      Working...
      X