]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
perf(qav3): stricter # of pivots condition at models training
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 24 Jun 2025 19:38:00 +0000 (21:38 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 24 Jun 2025 19:38:00 +0000 (21:38 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py

index 13f74076d459a2e1424070e3ca37019c90e2c763..5b135aa7bf4b68c6f0a73ee0ba1b02538b2716bf 100644 (file)
@@ -1101,9 +1101,9 @@ def fit_regressor(
 
 @lru_cache(maxsize=128)
 def calculate_min_extrema(
-    length: int, fit_live_predictions_candles: int, min_extrema: int = 2
+    size: int, fit_live_predictions_candles: int, min_extrema: int = 4
 ) -> int:
-    return int(round((length / fit_live_predictions_candles) * min_extrema))
+    return int(round((size / fit_live_predictions_candles) * min_extrema))
 
 
 def train_objective(
@@ -1132,7 +1132,7 @@ def train_objective(
         logger.info(
             f"{test_length=}, {n_test_minima=}, {n_test_maxima=}, {n_test_extrema=}, {min_test_extrema=}"
         )
-    min_test_window: int = fit_live_predictions_candles
+    min_test_window: int = fit_live_predictions_candles * 2
     if test_length < min_test_window:
         logger.warning(f"Insufficient test data: {test_length} < {min_test_window}")
         test_ok = False