To that effect, I created a simple indicator with a private DataSeries SS_State which was initialized this way (in Initialize()):
SS_State = new DataSeries(this, MaximumBarsLookBack.TwoHundredFiftySix);
Then, in OnBarUpdate(), I query the oldest value in SS_State:
Print("BAR# " + CurrentBar + " ; SS_State[SS_State.Count-1] = " + SS_State[SS_State.Count-1]);
This generates the following exception:
Exception BAR# 2546 : System.ArgumentException: barsAgo needed to be between 0 and 255 but was 2546
It turns out that SS_State.Count returns values up to CurrentBar, where I was expecting it to return values up to 256 (since that object was created with a max 256 bars LookBack.).
Is this a bug? If not, how can I assess the number of datapoints in a DataSeries object?
Thanks in advance
Comment