Hello, I am using trader_ema function to calculate EMA http://php.net/manual/en/function.trader-ema.php . Once I caclculate, the result do not match to those what MT4 shows. What is wrong?
I have checked close prices - they match to what is shown in MT4 and my array which I pass to trader_ema.
Here are ema 10 results:
Here are close prices:
And here I took from MT4 chart ema 10 values :
1,16554
1,16507
1,16493
1,16475
1,16464
1,16433
1,16386
1,16326
1,16276
1,16232
Why is that? Is php or MT4 calculating it in wrogn way.
I even tried downloading another PHP function to calculate, and it callculates even more different results:
https://github.com/markrogoyski/math...cs/Average.php
start looking from index 9, because first should be nonsense, because it does not have enough data.
I have also tried with excel, and it gives also different results what the hell is wrong? I tried to make excel formula by example from here. Even first number which should be moving average does not match.
Oh actually mistake was in excel, after fixing, at least it match with php trader_ema , formula had to be this: =ROUND(C12*2/(10+1)+D11*(1-2/(10+1)); 5)
still, why it does not match with MT4 indicator?
Hmm maybe it is because MT4 has previous ema values so it uses previous ema values. While on excel we start with moivng average.
Tried to draw chart how they differe and as time goes, they get closer.
Yea, checked last couple of candles in whole month, then trader_ema and MT4 ema matches. So probably problem was starting point.
I have checked close prices - they match to what is shown in MT4 and my array which I pass to trader_ema.
Here are ema 10 results:
Here are close prices:
Attached Image
And here I took from MT4 chart ema 10 values :
1,16554
1,16507
1,16493
1,16475
1,16464
1,16433
1,16386
1,16326
1,16276
1,16232
Why is that? Is php or MT4 calculating it in wrogn way.
I even tried downloading another PHP function to calculate, and it callculates even more different results:
https://github.com/markrogoyski/math...cs/Average.php
start looking from index 9, because first should be nonsense, because it does not have enough data.
Attached Image
I have also tried with excel, and it gives also different results what the hell is wrong? I tried to make excel formula by example from here. Even first number which should be moving average does not match.
Attached File(s)
tikrinimai su excel.xlsx
9 KB
|
308 downloads
Oh actually mistake was in excel, after fixing, at least it match with php trader_ema , formula had to be this: =ROUND(C12*2/(10+1)+D11*(1-2/(10+1)); 5)
still, why it does not match with MT4 indicator?
Hmm maybe it is because MT4 has previous ema values so it uses previous ema values. While on excel we start with moivng average.
Tried to draw chart how they differe and as time goes, they get closer.
Attached Image
Yea, checked last couple of candles in whole month, then trader_ema and MT4 ema matches. So probably problem was starting point.