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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      181 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      334 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      258 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      358 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      187 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X