test: hyperopt backtest metrics output in smoketest

Sharpe=-1.27, 269 trades, 22% win rate — expected for 3 random epochs.
Full PSO → train → GPU backtest → Sharpe objective pipeline validated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-04-05 18:13:17 +02:00
parent 95db8ef13d
commit 1abdbb6388

View File

@@ -93,12 +93,12 @@ fn test_hyperopt_trial_produces_backtest_metrics() -> anyhow::Result<()> {
assert!(bt.sharpe_ratio.is_finite(), "Sharpe is not finite: {}", bt.sharpe_ratio);
assert!(bt.total_trades > 0, "Zero trades in backtest");
tracing::info!(
sharpe = bt.sharpe_ratio,
trades = bt.total_trades,
win_rate = bt.win_rate,
max_dd = bt.max_drawdown_pct,
"Hyperopt backtest metrics PASS"
eprintln!(
"Hyperopt backtest: Sharpe={:.2} Trades={} WinRate={:.1}% MaxDD={:.1}% \
Loss={:.3} Epochs={} Q={:.4}",
bt.sharpe_ratio, bt.total_trades, bt.win_rate * 100.0,
bt.max_drawdown_pct, metrics.train_loss, metrics.epochs_completed,
metrics.avg_q_value,
);
Ok(())