Created
June 9, 2020 07:57
-
-
Save saleh-old/e95d21104b765247a576766a6be4357b 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
def update_position(self): | |
# the RSI logic is intended for the second half of the trade | |
if self.is_reduced: | |
rsi = ta.rsi(self.candles) | |
if self.is_long and rsi > 80: | |
# self.liquidate() closes the position with a market order | |
self.liquidate() | |
elif self.is_short and rsi < 20: | |
self.liquidate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment