From: Jérôme Benoit Date: Fri, 23 May 2025 10:58:55 +0000 (+0200) Subject: perf(qav3): refine initial pivot depth confirmation X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b2f09f42ebd56fa23a86e245d6839a0f4ddac079;p=freqai-strategies.git perf(qav3): refine initial pivot depth confirmation Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index 2dfe511..eba8d66 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -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:]) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index ecb1b4a..14b9a11 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -60,7 +60,7 @@ class QuickAdapterV3(IStrategy): INTERFACE_VERSION = 3 def version(self) -> str: - return "3.3.56" + return "3.3.57" timeframe = "5m" diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index c61537d..6b0e839 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -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:])