From b1eaa070b9c8690cbd0b0596e18aaf2f05c73827 Mon Sep 17 00:00:00 2001 From: iterativ Date: Sun, 15 Dec 2024 17:42:44 +0200 Subject: [PATCH] X5: short_exit_dec: add exit condition. --- NostalgiaForInfinityX5.py | 106 +++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/NostalgiaForInfinityX5.py b/NostalgiaForInfinityX5.py index 752e01ca82..b7ada0b71d 100644 --- a/NostalgiaForInfinityX5.py +++ b/NostalgiaForInfinityX5.py @@ -67,7 +67,7 @@ class NostalgiaForInfinityX5(IStrategy): INTERFACE_VERSION = 3 def version(self) -> str: - return "v15.1.283" + return "v15.1.284" stoploss = -0.99 @@ -34736,6 +34736,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_0_106" + elif ( + (last_candle["RSI_3"] < 5.0) + and (last_candle["RSI_14"] > 54.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_0_107" elif 0.02 > current_profit >= 0.01: if ( (last_candle["WILLR_14"] < -99.0) @@ -35596,6 +35604,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_1_106" + elif ( + (last_candle["RSI_3"] < 26.0) + and (last_candle["RSI_14"] > 52.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_1_107" elif 0.03 > current_profit >= 0.02: if ( (last_candle["WILLR_14"] < -99.0) @@ -36456,6 +36472,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_2_106" + elif ( + (last_candle["RSI_3"] < 28.0) + and (last_candle["RSI_14"] > 50.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_2_107" elif 0.04 > current_profit >= 0.03: if ( (last_candle["WILLR_14"] < -99.0) @@ -37316,6 +37340,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_3_106" + elif ( + (last_candle["RSI_3"] < 30.0) + and (last_candle["RSI_14"] > 48.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_3_107" elif 0.05 > current_profit >= 0.04: if ( (last_candle["WILLR_14"] < -99.0) @@ -38176,6 +38208,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_4_106" + elif ( + (last_candle["RSI_3"] < 32.0) + and (last_candle["RSI_14"] > 46.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_4_107" elif 0.06 > current_profit >= 0.05: if ( (last_candle["WILLR_14"] < -99.0) @@ -39036,6 +39076,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_5_106" + elif ( + (last_candle["RSI_3"] < 34.0) + and (last_candle["RSI_14"] > 44.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_5_107" elif 0.07 > current_profit >= 0.06: if ( (last_candle["WILLR_14"] < -99.0) @@ -39896,6 +39944,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_6_106" + elif ( + (last_candle["RSI_3"] < 32.0) + and (last_candle["RSI_14"] > 46.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_6_107" elif 0.08 > current_profit >= 0.07: if ( (last_candle["WILLR_14"] < -99.0) @@ -40756,6 +40812,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_7_106" + elif ( + (last_candle["RSI_3"] < 30.0) + and (last_candle["RSI_14"] > 48.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_7_107" elif 0.09 > current_profit >= 0.08: if ( (last_candle["WILLR_14"] < -99.0) @@ -41616,6 +41680,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_8_106" + elif ( + (last_candle["RSI_3"] < 28.0) + and (last_candle["RSI_14"] > 50.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_8_107" elif 0.1 > current_profit >= 0.09: if ( (last_candle["WILLR_14"] < -99.0) @@ -42476,6 +42548,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_9_106" + elif ( + (last_candle["RSI_3"] < 26.0) + and (last_candle["RSI_14"] > 52.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_9_107" elif 0.12 > current_profit >= 0.1: if ( (last_candle["WILLR_14"] < -99.0) @@ -43336,6 +43416,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_10_106" + elif ( + (last_candle["RSI_3"] < 24.0) + and (last_candle["RSI_14"] > 54.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_10_107" elif 0.2 > current_profit >= 0.12: if ( (last_candle["WILLR_14"] < -99.0) @@ -44196,6 +44284,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_11_106" + elif ( + (last_candle["RSI_3"] < 22.0) + and (last_candle["RSI_14"] > 56.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_11_107" elif current_profit >= 0.2: if ( (last_candle["WILLR_14"] < -99.0) @@ -45056,6 +45152,14 @@ def short_exit_dec( and (last_candle["ROC_9_4h"] < -40.0) ): return True, f"exit_{mode_name}_d_12_106" + elif ( + (last_candle["RSI_3"] < 20.0) + and (last_candle["RSI_14"] > 58.0) + and (last_candle["RSI_3_1h"] > 50.0) + and (last_candle["STOCHRSIk_14_14_3_3_1h"] < 30.0) + and (last_candle["RSI_14_4h"] < 50.0) + ): + return True, f"exit_{mode_name}_d_12_107" # Here ends exit signal conditions for short_exit_dec