Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to create a multi-array dataseries

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

    how to create a multi-array dataseries

    Hey I am new here and trying to build a dataseries with multiple arrays in my strategy, but not quite sure how to do this.

    What I am trying to do is using multiple instruments (9 stocks), calculate each instrument's SMA and assign the value to its corresponding dataseries. Such as SMADataSeries[i][j][k], where i refers to the instrument index, j means its SMA value, while k stands for BarAgo.

    How can I do it in variable declaration and initial part?
    like this?
    private DataSeries [8][][];

    Thanks a lot!

    #2
    Hello cationic,

    Please see here for a tutorial on DataSeries.

    See here for help with multiple series.


    DataSeries are arrays, synced to each bar object. You don't have to create the array structure as the standard data series should do everything you need.

    To set a DataSeries array for the secondary series SMA, you would use something like this:

    myDataSeries.Set(SMA(Closes[1], Period)[0]
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      82 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      43 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X