Method CreateCandlestickSubscriptionAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1
- Assembly
- WhalesSecret.TradeScriptLib.dll
CreateCandlestickSubscriptionAsync(SymbolPair)
Sends a subscription request to receive candlestick updates from the exchange.
Task<ICandlestickSubscription> CreateCandlestickSubscriptionAsync(SymbolPair symbolPair)
Parameters
symbolPair
SymbolPairSymbol pair to subscribe.
Returns
- Task<ICandlestickSubscription>
Candlestick subscription that is cancelled when disposed.
Remarks
Method can be called in parallel fashion but the symbol pairs of the parallel calls are subscribed one by one in serial fashion given internal locking mechanism.
Exceptions
- AlreadyExistsException
Thrown if the given symbol pair is already subscribed or its subscription is in progress.
- NotConnectedException
Thrown if the request could not be sent to the exchange.
- NotAvailableException
Thrown if the symbol pair is not supported on the exchange or if the used connection has not been created with MarketData support.
- ExchangeResponseTimeoutException
Thrown if the exchange does not respond in timely manner.
- InvalidExchangeResponseException
Thrown if the exchange responded with invalid response.
- ExchangeIsUnderMaintenanceException
Thrown if the exchange is in the maintenance mode and does not accept new requests.
- ApiRequestLimitReachedException
Thrown if the exchange rejected to create a new data subscription due to an API rate limit.
- InvalidRequestDataException
Thrown if the exchange rejected to accept a new data subscription because some value in the subscription request is malformed or otherwise invalid.
- 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.
- OperationFailedException
Thrown if the request failed for an unknown reason with an unknown outcome.
- MalfunctionException
Thrown if an internal unexpected error occurred.
- See Also