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.
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:")