Get Condition Order
get_condition_order
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| conditionStatus | ConditionStatus (Optional) | Condition Order Status: Type1 Today's Query, Type2 Valid Orders, Type3 Comparing Conditions, Type4 Order Processing, Type5 Order Success, Type6 Notified, Type7 Order Failed, Type8 Has Match, Type9 Delete Success, Type10 Abnormal, Type11 Invalid |
Result Return
| Parameter | Type | Description |
|---|---|---|
| isSuccess | bool | Is Success |
| data | List | Condition Order Return Info |
| message | string ? (optional) | Error message when isSuccess = false |
Order Info ConditionDetail Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| guid | string | Condition Order GUID |
| batch_no | string | Batch No |
| order_level | string | Order Level |
| last_time | string | Last Update Time |
| parent_guid | string | Parent Order GUID |
| symbol | string | Stock Symbol |
| order_amount | string | Order Amount |
| child_batch_no | string | Child Batch No |
| account | string | Account |
| condition_content | string | Condition Content |
| action | string | Action |
| condition_buy_sell | string | Condition Buy/Sell |
| condition_symbol | string | Condition Symbol |
| condition_price | string | Price |
| condition_volume | string | Order Volume |
| condition_filled_volume | string | Filled Volume |
| create_time | string | Create Time |
| start_date | string | Scheduled Start Time |
| status | string | Current Status |
| error_message | string | Error Message |
| detail_records_count | string | Detail Records Count |
| detail_records | List | Detail Records Data |
| >> guid | string | Condition Order GUID |
| >> account | string | Account |
| >> condition_content | string | Condition Content |
| >> action | string | Action |
| >> condition_buy_sell | string | Condition Buy/Sell |
| >> condition_symbol | string | Condition Symbol |
| >> condition_price | string | Price |
| >> condition_volume | string | Order Volume |
| >> condition_filled_volume | string | Filled Volume |
| >> start_date | string | Scheduled Start Time |
| >> status | string | Current Status |
| >> error_message | string | Error Message |
| tpsl_count | string | TPSL Count |
| tpsl_record | List | TPSL Detail Records Data |
| >> guid | string | Condition Order GUID |
| >> account | string | Account |
| >> condition_content | string | Condition Content |
| >> action | string | Action |
| >> condition_buy_sell | string | Condition Buy/Sell |
| >> condition_symbol | string | Condition Symbol |
| >> condition_price | string | Price |
| >> condition_volume | string | Order Volume |
| >> condition_filled_volume | string | Filled Volume |
| >> start_date | string | Scheduled Start Time |
| >> status | string | Current Status |
| >> error_message | string | Error Message |
Request Example
auto get_conditionid = sdk->stock->get_condition_order(target_account, std::nullopt);
if (!get_conditionid.is_success) {
std::cout << "get order result failed reason: "
<< (get_conditionid.message.has_value() ? get_conditionid.message.value() : "No message")
<< std::endl;
}
else {
if (get_conditionid.data.has_value()) {
for (const auto& result : get_conditionid.data.value()) {
std::cout << result << std::endl;
}
}
else {
std::cout << "Order result success but no data returned." << std::endl;
}
}
Return Example
{
isSuccess = true,
message = ,
data = [
ConditionDetail {
guid = 8ff3472b-185a-488c-be5a-b478deda080c,
batchNo = ,
orderLevel = 1,
lastTime = 2024-03-14 12:39:02,
conditionType = Multi-Condition,
parentGuid = 58e7a51e-9701-4d26-bc16-18a392a840bd,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = When TSMC price >= 580 from 2024/03/14 to 2024/07/04, until full execution,
action = Order (Next Day Cover),
conditionBuySell = Stock Sell,
conditionSymbol = TSMC Stock Sell,
conditionPrice = 580(ROD),
conditionVolume = 5 lots,
conditionFilledVolume = 0 lots,
createTime = 2024-03-14 12:39:22,
startDate = 2024/03/14,
status = Pending(W),
errorMessage = null,
detailRecordsCount = 0,
detailRecords = ,
tPSLCount = 0,
tPSLRecord =
},
ConditionDetail {
guid = 8ff3472b-185a-488c-be5a-b478deda080c,
batchNo = ,
orderLevel = 1,
lastTime = 2024-03-14 12:39:02,
conditionType = Multi-Condition,
parentGuid = 58e7a51e-9701-4d26-bc16-18a392a840bd,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = When TSMC price <= 570 from 2024/03/14 to 2024/07/04, until full execution,
action = Order (Next Day Cover),
conditionBuySell = Stock Sell,
conditionSymbol = TSMC Stock Sell,
conditionPrice = Market(ROD),
conditionVolume = 5 lots,
conditionFilledVolume = 0 lots,
createTime = 2024-03-14 12:39:22,
startDate = 2024/03/14,
status = Pending(W),
errorMessage = null,
detailRecordsCount = 0,
detailRecords =,
tPSLCount = 0,
tPSLRecord =
},
ConditionDetail {
guid = ec757279-bcb3-46f4-80ac-fccfc786bc8d,
batchNo = ,
orderLevel = 0,
lastTime = 2024-05-21 10:30:00,
conditionType = Multi-Condition,
parentGuid = ec757279-bcb3-46f4-80ac-fccfc786bc8d,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = When TSMC price >= 575, AND TSMC total qty >= 1001, AND Time >= 10:30:00 from 2024/03/14 to 2024/07/04, until partial execution,
action = Order (Day Trade),
conditionBuySell = Stock Buy,
conditionSymbol = TSMC Stock Buy,
conditionPrice = 576(ROD),
conditionVolume = 5 lots,
conditionFilledVolume = 0 lots,
createTime = 2024-03-14 12:30:02,
startDate = 2024/03/14,
status = Triggered-OrderFailed(X),
errorMessage = Price Error[4385715],
detailRecordsCount = 0,
detailRecords = [],
tPSLCount = 2,
tPSLRecord = [
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = When TSMC price >= 580 from 2024/03/14 to 2024/07/04, until full execution,
action = Order (Next Day Cover),
conditionBuySell = Stock Sell,
conditionSymbol = TSMC Stock Sell,
conditionPrice = 580(ROD),
conditionVolume = 5 lots,
conditionFilledVolume = 0 lots,
startDate = 2024/03/14,
status = Pending(W),
errorMessage =
},
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = When TSMC price <= 570 from 2024/03/14 to 2024/07/04, until full execution,
action = Order (Next Day Cover),
conditionBuySell = Stock Sell,
conditionSymbol = TSMC Stock Sell,
conditionPrice = Market(ROD),
conditionVolume = 5 lots,
conditionFilledVolume = 0 lots,
startDate = 2024/03/14,
status = Pending(W),
errorMessage =
}
]
}
]
}