Files
foxhunt/crates/ml-backtesting/tests
jgrusewski f9a83a03d0 feat(lobsim): per-step unrealized PnL in PosFlat
Added unrealized_pnl field to PosFlat (offset 24, 24→28 bytes).
Computed every step in both fill kernels (order_match + resting_orders)
as (mid - vwap_entry) × direction × |lots|. Zeroed when flat.

This gives Q real-time visibility into open-position drawdown through
the trade_context features. The confidence gate's margin floor now
checks total equity (realized + unrealized) instead of just realized.

Units: price-units × lots (same as realized_pnl). USD = value × $50.

14 files updated: struct def (Rust + CUDA), both fill kernels,
margin floor consumer, layout docs in 6 kernels, tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 01:56:48 +02:00
..