Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7B4 Data Series Issues

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

    NT7B4 Data Series Issues

    An IntSeries and a DateTimeSeries appear to store invalid values after processing for the third day (session). They seem to walk on themselves.

    The attached indicator demonstrates the problems.

    Instrument=ES, Broker=IB, Interval=5Min

    Am I doing something wrong?
    Attached Files

    #2
    I guess I'm not sure I understand the logic of your code. AFAIK I can tell you wanted to save a session counter and a timestamp once per session. So as you have 5 sessions your container(s) would hold 5 items.

    For that use case you should NOT use IntSeries nor TimeSeries. Both are meant for a holding value for pretty much EVERY bar, which is not what you are interested in.

    I suggest using regular .NET containers like an ArrayList instead.

    Comment


      #3
      I understand what you are saying and you are correct in what you are saying but, the datasereis is not working correctly. Do you agree?

      Comment


        #4
        No I don't, since they are not meant for your use case.

        Also, please see here: http://www.ninjatrader-support2.com/...umBarsLookBack

        Comment


          #5
          With all due respect, who should decide how I should use a dataseries? If I store a "1" in every 81st slot and a "0" in all others that is my decision. That dataseries should still work corrrectly. Put an else path on the first If statement and store a zero in the "unused" slots of the IntSeries and the current date in the DateTimeSeries. The data is not stored correctly. It works fine on 6.5. Compare the output in the first post with the one attached here which was run under 6.5. Why is there a difference between the two versions?
          Attached Files

          Comment


            #6
            NT should throw an exception if you reference data that isn't there, i.e. referencing >256 bars ago for a DataSeries which only contains 256 values. Returning bad data without throwing an exception is clearly undesirable behavior.

            If you can't throw an exception, then the default property should be infinite lookback to keep people out of trouble.

            Comment


              #7
              MaximumBarsLookBack.Infinite is not available for indicators.

              There is no "new" signature for (Indicator, MaximumBarsLookBack)
              Last edited by hemlock; 11-17-2009, 03:56 PM.

              Comment


                #8
                This for sure compiles in NT7 Beta 4.

                DataSeries myDataSeries = new DataSeries(this, MaximumBarsLookBack.Infinite);

                RayNinjaTrader Customer Service

                Comment


                  #9
                  Sorry, I should have been more specific.

                  I was using IntSeries and DateTimeSeries, which do not compile.

                  Comment


                    #10
                    Thanks for clarification, will look into.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      The real issue here is that NT should never return bad data without warning. Right now you are returning a modulo-256 lookup into the last 256 values of the dataseries, without throwing an exception. This can cause existing code, or code which uses the default settings, to produce bad and unpredictable results.

                      NT should throw an exception when referencing [>=256] on a dataseries with maximum lookback of 256 instead of returning bad data.

                      It can't be that hard. Instead of ignoring the high-order byte of the index like you do now, throw an exception if the high-order byte is non-zero.

                      If you can't do that, you should default to infinite lookback.

                      Comment


                        #12
                        Originally posted by kdoren View Post
                        The real issue here is that NT should never return bad data without warning. Right now you are returning a modulo-256 lookup into the last 256 values of the dataseries, without throwing an exception. This can cause existing code, or code which uses the default settings, to produce bad and unpredictable results.

                        NT should throw an exception when referencing [>=256] on a dataseries with maximum lookback of 256 instead of returning bad data.

                        It can't be that hard. Instead of ignoring the high-order byte of the index like you do now, throw an exception if the high-order byte is non-zero.

                        If you can't do that, you should default to infinite lookback.
                        Well said. If you allow me to access the data at index 312 I'm expecting the data to be correct. How can you allow the collection to have a count property greater the 256 when there is only 256 items. Very dangerous. An exception needs to be thrown.

                        Comment


                          #13
                          Originally posted by hemlock View Post
                          Sorry, I should have been more specific.

                          I was using IntSeries and DateTimeSeries, which do not compile.
                          This is a bug which will be fixed with next update. Thanks for reporting.

                          Comment


                            #14
                            >> How can you allow the collection to have a count property greater the 256 when there is only 256 items. Very dangerous. An exception needs to be thrown.
                            Will be done with next update. Thanks for pointing that out.

                            Comment


                              #15
                              Thank you.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              636 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              366 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              107 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              568 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              571 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X