]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(qav3): ensure hyperopt configuration is respected
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 10 Apr 2025 10:30:10 +0000 (12:30 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 10 Apr 2025 10:30:10 +0000 (12:30 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py

index 17594dd599098a255a5c7572c2a297c0629a4b05..7015783d7899e00bc260581d85c9e798a00608be 100644 (file)
@@ -44,7 +44,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
     https://github.com/sponsors/robcaulk
     """
 
-    version = "3.7.5"
+    version = "3.7.6"
 
     @cached_property
     def _optuna_config(self) -> dict:
@@ -271,21 +271,22 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
             "fit_live_predictions_candles", 100
         )
 
-        df = self.data_provider.get_pair_dataframe(pair)
-        self.optuna_optimize(
-            pair=pair,
-            namespace="label",
-            objective=lambda trial: label_objective(
-                trial,
-                df,
-                fit_live_predictions_candles,
-                self._optuna_config.get("candles_step"),
-            ),
-            directions=[
-                optuna.study.StudyDirection.MAXIMIZE,
-                optuna.study.StudyDirection.MAXIMIZE,
-            ],
-        )
+        if self._optuna_hyperopt:
+            df = self.data_provider.get_pair_dataframe(pair)
+            self.optuna_optimize(
+                pair=pair,
+                namespace="label",
+                objective=lambda trial: label_objective(
+                    trial,
+                    df,
+                    fit_live_predictions_candles,
+                    self._optuna_config.get("candles_step"),
+                ),
+                directions=[
+                    optuna.study.StudyDirection.MAXIMIZE,
+                    optuna.study.StudyDirection.MAXIMIZE,
+                ],
+            )
 
         if self.live:
             if not hasattr(self, "exchange_candles"):