Skip to main content

Place Batch Order

batchPlaceOrder

Request Parameter

ParameterTypeMeaning
accountAccountAccount
OrderObjectOrderObject (list of object)Order Object

Result Response

ParameterTypeMeaning
isSuccessboolInterface result
dataObjectFutOptOrderResult list is returned
messagestring ? (optional)isSuccess = False error description is returned

FutOptOrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypenumberFunction Type : 0 New 、 10 Execute New、15 Amend Price 、 20 Amend Lot 、 30 Cancel、90Failed
datestringTransaction date
seqNostringOrder serial number
branchNostringBranch number
accountstringAccount
orderNostringOrder number
assetTypenumberAsset type : 1 Future 、2 Option
marketstringMarket type : TAIMEX Future、Option
marketTypejs:string / ts:FutOptMarketTypeTrading session type : FutureOptionFutureNight After-Hour Future 、 OptionNight After-Hour Option
unitnumberTrading Unit
currencystringTrading Currency
symbolstringSymbol
expiryDatestringExpiry Date
strikePricenumberStrike Price
callPutjs:string / ts:CallPutCall / Put Type : Call Call 、Put Put
buySelljs:string / ts:BSActionBuy/Sell Type : BuySell
symbolLeg2stringSymbol - Spread Order
expiryDateLeg2stringExpiry Date - Spread Order
strikePriceLeg2numberStrike Price - Spread Order
callPutLeg2js:string / ts:CallPutCall / Put Type : Call Call 、Put Put
buySellLeg2js:string / ts:BSActionBuy/Sell Type : BuySell
priceTypejs:string / ts:FutOptPriceTypeOriginal order price type : LimitMarketRangeMarket Market with Protection Orders 、 Reference
pricenumberOrder Price
lotnumberOriginal order lot
timeInForcejs:string / ts:TimeInForceTime In Force RODFOKIOC
orderTypejs:string / ts:FutOptOrderTypeOrder Type : NewCloseAutoFdayTrade
isPreOrderboolReservation Flag
statusnumberOrder Status : 0 Reservation 、 4 In queue 、 8 Processing by system backend 、 9 TimeOut 、 10 Active Order 、 30 Cancel Order 、 50 Fully Filled 、 90 Order Failed
afterPriceTypejs:string / ts:FutOptPriceTypeValid order price type : LimitMarketRangeMarket Market with Protection Orders 、 Reference
afterPricenumberValid order price
afterLotnumberValid Order Lot
filledLotnumberFilled Lot
filledMoneynumberFilled Value
beforeLotnumberBefore the Lot Modification
beforePricenumberBefore the Price Modification
userDefstringCustom Fields
lastTimestringLast Modification Time
detailslistOrder Process (Return value when query orderResultDetail or orderHistory )
errorMessagestringError Message

Request Example

const orders = [{
buySell: BSAction.Buy,
symbol: "TXO20000E4",
price: "530",
quantity: 1,
marketType: FutOptMarketType.Option,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutOptOrderType.Auto,
userDef: "batch1"
},{
buySell: BSAction.Buy,
symbol: "TXO20000E4",
price: "530",
quantity: 1,
marketType: FutOptMarketType.Option,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutOptOrderType.Auto,
userDef: "batch2"
}
];

const batch_order_results = sdk.futopt.batchPlaceOrder(account,orders);

Response Example

{
isSuccess: true,
data:[
{
functionType: 0, // Function Type (number): `0` New, `15` Amend Price, `20` Amend Lot, `30` Cancel
date: "2024/03/25", // Transaction Date (string)
seqNo: "00230177110", // Order Serial Number (string)
branchNo: "15901", // Branch Number (string)
account: "1234567", // Account (string)
orderNo: "C0102", // Order Number (string)
assetType: 2, // Asset Type (number): `1` Future, `2` Option
market: "TAIMEX", // Market Type (string)
marketType: Option, // Trading Session Type (FutOptMarketType): `Future`, `Option`, `FutureNight` After-Hour Future, `OptionNight` After-Hour Option
unit: 1, // Unit (number)
currency: "TWD", // Trading Currency (string)
symbol: "TXO", // Symbol (string)
expiryDate: "202404", // Expiry Date (string)
strikePrice: 20000, // Strike Price (number)
callPut: Call, // Call / Put (CallPut): `Call`, `Put`
buySell: Buy, // Buy/Sell Type (BSAction): `Buy`, `Sell`
priceType: Limit, // Original Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
price: 530, // Order Price (number)
lots: 1, // Original Order Lot (number)
timeInForce: ROD, // Time In Force (TimeInforce): `ROD`, `FOK`, `IOC`
orderType: Auto, // Order Type (FutOptOrderType): `New`, `Close`, `Auto`, `FdayTrade` DayTrade
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number): `0` Reservation, `4` InQueue, `9` TimeOut, `10` New Order, `30` Cancel Order, `50` Fully Filled, `90` Order Failed
afterPriceType: Limit, // Valid Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
afterPrice: 530, // Valid Order Price (number)
afterLot: 1, // Valid Order Lot (number)
filledLot: 0, // Filled Lot (number)
filledMoney: 0, // Filled Value (number)
beforeLot: 0, // Before the Lot Modification (number)
beforePrice: 530, // Before the Price Modification (number)
userDef: "batch1", // Custom Fields (string)
lastTime: "11:50:08", // Last Modification Time (string)
},
{
functionType: 0, // Function Type (number): `0` New, `15` Amend Price, `20` Amend Lot, `30` Cancel
date: "2024/03/25", // Transaction Date (string)
seqNo: "00230177111", // Order Serial Number (string)
branchNo: "15901", // Branch Number (string)
account: "1234567", // Account (string)
orderNo: "C0103", // Order Number (string)
assetType: 2, // Asset Type (number): `1` Future, `2` Option
market: "TAIMEX", // Market Type (string)
marketType: Option, // Trading Session Type (FutOptMarketType): `Future`, `Option`, `FutureNight` After-Hour Future, `OptionNight` After-Hour Option
unit: 1, // Unit (number)
currency: "TWD", // Trading Currency (string)
symbol: "TXO", // Symbol (string)
expiryDate: "202404", // Expiry Date (string)
strikePrice: 20000, // Strike Price (number)
callPut: Call, // Call / Put (CallPut): `Call`, `Put`
buySell: Buy, // Buy/Sell Type (BSAction): `Buy`, `Sell`
priceType: Limit, // Original Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
price: 530, // Order Price (number)
lots: 1, // Original Order Lot (number)
timeInForce: ROD, // Time In Force (TimeInforce): `ROD`, `FOK`, `IOC`
orderType: Auto, // Order Type (FutOptOrderType): `New`, `Close`, `Auto`, `FdayTrade` DayTrade
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number): `0` Reservation, `4` InQueue, `9` TimeOut, `10` New Order, `30` Cancel Order, `50` Fully Filled, `90` Order Failed
...
}
]
}