Method WaitNextClosedCandlestickAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1.MarketData
- Assembly
- WhalesSecret.TradeScriptLib.dll
WaitNextClosedCandlestickAsync(SymbolPair, CandleWidth, CancellationToken)
Waits for a closed candlestick newer than the last consumed closed candlestick for the given candle width and symbol pair.
Task<Candle> WaitNextClosedCandlestickAsync(SymbolPair symbolPair, CandleWidth candleWidth, CancellationToken cancellationToken)
Parameters
symbolPair
SymbolPairSymbol pair to retrieve the candlestick for.
candleWidth
CandleWidthWidth of the candle to retrieve.
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
Exceptions
- OperationCanceledException
Thrown if the operation was cancelled, including cancellation during the shutdown.
- NotConnectedTimeoutException
Thrown if the connection strategy associated with this instance is BlockUntilReconnectedOrTimeout with non-infinite timeout value and this timeout expired while the connection to the exchange is interrupted. That is, this exception does not limit the request itself, it rather limits the period of time that allows the client to recover from the interruption of the connection to the exchange.
- NotConnectedException
Thrown if the connection strategy is FailInstantlyIfNotConnected and the connection to the exchange is interrupted.
- NotFoundException
Thrown if the method is called after the candlestick subscription was disposed.
- InvalidArgumentException
Thrown if the set does not contain a subscription for the given symbol pair.
- InvalidStateException
Thrown if the method is called while batch monitoring operation is active for the given candle width.
- OperationCanceledException
Thrown if the operation was cancelled, including cancellation during the shutdown.
- NotConnectedTimeoutException
Thrown if the connection strategy associated with this instance is BlockUntilReconnectedOrTimeout with non-infinite timeout value and this timeout expired while the connection to the exchange is interrupted. That is, this exception does not limit the request itself, it rather limits the period of time that allows the client to recover from the interruption of the connection to the exchange.
- NotConnectedException
Thrown if the connection strategy is FailInstantlyIfNotConnected and the connection to the exchange is interrupted.
- NotFoundException
Thrown if the method is called after the candlestick subscription was disposed.