exchange.GetConditionOrder
Retrieves information about a specified conditional order.
exchange.GetConditionOrder(conditionOrderId)Examples
Create a take-profit conditional order, then query it by its ID.
javascript
function main(){
// Create a take-profit conditional order
var condition = {
ConditionType: ORDER_CONDITION_TYPE_TP,
TpTriggerPrice: 65000,
TpOrderPrice: 65000
}
var id = exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, condition)
Sleep(1000)
// The parameter id is the conditional order number; fill in the number of the conditional order
// you want to query
var order = exchange.GetConditionOrder(id)
Log("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount,
"Status:", order.Status, "Type:", order.Type, "Condition:", order.Condition)
}
python
def main():
# Create a take-profit conditional order
condition = {
"ConditionType": ORDER_CONDITION_TYPE_TP,
"TpTriggerPrice": 65000,
"TpOrderPrice": 65000
}
id = exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, condition)
Sleep(1000)
order = exchange.GetConditionOrder(id)
Log("Id:", order["Id"], "Price:", order["Price"], "Amount:", order["Amount"],
"Status:", order["Status"], "Type:", order["Type"], "Condition:", order["Condition"])
rust
fn main() {
// Create a take-profit conditional order
let condition = OrderCondition {
ConditionType: ORDER_CONDITION_TYPE_TP,
TpTriggerPrice: 65000.0,
TpOrderPrice: 65000.0,
..Default::default()
};
let id = exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, &condition).unwrap();
Sleep(1000);
// The parameter id is the conditional order number; fill in the number of the conditional order
// you want to query
let order = exchange.GetConditionOrder(&id).unwrap();
Log!("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount,
"Status:", order.Status, "Type:", order.Type, "Condition:", order.Condition);
}Returns
| Type | Description |
| Query the details of a conditional order by its conditional order Id. When the query succeeds, the The returned Order structure contains a |
Arguments
| Name | Type | Required | Description |
conditionOrderId | string | Yes | Conditional order to query. The format of the conditional order Id is similar to that of a regular order Id, consisting of the exchange symbol code and the exchange's original conditional order Id, separated by an English comma. The |
See Also
Remarks
Some exchanges do not support the exchange.GetConditionOrder() function.
The returned conditional order structure contains information such as the trigger condition, trigger price, and order status.
Conditional order statuses include: not triggered, triggered, canceled, etc. The specific status values are determined by the exchange.
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.
Exchanges that serve this function through a fallback: the exchange's API does not fully provide this function, and the docker fills the gap.
The exchange's API covers only part of the function; the docker fills in the rest:
Futures_Futu: There is no single condition-order query, so the order is looked up among the instrument's open condition orders and its condition orders of the last 90 days (at most 100). Condition orders are native Futu orders placed through the order functions withorderType(10 to 15) in the options object; see the notes.