exchange.GetConditionOrders
Obtains unfinished conditional orders (conditional orders that have not yet been triggered or canceled).
exchange.GetConditionOrders()
exchange.GetConditionOrders(symbol)Examples
-
Use the spot exchange object to create multiple condition orders, then query the pending condition order information.
javascriptfunction main() { // Create multiple condition orders var condition1 = { ConditionType: ORDER_CONDITION_TYPE_TP, TpTriggerPrice: 65000, TpOrderPrice: 65000 } exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, condition1) var condition2 = { ConditionType: ORDER_CONDITION_TYPE_TP, TpTriggerPrice: 3200, TpOrderPrice: 3200 } exchange.CreateConditionOrder("ETH_USDT", "sell", 0.1, condition2) Sleep(1000) // Query all pending condition orders var orders = exchange.GetConditionOrders() Log("Pending condition orders count:", orders.length) for (var i = 0; i < orders.length; i++) { Log("Condition order", i+1, ":", orders[i]) } }pythondef main(): # Create multiple condition orders condition1 = { "ConditionType": ORDER_CONDITION_TYPE_TP, "TpTriggerPrice": 65000, "TpOrderPrice": 65000 } exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, condition1) condition2 = { "ConditionType": ORDER_CONDITION_TYPE_TP, "TpTriggerPrice": 3200, "TpOrderPrice": 3200 } exchange.CreateConditionOrder("ETH_USDT", "sell", 0.1, condition2) Sleep(1000) # Query all pending condition orders orders = exchange.GetConditionOrders() Log("Pending condition orders count:", len(orders)) for i in range(len(orders)): Log("Condition order", i+1, ":", orders[i])rustfn main() { // Create multiple condition orders let condition1 = OrderCondition { ConditionType: ORDER_CONDITION_TYPE_TP, TpTriggerPrice: 65000.0, TpOrderPrice: 65000.0, ..Default::default() }; let _ = exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, &condition1); let condition2 = OrderCondition { ConditionType: ORDER_CONDITION_TYPE_TP, TpTriggerPrice: 3200.0, TpOrderPrice: 3200.0, ..Default::default() }; let _ = exchange.CreateConditionOrder("ETH_USDT", "sell", 0.1, &condition2); Sleep(1000); // Query all pending condition orders let orders = exchange.GetConditionOrders(None).unwrap(); Log!("Pending condition orders count:", orders.len()); for i in 0..orders.len() { Log!("Condition order", i + 1, ":", orders[i]); } } -
Query the pending condition orders for a specified trading pair.
javascriptfunction main() { // Query the pending condition orders for the BTC_USDT trading pair var orders = exchange.GetConditionOrders("BTC_USDT") Log("BTC_USDT pending condition orders:", orders) }pythondef main(): # Query the pending condition orders for the BTC_USDT trading pair orders = exchange.GetConditionOrders("BTC_USDT") Log("BTC_USDT pending condition orders:", orders)rustfn main() { // Query the pending condition orders for the BTC_USDT trading pair let orders = exchange.GetConditionOrders("BTC_USDT"); Log!("BTC_USDT pending condition orders:", orders); }
Returns
| Type | Description |
|
The returned Order structure contains a |
Arguments
| Name | Type | Required | Description |
symbol | string | No | The instrument (for example |
See Also
Remarks
Range notation (USDT.swap, USD.futures, USDT.option, etc.) and the default range when symbol is omitted are described in Symbols; a range the exchange API does not support is reported as an error and returns a null value.
When the account represented by the exchange object exchange has no unfinished conditional orders within the query scope or on the specified trading instrument, calling this function will return an empty array, i.e.: [].
On a few exchanges the open conditional-order endpoint requires a symbol: there, calling without symbol only queries the open conditional orders of the current instrument, not the whole range. Which exchanges behave like this is noted on each exchange page (all exchanges are listed in Capability Matrix).
Support for the conditional order feature depends on the specific exchange; some exchanges may not support the conditional order feature.
Exchanges that do not support this function: Bithumb, Bitstamp, Coinw, DigiFinex, Futures_DigiFinex, Gemini, HashKey, Korbit, LBank, MEXC, Upbit, WEEX, Zaif, Hyperliquid, Pendle, Uniswap, PancakeSwap, Aerodrome, Velodrome, KyberSwap, OneInch, Jupiter, OKX_DEX, Futures_Polymarket, Futures_IB, Exchange, Web3. The call fails with an error and returns null; for all exchanges see Capability Matrix.