Skip to content

MT4Account.OnTradeAsync method

Subscribes to real-time updates for open trade operations (orders, positions, history).

public IAsyncEnumerable<OnTradeData> OnTradeAsync(CancellationToken cancellationToken = default)
parameter description
cancellationToken Optional cancellation token.

Return Value

Async stream of trade update data.

Exceptions

exception condition
ConnectExceptionMT4 Thrown if the account is not connected.
RpcException If the stream fails.
ApiExceptionMT4 Thrown if an error is received from the stream.

See Also