Investigation: Backtest Trade History Showing $1,000,000 Notional
Question
Why does the first trade show notional value $1,000,000.00? Is this persisted incorrectly or displayed incorrectly?
Findings
The displayed notional is internally consistent and appears correct for the shown trade values.
From the screenshot values:
- Units:
868,078.162 - Signal price:
1.15197 - Computed notional:
868,078.162 * 1.15197 = 1,000,000.00
Second shown trade also matches exactly:
- Units:
889,028.45 - Signal price:
1.15314 - Computed notional:
1,025,174.27
Code Path Confirmed
- Backtest UI computes notional from
trade.entryNotional, otherwisetrade.quantity * trade.entryPrice:services/frontend/src/routes/backtests/BacktestDetailPage.tsx
- Trade normalization keeps
entry_notional, thenentryNotional, thensignals.position.entryNotional:services/frontend/src/lib/api-client/index.ts
- Backend trade enrichment resolves
entry_notional, thensignals.position.entryNotional, thenquantity * entry_price:services/backend/src/routes/backtests/backtests-service.ts
Persistence Note
- Current
insertBacktestTradewrites core fields plussignalsJSON and does not write top-levelquantity/entry_notionalcolumns directly. - Sizing metadata is persisted in
signals.position(size and entryNotional in recent runs), and API/frontend derive from that when needed.
Conclusion
This is not a frontend formatting bug for the shown trade; the $1,000,000.00 value is the actual computed notional for the provided units and signal price.