ta-lib-python
ta-lib-python copied to clipboard
Long EMA (200) calculates wrong values
I am trying to use the EMA 200 function on the BTC/USDT. I have made sure to have more than 201 data samples but the result that I have from the calculation have a 20% spread error compared to Tradingview. If I increase the number of samples (about 800) the result become accurate.
What could this be related to?
EMA is a moving average over a window, that depends on EMA's value of a previous window. That means it has a memory. And thus it highly sensitive to a starting point at the beginning and converge to value more or less independent from a starting point since the time goes. At what time point Tradingview starts its EMA value calculation? Since the financial year? Since the beginning of the historical data? Since whatever? Find this out and start EMA calculation at this point to get exact EMA match at any time point. Or just start it beforehand to let it converge till the time you really need.