Skip to content

Instantly share code, notes, and snippets.

@saleh-old
Created May 26, 2020 06:35
Show Gist options
  • Save saleh-old/7d4d398e15599c8423e463be17d6bd6b to your computer and use it in GitHub Desktop.
Save saleh-old/7d4d398e15599c8423e463be17d6bd6b to your computer and use it in GitHub Desktop.
@property
def anchor_trend(self):
# use self.get_candles() to get the candles for the anchor timeframe
anchor_candles = self.get_candles(
self.exchange, self.symbol, utils.anchor_timeframe(self.timeframe)
)
ema = ta.ema(anchor_candles, 100)
if self.price > ema:
return 1
else:
return -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment