exchange.GetConditionOrder
The exchange.GetConditionOrder() function is used to retrieve information about a specified conditional order.
exchange.GetConditionOrder(conditionOrderId)Examples
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);
}
c++
void main() {
// Create a take-profit conditional order
OrderCondition condition = {.ConditionType = ORDER_CONDITION_TYPE_TP, .TpTriggerPrice = 65000, .TpOrderPrice = 65000};
auto id = exchange.CreateConditionOrder("BTC_USDT", "sell", 0.01, condition);
Sleep(1000);
auto order = exchange.GetConditionOrder(id);
Log("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount,
"Status:", order.Status, "Type:", order.Type);
}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 | The 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.