]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): refine log messages
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 16 Aug 2025 13:29:04 +0000 (15:29 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 16 Aug 2025 13:29:04 +0000 (15:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index 5da8b9124e904170344204622a48e670f738e5ec..5e3264d3bc10fcea695ea00502b1a9c762b20129 100644 (file)
@@ -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