Skip to main content

PlaceOrder

placeOrder

Request Parameter

ParameterTypeMeaning
accountAccountAccount
orderObjectOrderObjectOrder Object
unblockbool ? (default = false)unblock

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 : Future, Option, FutureNight 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 : Buy, Sell
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 : Buy, Sell
priceTypejs:string / ts:FutOptPriceTypeOriginal order price type : Limit, Market, RangeMarket Market with Protection Orders, Reference
pricenumberOrder Price
lotnumberOriginal order lot
timeInForcejs:string / ts:TimeInForceTime In Force ROD, FOK, IOC
orderTypejs:string / ts:FutOptOrderTypeOrder Type : New, Close, Auto, FdayTrade
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 : Limit, Market, RangeMarket 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


// Single
futoptorder = {
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
}

sdk.futopt.placeOrder(account, futoptorder)

// optional field
futoptorder = {
buySell: BSAction.Sell,
symbol: "TXO20000E4",
buySell2: BSAction.Buy, // optional field
symbol2: "TXO19900E4", // optional field
price: "90",
lot: 1,
marketType: FutOptMarketType.Option,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.IOC,
orderType: FutOptOrderType.Auto,
userDef: "nodejs" // optional field
}


sdk.futopt.placeOrder(account, futoptorder)

Response Example

{ // Single-leg order response
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: "00230177010", // Order Serial Number (string)
branchNo: "15901", // Branch Number (string)
account: "1234567", // Account (string)
orderNo: "C0002", // 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: 500, // Order Price (number)
lot: 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: 500, // 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: 500, // Before the Price Modification (number)
userDef: "nodejs", // Custom Fields (string)
lastTime: "11:50:08", // Last Modification Time (string)
}}



{ // Spread order response
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: "00230177020", // Order Serial Number (string)
branchNo: "15901", // Branch Number (string)
account: "1234567", // Account (string)
orderNo: "C0004", // 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: "202405", // Expiry Date (string)
strikePrice: 20000, // Strike Price (number)
callPut: Call, // Call / Put (CallPut): `Call`, `Put`
buySell: Sell, // Buy/Sell Type (BSAction): `Buy`, `Sell`
symbolLeg2: "TXO", // Symbol - second leg of spread order (string)
expiryDateLeg2: "202405", // Expiry date - second leg of spread order (string)
strikePriceLeg2: 199000, // Strike price - second leg of spread order (number)
callPutLeg2: Call, // Call/put - second leg of spread order (string)
buySellLeg2: Buy, // Buy/sell side - second leg of spread order (BSAction)
priceType: Limit, // Original Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
price: 90, // Order Price (number)
lot: 1, // Original order lot (number)
timeInForce: IOC, // 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: 90, // 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: 90, // Before the Price Modification (number)
userDef: "nodejs", // Custom Fields (string)
lastTime: "11:57:41", // Last Modification Time (string)
}
}