Exponential Moving Average of H1 on M5 without H1 data

 
Good day,
does anyone know how to bring an Exponential Moving Average from H1 timeframe to M5 timeframe without using the data from H1, since you can read the opening price in the H1 chart on the M5 chart.
Thanks in advance
 
Arthur Singer:does anyone know how to bring an Exponential Moving Average from H1 timeframe to M5 timeframe without using the data from H1, since you can read the opening price in the H1 chart on the M5 chart.

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.

 

Thank you very much, but I already tried it. It is not working.


 
Arthur Singer: but I already tried it. It is not working.
  1. “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

  2. 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.”

 
Arthur Singer: Thank you very much, but I already tried it. It is not working.


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!

 
I read it, but my goal was to achieve a copy of the green indicator. But thank you very much.
 
Optionally you can form the H1 data from the M5 data.

Take 12 M5 periods, starting at every hour, the open of the first candle ist your H1 open. Catch the low and high from these 12 candles as your Low and High for the H1, the close of your last candle is your H1 close.

Then you can form your EMA as you want.
Reason: