From 16e470ef359c960cd1471ac15b8f23128ea140b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 24 May 2025 23:32:52 +0200 Subject: [PATCH] fix(qav3): FreqAI expects a label target column 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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), -- 2.43.0