Libraries: MovingAverages - page 2

 
Gerard Willia G J B M Dinh Sy #:

Good morning

Is it clearer like this?

No, I already saw it thinking that position was the first bar to calculate as example 20 if I want 20 period but I'm not sure. 

price has [position - 1] (and not +1) because mql5 doesn't set as series by default? 

 
Milko Vivaldi # :
because mql5 doesn't set as series by default? 

The as_series is according to...
It will depend on what you are looking at.

But to make an SMA, we don't care.
It doesn't come into play, unlike the average exhibition where meaning is important.

 
Gerard Willia G J B M Dinh Sy #:

The as_series is according to...
It will depend on what you are looking at.

But to make an SMA, we don't care.
It doesn't come into play, unlike the average exhibition where meaning is important.

Ok, therefore if I want SMA with 5 periods which position I have to write?

 
Jus do not understand why there not by default an SMA, EMA.... indicators in list of MQL5 to use in the script as other platforms do, we do not want to reinvent the wheel, just use the wheel !!
 
@Raf #: Jus do not understand why there not by default an SMA, EMA.... indicators in list of MQL5 to use in the script as other platforms do, we do not want to reinvent the wheel, just use the wheel !!

MetaTrader/MQL does provide default built-in functionality for many indicators, including multiple types of moving averages, but it seems that most users and would-be "coders", like yourself, don't bother to read the documentation.

The above library merely exists as example code for those wanting to understand the mechanics behind implementing moving averages.

 
Automated-Trading:

MovingAverages:

Author: MetaQuotes Software Corp.

FYI - For those of you missing documentation on these function signatures for this MovingAverages.mq5 library standard includes - Why don't any of you try asking one of the Artificial Intelligence portals a specific question on any one of these functions listed here and it will directly infer recreated documentation that the developers from MetaQuotes utterly left out for whatever reason on their part? Hey folks -document your code please, no matter how small! Thank you!