Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7B5 - DataSeries in Multi-Instrument Strategy Error

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

    NT7B5 - DataSeries in Multi-Instrument Strategy Error

    Hi,

    I'm using the following strategy code on a ES 12-09 (Zen-Fire) chart, and get the following output:

    CurrentBar: 37
    **NT** Error on calling 'OnBarUpdate' method for strategy 'TestDSStrategy/307ee535ba044c06b4ae971d5128ceac': Index was outside the bounds of the array.

    When I comment out the "Add("TF 12-09", ..." line, I get no error with the following output:

    CurrentBar: 20
    testDS[0]: 1104.5
    CurrentBar: 21
    testDS[0]: 1104.75
    ...

    Note: I am using all the default Strategy settings when attaching to the chart of ES 12-09.

    Thanks

    namespace NinjaTrader.Strategy
    {
    public class TestDSStrategy : Strategy
    {
    #region Variables
    #endregion

    private DataSeries testDS;

    protected override void Initialize()
    {
    Add("TF 12-09", BarsPeriod.Id, BarsPeriod.Value, BarsPeriod.MarketDataType);
    testDS = new DataSeries(this);
    Enabled = true;
    CalculateOnBarClose = false;
    }

    protected override void OnBarUpdate()
    {
    if ( BarsInProgress != 0 ) return;
    testDS.Set(Closes[0][0]);

    Print("CurrentBar: " + CurrentBar);
    Print("testDS[0]: " + testDS[0]);
    }

    #region Properties
    #endregion
    }
    }

    #2
    Forgot to mention, I'm using: 1 min - Ask (on the chart).

    Comment


      #3
      bethewater,

      Thanks. We will look into it.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X