Skip to main content

條件單查詢

get_condition_order

輸入參數

參數類別說明
accountAccount帳號
conditionStatusConditionStatus (Optional)條件單狀態 : Type1 今日相關查詢 、 Type2 尚有效單 、 Type3 條件比對中 、 Type4 委託處理中 、Type5 委託成功 、 Type6 已通知 、 Type7 委託失敗 、 Type8 已有成交 、Type9 刪除成功 、Type10 異常 、 Type11 失效

Result 回傳

參數類別說明
isSuccessbool是否成功
dataList條件單回傳資訊
messagestring ? (optional)當isSuccess = false 回傳錯誤訊息

委託資訊 ConditionDetail 欄位

Return type : Object

參數類別說明
guidstring條件單號
batch_nostring分單批號
order_levelstring條件單層級
last_timestring更新時間
parent_guidstring父單單號
symbolstring商品代號
order_amountstring委託金額
child_batch_nostring子單分單批號
accountstring帳號
condition_contentstring條件內容
actionstring處理方式
condition_buy_sellstring買賣別
condition_symbolstring商品名稱
condition_pricestring價格
condition_volumestring委託數量
condition_filled_volumestring成交數量
create_timestring建立時間
start_datestring預約開始時間
statusstring目前狀態
error_messagestring目前狀態異常說明
detail_records_countstring查詢明細筆數
detail_recordsList查詢明細資料
>> guidstring條件單號
>> accountstring帳號
>> condition_contentstring條件內容
>> actionstring處理方式
>> condition_buy_sellstring買賣別
>> condition_symbolstring商品名稱
>> condition_pricestring價格
>> condition_volumestring委託數量
>> condition_filled_volumestring成交數量
>> start_datestring預約時間
>> statusstring目前狀態
>> error_messagestring目前狀態異常說明
tpsl_countstring停損停利筆數
tpsl_recordList停損停利明細資料
>> guidstring條件單號
>> accountstring帳號
>> condition_contentstring條件內容
>> actionstring處理方式
>> condition_buy_sellstring買賣別
>> condition_symbolstring商品名稱
>> condition_pricestring價格
>> condition_volumestring委託數量
>> condition_filled_volumestring成交數量
>> start_datestring預約時間
>> statusstring目前狀態
>> error_messagestring目前狀態異常說明

請求範例

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;
}
}

回傳範例


{
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 = 當自2024/03/142024/07/04內台積電成交價大於等於580元 全部成交為止,
action = 下單(次日回補),
conditionBuySell = 現股賣,
conditionSymbol = 台積電 現股賣,
conditionPrice = 580(ROD),
conditionVolume = 5,
conditionFilledVolume = 0,
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 = 當自2024/03/142024/07/04內台積電成交價小於等於570元 全部成交為止,
action = 下單(次日回補),
conditionBuySell = 現股賣,
conditionSymbol = 台積電 現股賣,
conditionPrice = 市價(ROD),
conditionVolume = 5,
conditionFilledVolume = 0,
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 = 當自2024/03/142024/07/04內台積電成交價大於等於575元,且 台積電成交總量大於等於1001張,且 台積電時間大於等於10:30:00 部份成交為止,
action = 下單(當沖),
conditionBuySell = 現股買,
conditionSymbol = 台積電 現股買,
conditionPrice = 576(ROD),
conditionVolume = 5,
conditionFilledVolume = 0,
createTime = 2024-03-14 12:30:02,
startDate = 2024/03/14,
status = 觸發-委託失敗(X),
errorMessage = 單價輸入錯誤[4385715],
detailRecordsCount = 0,
detailRecords = [],
tPSLCount = 2,
tPSLRecord = [
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = 當自2024/03/142024/07/04內台積電成交價大於等於580元 全部成交為止,
action = 下單(次日回補),
conditionBuySell = 現股賣,
conditionSymbol = 台積電 現股賣,
conditionPrice = 580(ROD),
conditionVolume = 5,
conditionFilledVolume = 0,
startDate = 2024/03/14,
status = 未生效(W),
errorMessage =
},
ParentChildRecord
{
guid = c94b552a-22da-43e4-be44-f27a9c2026e1,
account = 1307515,
conditionContent = 當自2024/03/142024/07/04內台積電成交價小於等於570元 全部成交為止,
action = 下單(次日回補),
conditionBuySell = 現股賣,
conditionSymbol = 台積電 現股賣,
conditionPrice = 市價(ROD),
conditionVolume = 5,
conditionFilledVolume = 0,
startDate = 2024/03/14,
status = 未生效(W),
errorMessage =
}
]
}
]
}