Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Series Indicators and Duplicate AddDataSeries

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

    Multi-Series Indicators and Duplicate AddDataSeries

    If I am looking at a one minute chart and my indicator has code to AddDataSeries(BarsPeriodType.Minute, 1) I will have two bar series in the chart that are covering the exact same time period. Is the data duplicated?

    #2
    I checked for BarsArray[] equality and sure enough BarsArray[0] == BarsArray[i] if the data series for BarsArray[i] is the same time period as the chart.

    Comment


      #3
      Hello ntbone,

      It is expected that there will be a BarsInProgress and BarsArray index for the primary series and for each series added with AddDataSeries.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        That's not what I was querying, nor what my conculsion was.

        If I have a 1 minute chart, and I have a call to AddDataSeries(BarsPeriodType.Minute, 1); the BarsArray[0] will be the exact same object as BarsArray[i] for the index which correlates to AddDataSeries call. It doesn't appear to generate a separate object but puts the reference to the same object in both slots of the BarsArray[].


        I would also expect, if for some odd reason, I called AddDataSeries(BarsPeriodType.Minute, 1) twice in a row, that the object in the BarsArray[] for both series would be the same object.
        Last edited by ntbone; 02-28-2021, 11:52 PM.

        Comment


          #5
          Hello ntbone,

          Yes, NinjaTrader caches the series objects and does not technically duplicate them. However, the indexes remain, and OnBarUpdate will still run for both of the duplicated series.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thanks. That is consistent with the behavior I have observed.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            50 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            69 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            36 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            97 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            60 views
            0 likes
            Last Post PaulMohn  
            Working...
            X