Skip to main content

Get Historical Trail Profit Order

get_trail_history

Input Parameters

ParameterTypeDescription
accountAccountAccount
start_datestringQuery Start Date
end_datestringQuery End Date

Result Return

ParameterTypeDescription
is_successboolIs Success
datalistCondition Order Return Info
messagestring ? (optional)Error message when isSuccess = false

Order Info ConditionDetail Fields

Return type : Object

ParameterTypeDescription
guidstringCondition Order GUID
batch_nostringBatch No
order_levelstringOrder Level
last_timestringLast Update Time
parent_guidstringParent Order GUID
symbolstringStock Symbol
order_amountstringOrder Amount
child_batch_nostringChild Batch No
accountstringAccount
condition_contentstringCondition Content
actionstringAction
condition_buy_sellstringCondition Buy/Sell
condition_symbolstringCondition Symbol
condition_pricestringPrice
condition_volumestringOrder Volume
condition_filled_volumestringFilled Volume
create_timestringCreate Time
start_datestringScheduled Start Time
statusstringCurrent Status
error_messagestringError Message
detail_records_countstringDetail Records Count
detail_recordsListDetail Records Data
>> guidstringCondition Order GUID
>> accountstringAccount
>> condition_contentstringCondition Content
>> actionstringAction
>> condition_buy_sellstringCondition Buy/Sell
>> condition_symbolstringCondition Symbol
>> condition_pricestringPrice
>> condition_volumestringOrder Volume
>> condition_filled_volumestringFilled Volume
>> start_datestringScheduled Start Time
>> statusstringCurrent Status
>> error_messagestringError Message
tpsl_countstringTPSL Count
tpsl_recordListTPSL Detail Records Data
>> guidstringCondition Order GUID
>> accountstringAccount
>> condition_contentstringCondition Content
>> actionstringAction
>> condition_buy_sellstringCondition Buy/Sell
>> condition_symbolstringCondition Symbol
>> condition_pricestringPrice
>> condition_volumestringOrder Volume
>> condition_filled_volumestringFilled Volume
>> start_datestringScheduled Start Time
>> statusstringCurrent Status
>> error_messagestringError Message

Request Example

auto get_trail_his = sdk->stock->get_trail_history(target_account, "20250601", "20250606");
if (!get_trail_his.is_success) {
std::cout << "get order result failed reason: "
<< (get_trail_his.message.has_value() ? get_trail_his.message.value() : "No message")
<< std::endl;
}
else {
if (get_trail_his.data.has_value()) {
for (const auto& result : get_trail_his.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 = []
}
]
}