init
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user