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

Help with inner workings of FloatSeries Class

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

    Help with inner workings of FloatSeries Class

    I have been having decent success working with adding a FloatSeries Class with the excellent samples in http://www.ninjatrader.com/support/f...ead.php?t=4991 .

    One thing that I have come across that I had quite the time figuring out is the nature of the [bars ago] suffix and what it's actually doing.

    I have an indicator that writes to the float series every on bar update.

    The float series contains values that are held constant with an occasional change. Here's where it gets interesting and has been the source of headache.

    When I compare this.myFloatSeries[0] to this.myFloatSeries[1], it produces the last two values that are different.

    So if the series contains:
    bars ago & value
    [0] 5
    [1] 5
    [2] 5
    [3] 7
    [4] 7
    [5] 7
    [6] 7
    [7] 9
    [8] 9

    this.myFloatSeries[0] and this.myFloatSeries[1] returns 5 and 7
    similarly
    this.myFloatSeries[1] and this.myFloatSeries[2] seem to return 7 and 9

    It seems to be ignoring all repeated values.

    If someone could tell me if this is what it is supposed to do or if my amateur/novice programming status has finally caught up with me, I would greatly appreciate it.

    Thanks.

    #2
    Hi 8DTK8, the accessing of the values via the barsAgo index should be the same for any dataSeries type object - http://www.ninjatrader-support.com/H...iesObject.html

    When are you printing those values from the code to debug?

    Which CalculateOnBarClose setting are you working with?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hmmm, this is the same kind of behavior I have been experiencing and posting questions about. I finally shelved the idea because I couldn't get it to work in anything close to the way I was expecting.

      It seems like our issues are very similar; I would put a value in 0 (say 12) and then the next bar put a value in 0 (say 55) and read 1 and instead of getting the number I put in 0 (12) last bar, I would get a seemingly random number that I could not tie to anything.

      Scott
      Last edited by ScottB; 09-29-2010, 09:18 PM.

      Comment


        #4
        This is a bit of a late follow up, but after a bit of struggling, I figured out what I was doing wrong. It was my variable declaration that was flawed not the way the FloatSeries was being created.

        Thank you for your help Bertrand. The link was helpful.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        48 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by samish18, Today, 01:01 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by WHICKED, Today, 12:56 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by WHICKED, Today, 12:45 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X