From 2e941e73d6bd6c416710322c611d970ce646e257 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 30 Apr 2025 17:22:06 +0200 Subject: [PATCH] perf(qav3): tune extrema with reversal confirmation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../user_data/strategies/QuickAdapterV3.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index b481fae..51d06c5 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -58,7 +58,7 @@ class QuickAdapterV3(IStrategy): INTERFACE_VERSION = 3 def version(self) -> str: - return "3.3.15" + return "3.3.16" timeframe = "5m" @@ -366,13 +366,13 @@ class QuickAdapterV3(IStrategy): self._label_params[pair]["label_natr_ratio"] = label_natr_ratio def get_entry_natr_ratio(self, pair: str) -> float: - return self.get_label_natr_ratio(pair) * 0.0175 + return self.get_label_natr_ratio(pair) * 0.0125 def get_stoploss_natr_ratio(self, pair: str) -> float: return self.get_label_natr_ratio(pair) * 0.625 def get_take_profit_natr_ratio(self, pair: str) -> float: - return self.get_stoploss_natr_ratio(pair) * 0.5 + return self.get_stoploss_natr_ratio(pair) * 0.525 def set_freqai_targets(self, dataframe: DataFrame, metadata: dict, **kwargs): pair = str(metadata.get("pair")) @@ -641,12 +641,9 @@ class QuickAdapterV3(IStrategy): entry_price_fluctuation_threshold = ( last_candle_natr * self.get_entry_natr_ratio(pair) ) - if ( - side == "long" - and rate > last_candle_close * (1 + entry_price_fluctuation_threshold) - ) or ( - side == "short" - and rate < last_candle_close * (1 - entry_price_fluctuation_threshold) + # Confirm extrema with reversal with price movement boundaries + if (rate > last_candle_close * (1 + entry_price_fluctuation_threshold)) or ( + rate < last_candle_close * (1 - entry_price_fluctuation_threshold) ): return False -- 2.43.0