Skip to main content

查詢歷史成交

FilledHistory

輸入參數

參數類別說明
accountAccount帳號
startDatestring查詢開始日
endDatestring (空值預設與開始日相同)查詢終止日
info

v2.1.1起可查詢長期歷史資料,每次查詢最大設定30日日期區間;v2.1.0之前版本可查詢最近兩日之歷史資料

Result 回傳

參數類別說明
isSuccessbool是否成功
dataList回傳成交資訊
messagestring當isSuccess = False 回傳錯誤訊息

成交資訊 FilledData 欄位

Return type : Object

參數類別說明
datedate成交日期
branchNostring分公司代號
accountstring帳號
seqNostring委託單流水序號 (只有主動回報才回傳此欄位)
orderNostring委託書號
stockNostring股票代號
buySellBsAction買賣別 : Buy 買 、 Sell
filledNostring成交流水號
filledAvgPricedouble成交均價
filledQtyint成交股數
filledPricedouble成交單價
orderTypeOrderType委託單類型 : Stock 現股 、 Margin 融資 、 Short 融券 、 DayTrade 現股當沖 、 SBL借券
filledTimestring成交時間
userDefstring自訂欄位 (只有主動回報才回傳此欄位)

請求範例

Console.WriteLine(sdk.Stock.FilledHistory(account,"20230921","20230922"));

回傳範例

{
isSuccess = True,
message = ,
data = [
FilledData{
date = 2023/09/15, // 成交日期 (string)
branchNo = 6460, // 分公司代號 (string)
account = 26, // 帳號 (string)
seqNo = , // 委託流水序號 (string)
orderNo = bA422, // 委託書號 (string)
stockNo = 1101, // 股票代號 (string)
buySell = Sell, // 買賣別 (BsAction)
filledNo = 00000000001, // 成交流水號 (string)
filledAvgPrice = 35.2, // 成交均價 (double)
filledQty = 1000, // 成交股數 (int)
filledPrice = 35.2, // 成交單價 (double)
orderType = Stock, // 委託單類型 (OrderType)
filledTime = 10:31:00.931 // 成交時間 (string)
userDef = , // 用戶自定義 (string)
},
...
]
}