Skip to main content

Get Condition History

GetConditionHistory

Input Parameters

ParameterTypeDescription
accountAccountAccount
startDatestringCondition Order Create Date
endDatestringQuery End Date
conditionHistoryStatusHistory Status (Optional)History Condition Status Type1 All Condition Orders (Excluding Deleted, Invalid), Type2 Full Match Orders in Period, Type3 Partial Match Orders in Period, Type4 Deleted Orders in Period, Type5 Invalid Orders in Period, Type6 Triggered Records in Period
info

History data date is based on condition order creation date.

Result Return

ParameterTypeDescription
isSuccessboolIs 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_conditionid = sdk->stock->get_condition_history(target_account, "20250604","20250605", 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 =
}
]
}
]
}