- Questions from Beginners MQL5 MT5 MetaTrader 5
- Exponential moving average
- Huge performance issues, context switching, how indicators are being dealt with internally
Example: EMA(20) on H1, use EMA(240) on M5.
Why? because H1/M5 = 60/5 = 12. So if you multiply the period (20) by 12, you get (240). It is that simple.
Obviously the new EMA(240) on M5 will not be exactly the same as EMA(20) on H1 as it has more data to work with, but it will be very similar.
-
“Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
How To Ask Questions The Smart Way. 2004
When asking about code -
Your image shows a higher timeframe moving average (lime) and the longer period MA (yellow). That is exactly what you should expect. Fernando said “but it will be very similar.”
Did you not read what I wrote? "Obviously the new EMA(240) on M5 will not be exactly the same as EMA(20) on H1 as it has more data to work with, but it will be very similar."?
Obviously it will not generate "steps" because it is calculating the values for every M5 bar, not on the opening/closing of H1 bars.
If you want it to "step", then you will have to write your own indicator to do that!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use