建立批次委託單
batchPlaceOrder
輸入參數
| 參數 | 類別 | 說明 |
|---|---|---|
| account | Account | 帳號 |
| OrderObject | OrderObject (list of object) | 委託內容 |
Result 回傳
| 參數 | 類別 | 說明 |
|---|---|---|
| isSuccess | bool | 是否成功 |
| data | Object | 回傳委託資訊 |
| message | string ? (optional) | 當isSuccess = false 回傳錯誤訊息 |
委託資訊 FutOptOrderResult 欄位
Return type : Object
| 參數 | 類別 | 說明 |
|---|---|---|
| functionType | number | 功能別 : 0 新單 、10 新單執行、 15 改價、 20 改量、30刪單 、90失敗 |
| date | string | 交易日期 |
| seqNo | string | 委託單流水序號 |
| branchNo | string | 分公司代號 |
| account | string | 帳號 |
| orderNo | string | 委託書號 |
| assetType | number | 資產類別 : 1 期貨 、2 選擇權 |
| market | string | 市場類型 : TAIMEX 期貨、選擇權 |
| marketType | js:string / ts:FutOptMarketType | 盤別種類 : Future 期貨日盤 、 Option 選擇權日盤 、 FutureNight 期貨夜盤 、 OptionNight 選擇權夜盤 |
| unit | number | 單位數 |
| currency | string | 幣別 |
| symbol | string | 商品代號 |
| expiryDate | string | 到期日 |
| strikePrice | number | 履約價 |
| callPut | js:string / ts:CallPut | 買賣權 : Call 買權、 Put 賣權 |
| buySell | js:string / ts:BSAction | 買賣別 : Buy 買 、 Sell 賣 |
| symbolLeg2 | string | 商品代號 - 複式第二隻腳 |
| expiryDateLeg2 | string | 到期日 - 複式第二隻腳 |
| strikePriceLeg2 | number | 履約價 - 複式第二隻腳 |
| callPutLeg2 | js:string / ts:CallPut | 買賣權 : Call 買權、 Put 賣權 |
| buySellLeg2 | js:string / ts:BSAction | 買賣別 - 複式第二隻腳: Buy 買 、 Sell 賣 |
| priceType | js:string / ts:FutOptPriceType | 原始委託價格別 : Limit 限價 、 Market 市價 、 RangeMarket 範圍市價、Reference 參考價 |
| price | number | 價格 |
| lot | number | 原始委託股口數 |
| timeInForce | js:string / ts:TimeInforce | 委託條件別 : ROD ROD 、 FOK FOK 、 IOC IOC |
| orderType | js:string / ts:FutOptOrderType | 委託單類型 : New 新倉 、 Close 平倉 、 Auto 自動 、 FdayTrade 當沖 |
| isPreOrder | bool | 是否為預約單 |
| status | number | 委託單狀態 : 0 預約單 、 4 中台收到委託 、 8 後台傳送中 、 9 後台連線逾時 、10 委託成功 、 30刪單成功 、 50 完全成交 、 90 失敗 |
| afterPriceType | js:string / ts:FutOptPriceType | 有效委託價格別 : Limit 限價 、 Market 市價 、RangeMarket 範圍市價、 Reference 參考價 |
| afterPrice | number | 有效委託價格 |
| afterLot | number | 有效委託口數 |
| filledLot | number | 成交口數 |
| filledMoney | number | 成交價金 |
| beforeLot | number | 改單前有效口數 |
| beforePrice | number | 改單前有效價 |
| userDef | string | 自訂欄位 |
| lastTime | string | 最後異動時間 |
| detail | list | 委託歷程 (查詢orderResultDetail or orderHistory才有值) |
| errorMessage | string | 錯誤訊息 |
請求範例
const orders = [{
buySell: BSAction.Buy,
symbol: "TXO20000E4",
price: "530",
lot: 1,
marketType: FutOptMarketType.Option,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutOptOrderType.Auto,
userDef: "nodejs" // optional field
},{
buySell: BSAction.Buy,
symbol: "TXO20000E4",
price: "530",
lot: 1,
marketType: FutOptMarketType.Option,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutOptOrderType.Auto,
userDef: "nodejs" // optional field
}
];
const batch_order_results = sdk.futopt.batchPlaceOrder(account,orders);
回傳範例
{
isSuccess: true,
data:[
{
functionType: 0, // 功能別 (number)
date: "2024/03/15", // 交易日期 (string)
seqNo: "00230177010", // 委託單流水序號 (string)
branchNo: "15901", // 分公司代號 (string)
account: "1234567", // 帳號 (string)
orderNo: "C0002", // 委託書號 (string)
assetType: 2, // 資產類別 (number)
market: "TAIMEX", // 市場類型 (string)
marketType: Option, // 盤別種類 (FutOptMarketType)
unit: 1, // 單位數 (number)
currency: "TWD", // 幣別 (string)
symbol: "TXO", // 商品代號 (string)
expiryDate: "202404", // 到期日 (string)
strikePrice: 20000, // 履約價 (number)
callPut: "Call", // 買賣權 (string)
buySell: Buy, // 買賣別 (BSAction)
priceType: Limit, // 原始委託價格別 (FutOptPriceType)
price: 500, // 價格 (number)
lot: 1, // 原始委託股口數 (number)
timeInForce: ROD, // 委託條件別 (TimeInforce)
orderType: Auto, // 委託單類型 (FutOptOrderType)
isPreOrder: false, // 是否為預約單 (bool)
status: 10, // 委託單狀態 (number)
afterPriceType: Limit, // 有效委託價格別 (FutOptPriceType)
afterPrice: 500, // 有效委託價格 (number)
afterLot: 1, // 有效委託股口數 (number)
filledLot: 0, // 成交股口數 (number)
filledMoney: 0, // 成交價金 (number)
beforeLot: 0, // 改單前有效股口數 (number)
beforePrice: 500, // 改單前有效價格 (number)
userDef: "nodejs", // 自訂欄位 (string)
lastTime: "11:50:08", // 最後異動時間 (string)
},
{
functionType: 0, // 功能別 (number)
date: "2024/03/15", // 交易日期 (string)
seqNo: "00230177011", // 委託單流水序號 (string)
branchNo: "15901", // 分公司代號 (string)
account: "1234567", // 帳號 (string)
orderNo: "C0003", // 委託書號 (string)
assetType: 2, // 資產類別 (number)
market: "TAIMEX", // 市場類型 (string)
marketType: Option, // 盤別種類 (FutOptMarketType)
unit: 1, // 單位數 (number)
currency: "TWD", // 幣別 (string)
symbol: "TXO", // 商品代號 (string)
expiryDate: "202404", // 到期日 (string)
strikePrice: 20000, // 履約價 (number)
callPut: "Call", // 買賣權 (string)
buySell: Buy, // 買賣別 (BSAction)
priceType: Limit, // 原始委託價格別 (FutOptPriceType)
price: 500, // 價格 (number)
lot: 1, // 原始委託股口數 (number)
timeInForce: ROD, // 委託條件別 (TimeInforce)
orderType: Auto, // 委託單類型 (FutOptOrderType)
isPreOrder: false, // 是否為預約單 (bool)
status: 10, // 委託單狀態 (number)
afterPriceType: Limit, // 有效委託價格別 (FutOptPriceType)
afterPrice: 500, // 有效委託價格 (number)
afterLot: 1, // 有效委託股口數 (number)
filledLot: 0, // 成交股口數 (number)
filledMoney: 0, // 成交價金 (number)
beforeLot: 0, // 改單前有效股口數 (number)
beforePrice: 500, // 改單前有效價格 (number)
userDef: "nodejs", // 自訂欄位 (string)
lastTime: "11:50:08", // 最後異動時間 (string)
}
]
}