From: Jérôme Benoit Date: Thu, 20 Mar 2025 14:51:56 +0000 (+0100) Subject: refactor(qav3): add tunable to extrema smoothing window X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3cd0a417726b818d3735617abffae14a45916317;p=freqai-strategies.git refactor(qav3): add tunable to extrema smoothing window Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 37e63b7..22c5f36 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -331,7 +331,10 @@ class QuickAdapterV3(IStrategy): dataframe.at[mp, EXTREMA_COLUMN] = 1 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], 5) + dataframe[EXTREMA_COLUMN] = self.smooth_extrema( + dataframe[EXTREMA_COLUMN], + self.freqai_info.get("extrema_smoothing_window", 5), + ) return dataframe def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: