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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        93 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        138 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        123 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        73 views
        0 likes
        Last Post PaulMohn  
        Working...
        X