pub async fn subscribe_positions(
client: &Arc<Client>,
account_id: AccountId,
position_tracker: PositionTracker,
instrument_provider: Arc<InteractiveBrokersInstrumentProvider>,
) -> Result<()>Expand description
Subscribe to real-time position updates for detecting external position changes (e.g., option exercises).
This spawns a background task to track position changes and generate position status reports for external changes.
§Arguments
client- The IB API clientaccount_id- The account IDposition_tracker- Shared position tracker for detecting external changesinstrument_provider- Instrument provider for resolving contracts to instruments
§Errors
Returns an error if subscription fails.