Method GetOpenOrdersAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1
- Assembly
- WhalesSecret.TradeScriptLib.dll
GetOpenOrdersAsync(CancellationToken)
Sends a request to retrieve all open orders.
Task<IReadOnlyList<ILiveOrder>> GetOpenOrdersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<IReadOnlyList<ILiveOrder>>
Live order instances of open orders, or an empty list if there are no open orders.
Remarks
The method queries the local storage of open orders, which is synchronized with the exchange. Therefore, no API request is required for this method to execute.
Exceptions
- InvalidArgumentException
Thrown if
options
isnull
.- NotAvailableException
Thrown if the method is called before the initialization is completed, or if the connection does not support trading.
- NotConnectedException
Thrown if there is no connection with exchange at the moment and there is a risk of reading stale data.
- OperationCanceledException
Thrown if the operation was cancelled including cancellation due to shutdown or object disposal.
- OperationFailedException
Thrown if the request failed for an unknown reason with an unknown outcome.
GetOpenOrdersAsync(OrderFilterOptions, CancellationToken)
Sends a request to retrieve all open orders that satisfy given filter options.
Task<IReadOnlyList<ILiveOrder>> GetOpenOrdersAsync(OrderFilterOptions options, CancellationToken cancellationToken = default)
Parameters
options
OrderFilterOptionsOptions specifying which open orders should be returned.
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<IReadOnlyList<ILiveOrder>>
Live order instances of orders that satisfy the filter options, or an empty list if no open order satisfies the conditions.
Remarks
The method queries the local storage of open orders, which is synchronized with the exchange. Therefore, no API request is required for this method to execute.
Exceptions
- InvalidArgumentException
Thrown if
options
isnull
.- NotAvailableException
Thrown if the method is called before the initialization is completed, or if the connection does not support trading.
- NotConnectedException
Thrown if there is no connection with exchange at the moment and there is a risk of reading stale data.
- OperationCanceledException
Thrown if the operation was cancelled including cancellation due to shutdown or object disposal.
- OperationFailedException
Thrown if the request failed for an unknown reason with an unknown outcome.