Created
June 9, 2020 07:56
-
-
Save saleh-old/033ee0e96e990ad08a4b5b2d938a4b72 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@property | |
def trend(self): | |
short_ema = ta.ema(self.candles, 50) | |
long_ema = ta.ema(self.candles, 100) | |
longer_ema = ta.ema(self.candles, 200) | |
if short_ema > long_ema > longer_ema: | |
return 1 | |
elif short_ema < long_ema < longer_ema: | |
return -1 | |
else: | |
return 0 | |
@property | |
def current_candle_touches_long_ema(self): | |
long_ema = ta.ema(self.candles, 50) | |
return self.high >= long_ema >= self.low |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment