Commit Graph

2 Commits

Author SHA1 Message Date
Adriano 9301ab9051 feat(backtest): event-driven engine with 1-bar exec delay
Engine sincrono bar-per-bar con delay 1: segnale a t-1 esegue a open di t
per evitare lookahead. Position sizing 1 unit, fees su entry+exit,
mark-to-market su close, chiusura forzata posizione open a fine serie.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 19:15:05 +02:00
Adriano 36e05233d0 feat(backtest): Order/Position/Trade dataclasses with fees
Side StrEnum (long/short/flat), frozen dataclasses con calcolo
unrealized_pnl per Position e gross/fees/net_pnl per Trade
(fees in basis point, default 5bp). 4 test TDD passing,
ruff + mypy strict clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 19:11:27 +02:00