Get Trail Profit Order
get_trail_order
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
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_trail = sdk->stock->get_trail_order(target_account);
if (!get_trail.is_success) {
std::cout << "get order result failed reason: "
<< (get_trail.message.has_value() ? get_trail.message.value() : "No message")
<< std::endl;
}
else {
if (get_trail.data.has_value()) {
for (const auto& result : get_trail.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 = 5c154a76-e7ef-4b8f-94b5-80bf08fa4b8e,
BatchNo = ,
OrderLevel = 0,
LastTime = 2024-08-02 16:45:01,
ConditionType = ,
ParentGuid = ,
Symbol = 2889,
OrderAmount = 0,
ChildBatchNo = ,
Account = 1307515,
ConditionContent = When Waterland Financial Holdings falls by 10% from 1000 (initial base price) between 2024/08/02 and 2024/08/02, until full execution or expiry,
Action = Order,
ConditionBuySell = Stock Buy,
ConditionSymbol = Waterland Financial Holdings (2889),
ConditionPrice = Matched Price(1) Tick(ROD),
ConditionVolume = 1 lot,
ConditionFilledVolume = 0 lot,
CreateTime = 2024-08-02 10:07:31,
StartDate = 2024/08/02,
Status = Condition Stop(I),
ErrorMessage = null,
DetailRecordsCount = 0,
DetailRecords = [],
TpslCount = 0,
TpslRecord = []
},
ConditionDetail
{
Guid = c71117c8-aa70-4477-9f04-ff4c73a4fad0,
BatchNo = "",
OrderLevel = 0,
LastTime = 2024-07-29 17:30:00,
ConditionType = ,
ParentGuid = ,
Symbol = 2330,
OrderAmount = 0,
ChildBatchNo = "",
Account = 1307515,
ConditionContent = When TSMC rises by 5% from 860 (initial base price) between 2024/07/29 and 2024/07/29, until full execution or expiry,
Action = Order,
ConditionBuySell = Stock Buy,
ConditionSymbol = TSMC (2330),
ConditionPrice = Matched Price(5) Tick(ROD),
ConditionVolume = 2 lots,
ConditionFilledVolume = 0 lot,
CreateTime = 2024-07-29 11:01:49,
StartDate = 2024/07/29,
Status = Condition Stop(I),
ErrorMessage = null,
DetailRecordsCount = 0,
DetailRecords = [],
TpslCount = 0,
TpslRecord = []
}
]
}