positionsStreamer property
override
Stream of positions. Make sure to stream before launching chart.
productType is required — the same symbol can have two simultaneous
positions under different product types, and this field disambiguates
them.
JSON List of Position objects:
[
{
"symID": "NIFTY",
"displayName": "NIFTY 50",
"netQty": 50,
"avgPrice": 22800.0,
"netOrgAvgPrice": 22800.0,
"pnl": 250.0,
"realizedPnl": 0.0,
"realizedOrgPnl": 0.0,
"unrealizedPL": 250.0,
"mtm": 250.0,
"multiplier": 1.0,
"priceFactor": 1.0,
"productType": "normal",
"symbol": { "id": "NIFTY", "name": "NIFTY 50", ... }
}
]
productType: "normal", "intraday"
symbol: full SymbolInfo shape — see loadData.
positionSide (derived, not sent): "long", "short" — inferred from
netQty's sign, not a wire field.
positionTypes (derived, not sent): "Open", "Close" — inferred from
whether netQty is non-zero, not a wire field.
Implementation
@override
Stream<String> get positionsStreamer =>
_positionsChannel.receiveBroadcastStream().cast<String>();