From 4bc65cbf0b369165113bbc41336d12dc6f8ba81e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 16 Aug 2025 15:29:04 +0200 Subject: [PATCH] refactor(qav3): refine log messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- quickadapter/user_data/strategies/QuickAdapterV3.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 5da8b91..5e3264d 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -1191,7 +1191,7 @@ class QuickAdapterV3(IStrategy): min(1.0, max_natr_ratio_percent * (decay_ratio**k)), ) - threshold_k_minus_1 = self.calculate_candle_threshold( + threshold_k = self.calculate_candle_threshold( df, pair, side, @@ -1199,16 +1199,16 @@ class QuickAdapterV3(IStrategy): max_natr_ratio_percent=decayed_max_natr_ratio_percent, candle_idx=-(k + 1), ) - if not np.isfinite(threshold_k_minus_1): + if not np.isfinite(threshold_k): return current_ok - if (side == "long" and not (close_k > threshold_k_minus_1)) or ( - side == "short" and not (close_k < threshold_k_minus_1) + if (side == "long" and not (close_k > threshold_k)) or ( + side == "short" and not (close_k < threshold_k) ): logger.info( f"User denied {trade_direction} {order} for {pair}: " f"close_k[{-k}] {format_number(close_k)} " - f"did not break threshold_k_minus_1[{-(k + 1)}] {format_number(threshold_k_minus_1)} " + f"did not break threshold_k[{-(k + 1)}] {format_number(threshold_k)} " f"(decayed min/max natr_ratio_percent: min={format_number(decayed_min_natr_ratio_percent)}, max={format_number(decayed_max_natr_ratio_percent)})" ) return False -- 2.43.0