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