Created
September 6, 2019 04:53
-
-
Save jsrimr/2730fd41c164c415c9a0aed25c296a7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fnMACD(m_Df, m_NumFast=12, m_NumSlow=26, m_NumSignal=9): | |
EMAFast = m_Df['c'].ewm( span = m_NumFast, min_periods = m_NumFast - 1).mean() | |
EMASlow = m_Df['c'].ewm( span = m_NumSlow, min_periods = m_NumSlow - 1).mean() | |
MACD = EMAFast - EMASlow | |
MACDSignal= MACD.ewm( span = m_NumSignal, min_periods = m_NumSignal-1).mean() | |
MACDDiff= MACD - MACDSignal | |
return MACDDiff.mean() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment