Closed albertZhuo420 closed 4 months ago
TA_MACD is implemented with the EMA method as defined by Gerald Appel (the creator of MACD).
It is therefore expected for TA_MACDEXT with TA_MAType_EMA to match TA_MACD
EMA can produce different values depending how it is implemented (how "far" it goes back into the historical data). This often explains variations between software/websites.
Designating Binance as the correct reference is a personal choice or requirement for your application.
If you want to match Binance calculation, then consider sharing details on their algorithm and may be it could be implemented as yet another MACD variation?
Sorry, I understand what you mean. Will this project continue to be updated and maintained?
I used Binance's BOMEUSTD daily data to verify the MACD, the function I used was TA_MACD, the final result was inconsistent with Binance's data, then this function is based on the MA, so I dared to use TA_MACDEXT, and set TA_MAType_EMA, the final result is the same as TA TA_MACDEXT, and set TA_MAType_EMA, the result is the same as TA_MACD. I switched to ta-lib-python, and the results are the same!!!! I provide the python code, and the BOME k-line data. The result of running the c++ code is the same as running the Python code. The OS i used is Ubnutu22.04. use pip to install TA_LIB.
input.csv macd_ta.py.txt