From: Jérôme Benoit Date: Sat, 24 May 2025 21:32:52 +0000 (+0200) Subject: fix(qav3): FreqAI expects a label target column X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=16e470ef359c960cd1471ac15b8f23128ea140b3;p=freqai-strategies.git fix(qav3): FreqAI expects a label target column Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 833b064..f0f8050 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -387,16 +387,16 @@ class QuickAdapterV3(IStrategy): natr_period=self.get_label_period_candles(pair), natr_ratio=self.get_label_natr_ratio(pair), ) + dataframe[EXTREMA_COLUMN] = 0 if len(pivots_indices) == 0: logger.warning( f"No extrema to label for pair {pair} with label_period_candles {self.get_label_period_candles(pair)} and label_natr_ratio {self.get_label_natr_ratio(pair)}" ) - return dataframe - dataframe[EXTREMA_COLUMN] = 0 - 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) + 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) dataframe[EXTREMA_COLUMN] = self.smooth_extrema( dataframe[EXTREMA_COLUMN], self.freqai_info.get("extrema_smoothing_window", 5),