Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manipulating DataSeries

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

    Manipulating DataSeries

    To reference, I'm creating my own solution to the previous topic: https://ninjatrader.com/support/foru...u-usage-on-nt8

    I've figured out a way to do so and I'm looking for an elegant solution. Currently I have an ugly solution by using an indicator to overlay an approximate copy of the bars type I wish to add to the chart. I'm then taking the output(HLCOV) of that and outputting the data series. However, because a data series fills in 0's or NaN's when not set my data series is inaccurate(or extremely slow to iterate through) because I have far more useless data than I need. Because of this, I'm taking in the indicator values and storing them in an ever growing array which eventually eats up memory. Before I start implementing even more messy code to fix that, I have a question

    Core question:
    Is there a way to remove a bar from a data series, or only add to it when I wish?

    #2
    Just to clarify what I'm looking for. Simply; When my primary data series or BarsArray is at 256, I'd like my secondary data series to be at something like ~25-30, depending on its use case.

    Comment


      #3
      Hello RaddiFX,

      Thanks for your post.

      The only supported way to be able to remove a bar would be from the BarsType with RemoveLastBar. There would not be a way to remove bars at an indicator/strategy/other NinjaScript level.

      You would have to make your own array's/collections if you wanted to have a secondary "series" that is not synchronized to bars.

      Comment


        #4
        Okay, Thanks.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        53 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X