LiveLeg
Summary view of a live position leg (contract + quantity + pricing metadata).
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Id | int | Yes | No | Live leg id. | |
Name | str | Yes | No | User-facing leg name/key (used as a stable identifier within an execution plan). | |
LiveContract | LiveContract | Yes | No | Contract specification for this leg. | |
LegGroupId | int | Yes | No | Leg group id within the execution plan (0 when not grouped/unknown). | |
CreatedAt | datetime | Yes | No | UTC timestamp when the leg was created. | |
ClosedAt | datetime | Yes | Yes | UTC timestamp when the leg was closed, or null if still open. | |
LivePositionId | int | Yes | No | Parent live position id. | |
AccountId | str | Yes | No | Broker account id that owns this position/leg. | |
Underlying | str | Yes | No | Underlying symbol for this leg (e.g. AAPL, SPX). | |
Qty | Decimal | Yes | No | Signed quantity for this leg (positive = long/buy, negative = short/sell). 0 is used for marker legs. | |
AvgEntryPrice | Decimal | Yes | No | Average entry price including commission (differs from LiveExecution.Price which excludes commission). | |
UserSetRealizedPnL | Decimal | Yes | Yes | Optional user-specified realized PnL adjustment for this leg. | |
TrackedRealizedPnL | Decimal | Yes | Yes | Realized PnL tracked by MesoLive from executions (when available). |