harshlath: EMA = (CLOSE(i) * P) + (EMA(i - 1) * (100 - P))
- This is the same as in Moving average - Wikipedia, the free encyclopedia except it's not 100 - P but 1 - Alpha.
- Don't use that formula as in magnifies roundoff. Use the rewritten version that that fades roundoff. EMA = EMA(i-1) + alpha * [Close(1) - EMA(i-1)]
- In any case, alpha = 2 / (period + 1) and your P = 100 * alpha. Drop P and just use alpha.
- Starting point is irrelevant and arbitrary. use first close or average of the first few. You must have 3.45 (N+1) bars from the first before your EMA is relevant from any starting point.
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
Hello,
I need to calculate EMA in excel for backtesting. The formula for MT4 help topics is:
EMA = (CLOSE(i) * P) + (EMA(i - 1) * (100 - P))
Where:
CLOSE(i) — the price of the current period closure;
EMA(i-1) — Exponentially Moving Average of the previous period closure;
P — the percentage of using the price value.
Question:
a) Does anyone what value MT4 assigns to 'P'
b) Also I need Previous period EMA. How do I get that for my starting point
Thanks a lot