]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(qav3): pivots labeling issue
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 6 Jun 2025 18:57:17 +0000 (20:57 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 6 Jun 2025 18:57:17 +0000 (20:57 +0200)
log pivots labeling information

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py

index 5b0695e474ad3b3700175d3e00d981c53bed4ef0..16742f49fa35341b71f3e0d4d3cff1e7954e77de 100644 (file)
@@ -46,7 +46,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
     https://github.com/sponsors/robcaulk
     """
 
-    version = "3.7.78"
+    version = "3.7.79"
 
     @cached_property
     def _optuna_config(self) -> dict:
@@ -1196,7 +1196,7 @@ def zigzag(
     def calculate_min_slope_strength(
         pos: int,
         min_strength: float = 0.5,
-        max_strength: float = 1.6,
+        max_strength: float = 1.5,
         volatility_exponent: float = 1.5,
     ) -> float:
         volatility_quantile = calculate_volatility_quantile(pos)
index 5509a1daf15124d3bf4c0a7ee4db2450012cf750..de34ec504e7f159fa46d81a7f04a22110833bbbe 100644 (file)
@@ -61,7 +61,7 @@ class QuickAdapterV3(IStrategy):
     INTERFACE_VERSION = 3
 
     def version(self) -> str:
-        return "3.3.82"
+        return "3.3.83"
 
     timeframe = "5m"
 
@@ -394,16 +394,22 @@ class QuickAdapterV3(IStrategy):
             natr_period=label_period_candles,
             natr_ratio=label_natr_ratio,
         )
+        label_period = datetime.timedelta(
+            minutes=len(dataframe) * timeframe_to_minutes(self.config.get("timeframe"))
+        )
         dataframe[EXTREMA_COLUMN] = 0
         if len(pivots_indices) == 0:
             logger.warning(
-                f"No extrema to label for pair {pair} with label_period_candles {label_period_candles} and label_natr_ratio {label_natr_ratio:.2f}"
+                f"{pair}: no extrema to label (label_period='{str(label_period)}' / {label_period_candles=} / {label_natr_ratio=:.2f})"
             )
         else:
             for pivot_idx, pivot_dir in zip(pivots_indices, pivots_directions):
                 dataframe.at[pivot_idx, EXTREMA_COLUMN] = pivot_dir
             dataframe["minima"] = np.where(dataframe[EXTREMA_COLUMN] == -1, -1, 0)
             dataframe["maxima"] = np.where(dataframe[EXTREMA_COLUMN] == 1, 1, 0)
+            logger.info(
+                f"{pair}: labeled {len(pivots_indices)} extrema (label_period='{str(label_period)}' / {label_period_candles=} / {label_natr_ratio=:.2f})"
+            )
         dataframe[EXTREMA_COLUMN] = self.smooth_extrema(
             dataframe[EXTREMA_COLUMN],
             self.freqai_info.get("extrema_smoothing_window", 5),
index 7ca2181ee350b7934f11e61c1c6e44ea1774c5cd..bae116a395347924f48667b4354ebfd51cae4442 100644 (file)
@@ -462,7 +462,7 @@ def zigzag(
     def calculate_min_slope_strength(
         pos: int,
         min_strength: float = 0.5,
-        max_strength: float = 1.6,
+        max_strength: float = 1.5,
         volatility_exponent: float = 1.5,
     ) -> float:
         volatility_quantile = calculate_volatility_quantile(pos)