This commit is contained in:
dsyoon
2023-10-24 21:54:46 +09:00
parent 2bd4c60855
commit 25a6e77125
3 changed files with 14 additions and 11 deletions

View File

@@ -23,9 +23,9 @@ class MACD:
df = pd.DataFrame(df)
# MACD 관련 수식
ma_12 = df.close.ewm(span=short).mean() # 단기(12) EMA(지수이동평균)
ma_26 = df.close.ewm(span=long).mean() # 장기(26) EMA
macd = ma_12 - ma_26 # MACD
ma_short = df.close.ewm(span=short).mean() # 단기(12) EMA(지수이동평균)
ma_long = df.close.ewm(span=long).mean() # 장기(26) EMA
macd = ma_short - ma_long # MACD
macds = macd.ewm(span=t).mean() # Signal
macdo = macd - macds # Oscillator