From: Jérôme Benoit Date: Fri, 6 Jun 2025 18:57:17 +0000 (+0200) Subject: fix(qav3): pivots labeling issue X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=dadd2d8a3ffc8c6c8a656939a8afb6bfa0c4520d;p=freqai-strategies.git fix(qav3): pivots labeling issue log pivots labeling information Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index 5b0695e..16742f4 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -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) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 5509a1d..de34ec5 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -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), diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index 7ca2181..bae116a 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -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)