From: Jérôme Benoit Date: Wed, 24 Dec 2025 13:26:45 +0000 (+0100) Subject: refactor(quickadapter): dynamically adjust extrema plot epsilon for zero weighted... X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=df06fa81dc92f745084047f6af95d1d0798ba61a;p=freqai-strategies.git refactor(quickadapter): dynamically adjust extrema plot epsilon for zero weighted extrema values Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 4fb8d9a..ea9b7c5 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -146,9 +146,10 @@ class QuickAdapterV3(IStrategy): _ANNOTATION_LINE_OFFSET_CANDLES: Final[int] = 10 - _PLOT_EXTREMA_ZERO_EPS: Final[float] = 0.025 + _PLOT_EXTREMA_MIN_EPS: Final[float] = 0.01 timeframe_minutes = timeframe_to_minutes(timeframe) + minimal_roi = {str(timeframe_minutes * 864): -1} # FreqAI is crashing if minimal_roi is a property @@ -1140,7 +1141,10 @@ class QuickAdapterV3(IStrategy): gamma=self.extrema_weighting["gamma"], ) - plot_eps = QuickAdapterV3._PLOT_EXTREMA_ZERO_EPS + plot_eps = weighted_extrema.abs().where(weighted_extrema.ne(0.0)).min() + if not np.isfinite(plot_eps): + plot_eps = 0.0 + plot_eps = max(float(plot_eps) * 0.5, QuickAdapterV3._PLOT_EXTREMA_MIN_EPS) dataframe["maxima"] = ( weighted_extrema.where(extrema_direction.gt(0), 0.0) .clip(lower=0.0)