From 3349d94a15e817a991daf7e54ccfd088bfb64320 Mon Sep 17 00:00:00 2001 From: iterativ Date: Sat, 30 Nov 2024 18:08:51 +0200 Subject: [PATCH] X5: short_exit_dec: add exit condition. --- NostalgiaForInfinityX5.py | 119 +++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/NostalgiaForInfinityX5.py b/NostalgiaForInfinityX5.py index 800a13f34a..4871a5c91b 100644 --- a/NostalgiaForInfinityX5.py +++ b/NostalgiaForInfinityX5.py @@ -66,7 +66,7 @@ class NostalgiaForInfinityX5(IStrategy): INTERFACE_VERSION = 3 def version(self) -> str: - return "v15.1.252" + return "v15.1.253" stoploss = -0.99 @@ -32646,6 +32646,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_0_97" + elif ( + (last_candle["RSI_3"] < 8.0) + and (last_candle["RSI_3_15m"] < 26.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_0_98" elif 0.02 > current_profit >= 0.01: if ( (last_candle["WILLR_14"] < -99.0) @@ -33429,6 +33438,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_1_97" + elif ( + (last_candle["RSI_3"] < 10.0) + and (last_candle["RSI_3_15m"] < 28.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_1_98" elif 0.03 > current_profit >= 0.02: if ( (last_candle["WILLR_14"] < -99.0) @@ -34212,6 +34230,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_2_97" + elif ( + (last_candle["RSI_3"] < 12.0) + and (last_candle["RSI_3_15m"] < 30.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_2_98" elif 0.04 > current_profit >= 0.03: if ( (last_candle["WILLR_14"] < -99.0) @@ -34995,6 +35022,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_3_97" + elif ( + (last_candle["RSI_3"] < 14.0) + and (last_candle["RSI_3_15m"] < 32.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_3_98" elif 0.05 > current_profit >= 0.04: if ( (last_candle["WILLR_14"] < -99.0) @@ -35778,6 +35814,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_4_97" + elif ( + (last_candle["RSI_3"] < 16.0) + and (last_candle["RSI_3_15m"] < 34.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_4_98" elif 0.06 > current_profit >= 0.05: if ( (last_candle["WILLR_14"] < -99.0) @@ -36561,6 +36606,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_5_97" + elif ( + (last_candle["RSI_3"] < 18.0) + and (last_candle["RSI_3_15m"] < 36.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_5_98" elif 0.07 > current_profit >= 0.06: if ( (last_candle["WILLR_14"] < -99.0) @@ -37344,6 +37398,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_6_97" + elif ( + (last_candle["RSI_3"] < 16.0) + and (last_candle["RSI_3_15m"] < 34.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_6_98" elif 0.08 > current_profit >= 0.07: if ( (last_candle["WILLR_14"] < -99.0) @@ -38127,6 +38190,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_7_97" + elif ( + (last_candle["RSI_3"] < 14.0) + and (last_candle["RSI_3_15m"] < 32.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_7_98" elif 0.09 > current_profit >= 0.08: if ( (last_candle["WILLR_14"] < -99.0) @@ -38910,6 +38982,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_8_97" + elif ( + (last_candle["RSI_3"] < 12.0) + and (last_candle["RSI_3_15m"] < 30.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_8_98" elif 0.1 > current_profit >= 0.09: if ( (last_candle["WILLR_14"] < -99.0) @@ -39693,6 +39774,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_9_97" + elif ( + (last_candle["RSI_3"] < 10.0) + and (last_candle["RSI_3_15m"] < 28.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_9_98" elif 0.12 > current_profit >= 0.1: if ( (last_candle["WILLR_14"] < -99.0) @@ -40476,6 +40566,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_10_97" + elif ( + (last_candle["RSI_3"] < 8.0) + and (last_candle["RSI_3_15m"] < 26.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_10_98" elif 0.2 > current_profit >= 0.12: if ( (last_candle["WILLR_14"] < -99.0) @@ -41259,6 +41358,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_11_97" + elif ( + (last_candle["RSI_3"] < 6.0) + and (last_candle["RSI_3_15m"] < 24.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_11_98" elif current_profit >= 0.2: if ( (last_candle["WILLR_14"] < -99.0) @@ -42042,6 +42150,15 @@ def short_exit_dec( and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 70.0) ): return True, f"exit_{mode_name}_d_12_97" + elif ( + (last_candle["RSI_3"] < 4.0) + and (last_candle["RSI_3_15m"] < 22.0) + and (last_candle["RSI_3_1h"] > 40.0) + and (last_candle["RSI_3_4h"] > 40.0) + and (last_candle["RSI_3_1d"] < 20.0) + and (last_candle["STOCHRSIk_14_14_3_3_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_12_98" # Here ends exit signal conditions for short_exit_dec