From: Jérôme Benoit Date: Tue, 17 Jun 2025 09:28:50 +0000 (+0200) Subject: refactor(qav3): code cleanups X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3e8ea4c5187179bc2923c8aeeb662d3f3e88b819;p=freqai-strategies.git refactor(qav3): code cleanups Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index a6b7c1b..5cde824 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -1371,10 +1371,10 @@ def zigzag( pos - candidate_pivot_pos ) - if direction == TrendDirection.DOWN: - slope_ok_cache[cache_key] = log_slope_close < -min_slope - elif direction == TrendDirection.UP: + if direction == TrendDirection.UP: slope_ok_cache[cache_key] = log_slope_close > min_slope + elif direction == TrendDirection.DOWN: + slope_ok_cache[cache_key] = log_slope_close < -min_slope else: slope_ok_cache[cache_key] = False diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index 6543564..0afca65 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -500,10 +500,10 @@ def zigzag( pos - candidate_pivot_pos ) - if direction == TrendDirection.DOWN: - slope_ok_cache[cache_key] = log_slope_close < -min_slope - elif direction == TrendDirection.UP: + if direction == TrendDirection.UP: slope_ok_cache[cache_key] = log_slope_close > min_slope + elif direction == TrendDirection.DOWN: + slope_ok_cache[cache_key] = log_slope_close < -min_slope else: slope_ok_cache[cache_key] = False