]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
style(quickadapter): emit label_horizon_candles per pair in HPO=on log block
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 22 Jun 2026 13:07:40 +0000 (15:07 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 22 Jun 2026 13:07:40 +0000 (15:07 +0200)
Two post-implementation review findings (Oracle A + Oracle B) resolved
together by a single design change.

Oracle A flagged a latent value-mismatch in the HPO=on branch: the
global `self._label_horizon_candles()` call (no `pair` argument) reads
from `ft_params` only, so when `label_horizon_candles` is unset and
the helper falls back to `label_period_candles`, the logged value
reflects the global initial seed rather than the per-pair effective
value used at fit time (where HPO-tuned `label_period_candles` per
pair drives the fallback). When the user sets `label_horizon_candles`
explicitly, the global call is correct.

Oracle B flagged a cross-branch ordering inconsistency: HPO=on emitted
`label_horizon_candles` first (before per-pair lines), while HPO=off
emitted it last (after period + multiplier). Maintainers comparing
logs across HPO toggles see the same logical scalar in different
positions.

Move the per-pair effective `label_horizon_candles` into the per-pair
line in the HPO=on branch (third field after `label_period_candles`
and `label_natr_multiplier`). This closes the per-pair accuracy gap
(Oracle A) and yields the same `period → multiplier → horizon` order
in both branches (Oracle B). No behavioral change; logging only.

quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py

index dd7b007de16b9cadabf208fa682651a6b74f0802..77b6a388129e73831188e31aaa3bff01ba290c78 100644 (file)
@@ -1605,13 +1605,13 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
 
         if self._optuna_hyperopt:
             logger.info("Label Parameters:")
-            logger.info(f"  label_horizon_candles: {self._label_horizon_candles()}")
             for pair in self.pairs:
                 params = self._optuna_label_params.get(pair, {})
                 if params:
                     logger.info(
                         f"  {pair}: label_period_candles={params.get('label_period_candles')}, "
-                        f"label_natr_multiplier={format_number(params.get('label_natr_multiplier'))}"
+                        f"label_natr_multiplier={format_number(params.get('label_natr_multiplier'))}, "
+                        f"label_horizon_candles={self._label_horizon_candles(pair)}"
                     )
         else:
             logger.info("Label Parameters:")