Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      JimNinjaTrader Customer Service

      Comment


        #4
        Okay, Thanks.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X