Created
February 8, 2022 15:14
-
-
Save yigitcetin/f4f38e8f125a4c6899594d423736bf8e to your computer and use it in GitHub Desktop.
RSI Validation
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
# Calculate RSI | |
df['RSI'] = df.ta.rsi(close='Close', length=14, append=True) | |
# Add values to a list | |
stats.append(df.loc[df.shape[0] - 2, 'RSI']) | |
return stats, trend_dir | |
... | |
... | |
... | |
... | |
## <<<<<<<<<<< START LOOP HERE >>>>>>>>>>>>>>>>> | |
RSI = unfiltered_stats[6] | |
if ADX > 25 and (ADX_Slope > 0 and ((DM_plus > DM_minus and ADX > DM_minus) or ( | |
ADX < DM_plus and ADX < DM_minus))) and DM_plus > DM_minus and RSI < 50 and trend_direction == "up": | |
unfiltered_stats.append("long") | |
unsorted_tradable_perps.append(unfiltered_stats) | |
elif ADX > 25 and (ADX_Slope > 0 and ((DM_plus < DM_minus and ADX > DM_plus) or ( | |
ADX < DM_plus and ADX < DM_minus))) and DM_plus < DM_minus and RSI > 50 and trend_direction == "down": | |
unfiltered_stats.append("short") | |
unsorted_tradable_perps.append(unfiltered_stats) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@yigitcetin Thanks, that helped me, it executes now. But indeed, without trades :-)