Created
June 19, 2021 13:42
-
-
Save yongghongg/e56a7c7886e36c2255bdb7727453ff50 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
# function to check for EMA Bounce | |
def check_bounce_EMA(df): | |
candle1 = df.iloc[-1] | |
candle2 = df.iloc[-2] | |
cond1 = candle1['EMA18'] > candle1['EMA50'] > candle1['EMA100'] | |
cond2 = candle1['STOCH_%K(5,3,3)'] <= 30 or candle1['STOCH_%D(5,3,3)'] <= 30 | |
cond3 = candle2['Low'] < candle2['EMA50'] and \ | |
candle2['Close'] > candle2['EMA50'] and \ | |
candle1['Low'] > candle1 ['EMA50'] | |
return cond1 and cond2 and cond3 | |
# price_chart_df is from Section 2.3 | |
print(check_bounce_EMA(price_chart_df)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment