0

this has been bugging me since the morning. I searched for a solution, but other people mostly had similar problems because of different initial EMAs.

Here, I am using an array of 100 numbers for testing. I calculated emas by hand and with talib also (It is using SMA for the inital EMA). That part is correct. But, when I do ema12-ema26 by hand and calculate it with MACD function, the function is completely wrong. I tried using SMAs, but the result is still wrong... I'm looking at the MACD Line output ofcourse.

For the EMAs I'm calling the EMA functions (timeperiods 12 and 26)), and for MACD I'm using 26 12 9.

Has anyone had this problem before?

EDIT: I tried it on a 1000 number example and it seems that the MACD function value is converging towards the calculated value. I guess talib.MACD is not using the talib.EMA for the calculation of EMAs and that's why I have different results...

Mrky
  • 3
  • 4
  • When describing what you call, can you add your code to the question? This makes it easier to understand what exactly you tried and what not. – Loebl Sep 16 '18 at 14:38
  • It's using talib.EMA. Could you check my reply on similar question: https://stackoverflow.com/a/34453997/841424 and provide us with a code and mismatching results if it doesn't explain your problem? – truf Sep 17 '18 at 08:23

0 Answers0