fix: E1 Q-value reality check uses actual avg_q_value not avg_pnl

E1 enrichment was computing q_corr = mean(predicted_q - pnl) but
predicted_q was set to avg_pnl → bias always ~0.  Now uses actual
avg_q_value from the training step, producing meaningful corrections
when Q-values drift away from realized returns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-04-16 19:19:02 +02:00
parent 7db3a75c94
commit c3fab77e82
2 changed files with 3 additions and 1 deletions

View File

@@ -101,6 +101,7 @@ pub(crate) fn extract_eval_trades_from_metrics(
total_trades: f32,
total_pnl: f32,
win_rate: f32,
avg_q_value: f32,
n_bars: usize,
) -> Vec<EvalTrade> {
let n_trades = total_trades as usize;
@@ -126,7 +127,7 @@ pub(crate) fn extract_eval_trades_from_metrics(
magnitude: 1,
holding_bars: avg_holding,
pnl,
predicted_q: avg_pnl,
predicted_q: avg_q_value,
ensemble_var: 0.5,
});
}

View File

@@ -633,6 +633,7 @@ impl DQNTrainer {
60000.0, // approximate trade count
0.0, // approximate P&L
0.5, // approximate win rate
log_output.avg_q_value as f32, // actual Q-mean from training step
val_bars,
);