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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        65 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        199 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        366 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        283 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X