RealizeAlpha now enriches futures positions with contract & product metadata, real-time quotes, and settlement prices, exposing Open P&L, Day P&L, and Realized P&L calculations per contract.
Futures data is aggregated client-side from brokerage APIs, then augmented with metadata (contract + product), live quotes, and previous close prices before being displayed. The implementation provides transparent Open P&L, Day P&L, and Realized P&L; margin analytics and roll logic are planned.
| Field | Description |
|——-|————-|
| symbol | Full futures symbol (e.g., ESZ25). |
| rootSymbol | Root (e.g., ES). |
| expiration | Contract expiration date. |
| currency | Pricing currency. |
| multiplier | Contract price multiplier (e.g., 50 for ES). |
| avgTradePrice | Average execution price of current open position. |
| lastTradePrice | Latest trade price from quote feed. |
| previousClosePrice | Previous close (settlement) price from closes endpoint. |
| quantity | Number of contracts held (signed). |
| startOfDayPnl | P&L since the start of the trading day. |
| realizedPnl | Realized P&L for the day. |
| openPnlCalc | Computed Open P&L value (see formula). |
| dayPnlCalc | Computed Day P&L value (see formula). |
| notionalValue | Computed Notional Value (Last Price * |Quantity| * Multiplier). |
The Open P&L is derived directly from the last trade price vs the average trade price, scaled by contract quantity and multiplier.
$Open\ P\&L = (Last\ Price - Avg\ Price) \times Quantity \times Multiplier$
Example:
AvgTradePrice = 4520.00
LastTradePrice = 4527.25
Quantity = 3
Multiplier = 50
OpenPnlCalc = (4527.25 - 4520.00) * 3 * 50 = 1087.50
The Day P&L compares the last trade price against the previous close price, scaled by contract quantity and multiplier.
$Day\ P\&L = (Last\ Price - Previous\ Close\ Price) \times Quantity \times Multiplier$
Example:
PreviousClosePrice = 4518.50
LastTradePrice = 4527.25
Quantity = 3
Multiplier = 50
DayPnlCalc = (4527.25 - 4518.50) * 3 * 50 = 1312.50
Realized P&L is calculated based on closed positions during the current session, factoring in execution prices and quantities.
Basic risk metrics are provided to monitor exposure.
Notional Value Represents the total value of the assets controlled by the futures position.
| $Notional\ Value = Last\ Price \times | Quantity | \times Multiplier$ |
Example:
LastTradePrice = 4527.25
Quantity = -3 (Short)
Multiplier = 50
NotionalValue = 4527.25 * 3 * 50 = 679,087.50
A pie chart visualizes the distribution of Notional Value across different futures products (e.g., /ES, /NQ), highlighting concentration risk.
Futures Auto-Trading adds automated strategy execution on futures contracts with configurable rules, activity logging, and safety controls.
FuturesAutoTradingProvider manages config, countdown timers, and trade history.FuturesTradingSettingsWidget exposes strategy templates, risk controls, and save state.FuturesTradingPerformanceWidget summarizes P&L, win rate, and recent trades.agentic-futures-trading.ts and cron jobs generate futures signals and execution flow.streamFuturePositions) fetches aggregated positions, then sequentially:
getFuturesContractsByIds and getFuturesProductsByIds.getFuturesClosesByIds.openPnlCalc and dayPnlCalc per position.openPnlCalc = null and dayPnlCalc = null.dayPnlCalc will be null.functions/ if needed.Before extending futures logic:
Futures support now delivers enriched contract context with transparent Open P&L and Day P&L calculations, and futures auto-trading extends the platform with configurable automated execution.