Skip to main content

Place Batch Order

batchPlaceOrder

Request Parameter

ParameterTypeMeaning
accountAccountAccount
OrderObjectOrderObject (list of object)Order Object

Result Response

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

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringTransaction date
seqNostringOrder serial number
branchNostringBranch number
accountstringAccount
orderNostringOrder number
assetTypenumberAsset type : 0 Stock
marketstringMarket type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG EMG
marketTypejs:string / ts:MarketTypeTrading session type : CommonFixingIntradayOddOddEmgEmgOdd
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : BuySell
priceTypejs:string / ts:PriceTypeOriginal order price type : LimitLimitUpLimitDownMarketReference
pricenumberOrder Price
quantitynumberOriginal order quantity
timeInForcejs:string / ts:TimeInForceTime In Force RODFOKIOC
orderTypejs:string / ts:OrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL
isPreOrderboolReservation Flag
statusnumberOrder status : 0 Reservation 、 4 Sending to the system backend 、 9 Timeout 、 10 Active order 、 30 Canceled 、 40 Partially filled, others canceled 、 50 Fully filled 、 90 Failed
afterPriceTypejs:string / ts:PriceTypeValid order price type : LimitLimitUpLimitDownMarketReference
afterPricenumberValid order price
afterQtynumberValid Order Quantity (filled quantity included)
filledQtynumberFilled Quantity
filledMoneynumberFilled Value
beforeQtynumberBefore the Quantity 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: "2888",
price: "8.90",
quantity: 2000,
marketType: MarketType.Common,
priceType: PriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: OrderType.Stock,
userDef: "batch1"
},{
buySell: BSAction.Buy,
symbol: "2888",
price: "9.00",
quantity: 2000,
marketType: MarketType.Common,
priceType: PriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: OrderType.Stock,
userDef: "batch2"
}
];

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

Response Example

{
isSuccess: true,
data:[
{
functionType: 0, // Function Type (number)
date: '2023/10/24', // Trading Date (string)
seqNo: '00000000002', // Order serial number (string)
branchNo: '6460', // Branch number (string)
account: '26', // Account (string)
orderNo: 'bA720', // Order number (string)
assetType: 0, // Asset Category (number)
market: 'TAIEX', // Market Category (string)
marketType: 'Common', // Trading session type (string)
stockNo: '2888', // Symbol (string)
buySell: 'Buy', // Transaction direction (string)
priceType: 'Limit', // Order price type (string)
price: 8.9, // Order Price (number)
quantity: 2000, // Order quantity (number)
timeInForce: 'ROD', // Time in force (string)
orderType: 'Stock', // Order Type (string)
isPreOrder: false, // Reservation flag (boolean)
status: 10, // Order Status (number)
afterPriceType: 'Limit', // Valid order price type (string)
afterPrice: 8.9, // Valid order price (number)
unit: 1000, // Share Unit (number)
afterQty: 2000, // Valid order quantity (number)
filledQty: 0, // Filled quantity (number)
filledMoney: 0, // Filled Value (number)
beforeQty: 0, // Before the quantity modification (number)
beforePrice: 9, // Before the price modification (number)
userDef: 'batch1', // Custom fields (string)
lastTime: '11:02:27.599' // Last modification time (string)
},
{
functionType: 0, // Function Type (number)
date: '2023/10/24', // Trading Date (string)
seqNo: '00000000003', // Order serial number (string)
branchNo: '6460', // Branch number (string)
account: '26', // Account (string)
orderNo: 'bA720', // Order number (string)
assetType: 0, // Asset Category (number)
market: 'TAIEX', // Market Category (string)
marketType: 'Common', // Trading session type (string)
stockNo: '2888', // Symbol (string)
buySell: 'Buy', // Transaction direction (string)
priceType: 'Limit', // Order price type (string)
price: 9.0, // Order Price (number)
quantity: 2000, // Order quantity (number)
timeInForce: 'ROD', // Time in force (string)
orderType: 'Stock', // Order Type (string)
isPreOrder: false, // Reservation flag (boolean)
status: 10, // Order Status (number)
afterPriceType: 'Limit', // Valid order price type (string)
afterPrice: 9.0, // Valid order price (number)
unit: 1000, // Share Unit (number)
afterQty: 2000, // Valid order quantity (number)
filledQty: 0, // Filled quantity (number)
filledMoney: 0, // Filled Value (number)
beforeQty: 0, // Before the quantity modification (number)
beforePrice: 9, // Before the price modification (number)
userDef: 'batch2', // Custom fields (string)
lastTime: '11:02:27.599' // Last modification time (string)
}
]
}