exchange.GetConditionOrder

exchange.GetConditionOrder()函数用于获取条件单信息。

根据条件单号查询条件单详情,查询成功返回{@struct/Order Order}结构,查询失败返回空值。

返回的Order结构中包含{@struct/Condition Condition}字段,该字段包含条件单的详细配置信息(触发价格、执行价格、条件类型等)。 {@struct/Order Order} / 空值

exchange.GetConditionOrder(conditionOrderId)

conditionOrderId参数用于指定要查询的条件单。条件单ID格式与普通订单ID类似,由交易所品种代码和交易所原始条件单ID组成,以英文逗号分隔。

调用exchange.GetConditionOrder()函数查询条件单时传入的参数conditionOrderId与条件单结构的Id属性一致。 conditionOrderId true string

”`javascript function main(){ // 创建止盈条件单 var condition = { ConditionType: ORDER_CONDITION_TYPE_TP, TpTriggerPrice: 65000, TpOrderPrice: 65000 } var id = exchange.CreateConditionOrder(“BTC_USDT”, “sell”, 0.01, condition) Sleep(1000)

// 参数id为条件单号码,需填入你想要查询的条件单的号码
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(): # 创建止盈条件单 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"])```

”`cpp void main() { // 创建止盈条件单 json condition = R”({ “ConditionType”: ORDER_CONDITION_TYPE_TP, “TpTriggerPrice”: 65000, “TpOrderPrice”: 65000 })“_json; 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, "Condition:", order.Condition);

}“`

部分交易所不支持exchange.GetConditionOrder()函数。 返回的条件单结构包含触发条件、触发价格、订单状态等信息。 条件单状态包括:未触发、已触发、已取消等,具体状态值因交易所而异。

{@struct/Order Order}, {@fun/Trade/exchange.GetConditionOrders exchange.GetConditionOrders}, {@fun/Trade/exchange.GetHistoryConditionOrders exchange.GetHistoryConditionOrders}