From: Jérôme Benoit Date: Sun, 3 Aug 2025 21:29:49 +0000 (+0200) Subject: refactor(qav3): make method static X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ae6ca8302232dd8cba76418d485b48587b7a6938;p=freqai-strategies.git refactor(qav3): make method static Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index c3a8d00..94404df 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -915,8 +915,9 @@ class QuickAdapterV3(IStrategy): pair, natr_ratio_percent ) + @staticmethod def calculate_current_threshold( - self, side: str, last_candle: Series, deviation: float + side: str, last_candle: Series, deviation: float ) -> float: last_candle_close = last_candle.get("close") last_candle_open = last_candle.get("open") @@ -983,7 +984,9 @@ class QuickAdapterV3(IStrategy): and last_candle.get("DI_catch") == 1 and last_candle.get(EXTREMA_COLUMN) < last_candle.get("minima_threshold") and current_rate - > self.calculate_current_threshold("long", last_candle, current_deviation) + > QuickAdapterV3.calculate_current_threshold( + "long", last_candle, current_deviation + ) ): return "minima_detected_short" if ( @@ -992,7 +995,9 @@ class QuickAdapterV3(IStrategy): and last_candle.get("DI_catch") == 1 and last_candle.get(EXTREMA_COLUMN) > last_candle.get("maxima_threshold") and current_rate - < self.calculate_current_threshold("short", last_candle, current_deviation) + < QuickAdapterV3.calculate_current_threshold( + "short", last_candle, current_deviation + ) ): return "maxima_detected_long" @@ -1060,7 +1065,7 @@ class QuickAdapterV3(IStrategy): ) if isna(current_deviation): return False - current_threshold = self.calculate_current_threshold( + current_threshold = QuickAdapterV3.calculate_current_threshold( side, last_candle, current_deviation ) if (side == "long" and rate > current_threshold) or (