How are SMAs Calculated in MT4

 

Hi,

I'm trying to do code a platform in Python to do an automated backtest and to confirm it works I want to do a visual check with MT4 charts. However I've found that I don't know how MT4 calculates its SMAs which is leading to problems. Which prices are used to compute SMAs in MT4?? Closing?? average??

Thanks very much

 
Trader28:

I'm trying to do code a platform in Python to do an automated backtest and to confirm it works I want to do a visual check with MT4 charts. However I've found that I don't know how MT4 calculates its SMAs which is leading to problems. Which prices are used to compute SMAs in MT4?? Closing?? average??

If you're talking abut the "Moving Average" entry in the "Indicators" list, then it uses whatever you tell it to use in the "Apply to" field when adding it to the chart. (And these options basically just correspond to the parameters for the iMA() function: https://docs.mql4.com/indicators/iMA)
 
Thanks!