Indicator longer than the data series?

 

Hi,


I am a newbie with MQL5 and I am just familiarizing with the fundamentals.

I am debugging on historical datat (not runtime). I do not understand why the function Barcalculated applied to a simple SMA returns 1 element more than the function Bars applied to the source time series.

In other words, seemeingly I have, let's say, 100 data bars and 101 indicator values. Weird.

To be more precise , this is happening when I use a closed pack of historical data, while everything is aligned with runtime testing.

Might it be that the function Barcalculated counts also the last , open bar not included in the "closed" packet?

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...