]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
feat(plot): add smoothed extrema line to min_max subplot with weighted smoothing
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 5 Jan 2026 22:12:20 +0000 (23:12 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 5 Jan 2026 22:12:20 +0000 (23:12 +0100)
- Add 'smoothed-extrema' column displaying weighted extrema after smoothing
- Position smoothed extrema line below maxima/minima bars in plot z-order
- Use 'wheat' color for better visual distinction from red/green bars
- Store smoothed result in variable before assigning to both EXTREMA_COLUMN and smoothed-extrema

quickadapter/user_data/strategies/QuickAdapterV3.py

index 1065d3020dd0be23e565ef4ed4631b31cfd5672c..183f2a31d45bc809d1635a1d224cbca75964eecc 100644 (file)
@@ -194,6 +194,7 @@ class QuickAdapterV3(IStrategy):
                     EXTREMA_COLUMN: {"color": "orange", "type": "line"},
                 },
                 "min_max": {
+                    "smoothed-extrema": {"color": "wheat", "type": "line"},
                     "maxima": {"color": "red", "type": "bar"},
                     "minima": {"color": "green", "type": "bar"},
                 },
@@ -938,7 +939,7 @@ class QuickAdapterV3(IStrategy):
             .mask(extrema_direction.lt(0) & weighted_extrema.eq(0.0), -plot_eps)
         )
 
-        dataframe[EXTREMA_COLUMN] = smooth_extrema(
+        smoothed_extrema = smooth_extrema(
             weighted_extrema,
             self.extrema_smoothing["method"],
             self.extrema_smoothing["window_candles"],
@@ -948,6 +949,9 @@ class QuickAdapterV3(IStrategy):
             self.extrema_smoothing["sigma"],
         )
 
+        dataframe[EXTREMA_COLUMN] = smoothed_extrema
+        dataframe["smoothed-extrema"] = smoothed_extrema
+
         return dataframe
 
     def populate_indicators(