Files
foxhunt/docs/superpowers/plans
jgrusewski d256acb638 refactor: training kernel fully unified with trade_physics.cuh
Final 3 inline duplicates replaced with shared function calls:
- execute_trade(): notional cash model (was inline cash/position update)
- check_trailing_stop(): regime-adaptive trailing stop decision
- enforce_hold(): hold enforcement decision (action aliasing kept inline)

Training kernel now uses ALL 10 shared functions from trade_physics.cuh:
decode_exposure_index, compute_target_position, decode_order_type,
execute_trade, compute_tx_cost, enforce_hold, check_trailing_stop,
check_capital_floor, apply_margin_cap, update_hold_time

Zero inline duplicates remain. Both training and backtest kernels
use identical trade physics — no more train/eval mismatches.

Smoke test: Sharpe=4.89, 443 trades, no SIGSEGV.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:16:51 +01:00
..