Skip to main content

Historical condition single query

GetConditionHistory

Input parameters

ParametersCategoryDescription
accountAccountaccount
startDatestringQuery condition order creation date
endDatestringQuery deadline
conditionHistoryStatusHistory Status (Optional)Historical conditional order status Type1 All conditional orders (excluding deleted, invalid), Type2 All orders within the selected period, Type3 Selected orders within the period, Type4 Selected orders deleted during the period, Type5 Select period invalid order, Type6 trigger record within the selected period
info

The date of historical data is based on the creation date of the conditional order.

Result return

ParametersCategoryDescription
isSuccessboolWhether it was successful
dataListConditional order return information
messagestring ? (optional)Return error message when isSuccess = false

Commission information ConditionDetail field

Return type : Object

ParametersCategoryDescription
guidstringcondition order number
batch_nostringorder batch number
order_levelstringConditional single level
last_timestringupdate time
parent_guidstringParent tracking number
symbolstringproduct code
order_amountstringOrder amount
child_batch_nostringChild order batch number
accountstringaccount number
condition_contentstringcondition content
actionstringprocessing method
condition_buy_sellstringBuy and sell type
condition_symbolstringproduct name
condition_pricestringprice
condition_volumestringOrder quantity
condition_filled_volumestringTransaction quantity
create_timestringCreation time
start_datestringReservation start time
statusstringcurrent status
error_messagestringCurrent status exception description
detail_records_countstringQuery the number of detailed records
detail_recordsListQuery detailed information
>> guidstringcondition order number
>> accountstringaccount number
>> condition_contentstringcondition content
>> actionstringprocessing method
>> condition_buy_sellstringBuy and sell type
>> condition_symbolstringproduct name
>> condition_pricestringprice
>> condition_volumestringOrder quantity
>> condition_filled_volumestringTransaction quantity
>> start_datestringAppointment time
>> statusstringcurrent status
>> error_messagestringCurrent status exception description
tpsl_countstringThe number of stop loss and profit stops
tpsl_recordListStop loss and stop profit details
>> guidstringcondition order number
>> accountstringaccount number
>> condition_contentstringcondition content
>> actionstringprocessing method
>> condition_buy_sellstringBuy and sell type
>> condition_symbolstringproduct name
>> condition_pricestringprice
>> condition_volumestringOrder quantity
>> condition_filled_volumestringTransaction quantity
>> start_datestringAppointment time
>> statusstringcurrent status
>> error_messagestringCurrent status exception description

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 = 多條件,
parentGuid = 58e7a51e-9701-4d26-bc16-18a392a840bd,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = when自2024/03/142024/07/04withinTaiwanproductelectricfilledpricegreateratequalat580元 allfilledis止,
action = downorders(次day回補),
conditionBuySell = currentstockSell,
conditionSymbol = Taiwanproductelectric currentstockSell,
conditionPrice = 580(ROD),
conditionVolume = 5lots,
conditionFilledVolume = 0lots,
createTime = 2024-03-14 12:39:22,
startDate = 2024/03/14,
status = 未生效(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 = 多條件,
parentGuid = 58e7a51e-9701-4d26-bc16-18a392a840bd,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = when自2024/03/142024/07/04withinTaiwanproductelectricfilledpricelessatequalat570元 allfilledis止,
action = downorders(次day回補),
conditionBuySell = currentstockSell,
conditionSymbol = Taiwanproductelectric currentstockSell,
conditionPrice =price(ROD),
conditionVolume = 5lots,
conditionFilledVolume = 0lots,
createTime = 2024-03-14 12:39:22,
startDate = 2024/03/14,
status = 未生效(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 = 多條件,
parentGuid = ec757279-bcb3-46f4-80ac-fccfc786bc8d,
symbol = 2330,
orderAmount = 0,
childBatchNo = ,
account = 1307515,
conditionContent = when自2024/03/142024/07/04withinTaiwanproductelectricfilledpricegreateratequalat575元,且 Taiwanproductelectricfilled總quantitygreateratequalat1001lots,且 Taiwanproductelectric時間greateratequalat10:30:00 部份filledis止,
action = downorders(when沖),
conditionBuySell = currentstockBuy,
conditionSymbol = Taiwanproductelectric currentstockBuy,
conditionPrice = 576(ROD),
conditionVolume = 5lots,
conditionFilledVolume = 0lots,
createTime = 2024-03-14 12:30:02,
startDate = 2024/03/14,
status = Triggered - 委託failed(X),
errorMessage = ordersprice輸入error[4385715],
detailRecordsCount = 0,
detailRecords = [],
tPSLCount = 2,
tPSLRecord = [
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = when自2024/03/142024/07/04withinTaiwanproductelectricfilledpricegreateratequalat580元 allfilledis止,
action = downorders(次day回補),
conditionBuySell = currentstockSell,
conditionSymbol = Taiwanproductelectric currentstockSell,
conditionPrice = 580(ROD),
conditionVolume = 5lots,
conditionFilledVolume = 0lots,
startDate = 2024/03/14,
status = 未生效(W),
errorMessage =
},
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = when自2024/03/142024/07/04withinTaiwanproductelectricfilledpricelessatequalat570元 allfilledis止,
action = downorders(次day回補),
conditionBuySell = currentstockSell,
conditionSymbol = Taiwanproductelectric currentstockSell,
conditionPrice =price(ROD),
conditionVolume = 5lots,
conditionFilledVolume = 0lots,
startDate = 2024/03/14,
status = 未生效(W),
errorMessage =
}
]
}
]
}