import numpy as np
import yfinance as yf
import talib
msft = yf.Ticker("MSFT")
history = msft.history(period="6mo")
closes = np.asarray(history['Close'])
ema = talib.EMA(closes, timeperiod=100)
print(ema)
if you compare the results to TradingView's EMA of MSFT there'll be a noticeable difference, I noticed that the docs says the following about EMA:
NOTE: The EMA function has an unstable period.
but even on short periods you can notice the difference, how can we calculate EMA like TradingView ?
consider the following code
if you compare the results to TradingView's EMA of
MSFT
there'll be a noticeable difference, I noticed that the docs says the following about EMA:NOTE: The EMA function has an unstable period.
but even on short periods you can notice the difference, how can we calculate EMA like TradingView ?