well for starters do you want the simple moving average or the smoothed moving average? simple moving average is SMA smoothed moving average is the SMMA. Secondly the moving average is usually computed at the close unless you want the median use the following
double MoveA = iMA(NULL,1,50,0,MODE_SMA,PRICE_CLOSE,0);
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
double MoveA = iMA(NULL,PERIOD_M1,50,0,MODE_SMMA,PRICE_MEDIAN,0);
When I use the print function to print out MoveA, it is never very far away from the current quote. That is, it doesn't seem to be the moving average that appears on the chart.