Method StartBatchMonitoring
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1.MarketData
- Assembly
- WhalesSecret.TradeScriptLib.dll
StartBatchMonitoring(CandleWidth, CancellationToken)
Starts a batch monitoring operation on all subscriptions in the set for the given candle width. After this method is called, the caller can use WhenAnyNewClosedCandlestickAsync(CandleWidth) and WhenAnyNewCandlestickUpdateAsync(CandleWidth).
IAsyncDisposable StartBatchMonitoring(CandleWidth candleWidth, CancellationToken cancellationToken = default)
Parameters
candleWidth
CandleWidthWidth of the candles to monitor updates for.
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- IAsyncDisposable
Object that must be disposed to terminate the started batch monitoring operation.
Exceptions
- InvalidStateException
Thrown if:
- the subscription set is empty, or
- the method is called while another class method that may change the internal state of any subscription for the given candle width in the set is in progress, or
- the method has been called before the previously started batch monitoring for the same candle width finished.