]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
perf(qav3): refine initial pivot depth confirmation
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 23 May 2025 10:58:55 +0000 (12:58 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 23 May 2025 10:58:55 +0000 (12:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py

index 2dfe511cfb3f5efc346825b3eb69a06c056cce19..eba8d66b8c13639d083ee331b2e56e6ca4c99b1b 100644 (file)
@@ -45,7 +45,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
     https://github.com/sponsors/robcaulk
     """
 
-    version = "3.7.56"
+    version = "3.7.57"
 
     @cached_property
     def _optuna_config(self) -> dict:
@@ -965,7 +965,9 @@ def zigzag(
         depth_factor = calculate_depth_factor(pos)
         if len(pivots_indices) < 2:
             return np.clip(
-                round(min_depth * depth_factor), min_depth, max_depth
+                round(np.median([min_depth, max_depth]) * depth_factor),
+                min_depth,
+                max_depth,
             ).astype(int)
 
         previous_periods = np.diff(pivots_indices[-3:])
index ecb1b4a56145cf7df701a02472865c805be1fe5c..14b9a1179aa6844e63d464cc89b89f2a2462bfad 100644 (file)
@@ -60,7 +60,7 @@ class QuickAdapterV3(IStrategy):
     INTERFACE_VERSION = 3
 
     def version(self) -> str:
-        return "3.3.56"
+        return "3.3.57"
 
     timeframe = "5m"
 
index c61537d050c91741a2506a9e293a0a220702d903..6b0e839a2ca95a33733c37d1433e5fd1b1dc8984 100644 (file)
@@ -449,7 +449,9 @@ def zigzag(
         depth_factor = calculate_depth_factor(pos)
         if len(pivots_indices) < 2:
             return np.clip(
-                round(min_depth * depth_factor), min_depth, max_depth
+                round(np.median([min_depth, max_depth]) * depth_factor),
+                min_depth,
+                max_depth,
             ).astype(int)
 
         previous_periods = np.diff(pivots_indices[-3:])