Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Series<T> Behaviours for Infinite vs 256

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

    Series<T> Behaviours for Infinite vs 256

    If MaximumBarsLookBack == MaximumBarsLookBack.TwoHundredFiftySix
    • It is important that a value is assigned on every call to OnBarUpdate for that series. Because its a circular ring buffer, if values are not assigned to it for every bar update, its possible to discover old values once the buffer is full.
    • As covered in the documentation, IsValidDataPoint, IsValidDataPointAt, Reset and ResetAt are not valid calls. As a result, there is no way to skip plotting values of the series.
    If MaximumBarsLookBack == MaximumBarsLookBack.Infinite
    • If a value is not assigned during OnBarUpdate it will remain the default value.

    If a Series<T> is created with a different look back from the one set for the indicator, there is no way to know that it was set differently. There is no way to query a Series<T> itself to see what sort of look back it is using.

    If a Series<T> is only keeping the last 256 values, how does a chart plot more then 256 values on screen if there are more then 256 values visible?

    #2
    Hello ntbone,

    Thanks for your question.

    There are cases where MaximumBarsLookBack is forced to infinite. PriceSeries and Plots qualify here.

    •ISeries<T> objects that hold bar data (such as Close, High, Volume, Time, etc) always use MaximumBarsLookBack.Infinite which ensures all data points are always accessible during the lifetime of your NinjaScript indicator or strategy.

    •Series<double> objects that hold indicator plot values always use MaximumBarsLookBack.Infinite which ensures that charts always display the entire indicator's calculated values.


    It is also possible to use MySeries.IsValidDataPoint(256) as a test to see if a the Series uses MaximumBarsLookBack.Infinite or TwoHundredFiftySix. The Series using TwoHundredFiftySix will throw an error while the Series using Infinite will not. A try-catch could be used to handle the error.

    Please let us know if you have any additional questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    581 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    338 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X