Skip to main content

Place Batch Order

batchPlaceOrder

Input Parameters

ParameterTypeMeaning
accountAccountAccount
OrderObjectOrderObject (list of object)Order Object

Result

ParameterTypeMeaning
isSuccessboolWhether successful
dataObjectOrderResult list is returned
messagestring ? (optional)Error message returned when isSuccess = false

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypenumberFunction 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
marketTypeMarketTypeTrading session type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd
stockNostringSymbol
buySellBSActionBuy/Sell Type : Buy, Sell
priceTypePriceTypeOriginal order price type : Limit, LimitUp, LimitDown, Market, Reference
pricenumberOrder Price
quantitynumberOriginal order quantity
timeInForceTimeInForceTime In Force ROD, FOK, IOC
orderTypeOrderTypeOrder Type : Stock, Margin, Short Short sale, DayTrade, SBL
isPreOrderboolReservation Flag
statusnumberOrder status, for details please refer to STATUS
afterPriceTypePriceTypeValid order price type : Limit, LimitUp, LimitDown, Market, Reference
afterPricenumberValid order price
unitnumberTrading Unit
afterQtynumberValid Order Quantity (filled quantity included)
filledQtynumberFilled Quantity
filledMoneynumberFilled Value
beforeQtynumberBefore the Quantity Modification
beforePricenumberBefore the Price Modification
user_defstringCustom 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: "fromJs"
},{
buySell: BSAction.Buy,
symbol: "2888",
price: "9.00",
quantity: 2000,
marketType: MarketType.Common,
priceType: PriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: OrderType.Stock,
userDef: "fromJs"
}
];

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

Response Example

{
isSuccess: true,
data:[
{
functionType: 0,
date: '2023/10/24',
seqNo: '00000000002',
branchNo: '6460',
account: '26',
orderNo: 'bA720',
assetType: 0,
market: 'TAIEX',
marketType: Common,
stockNo: '2888',
buySell: Buy,
priceType: Limit,
price: 8.9,
quantity: 2000,
timeInForce: ROD,
orderType: Stock,
isPreOrder: false,
status: 10,
afterPriceType: Limit,
afterPrice: 8.9,
unit: 1000,
afterQty: 2000,
filledQty: 0,
filledMoney: 0,
beforeQty: 0,
beforePrice: 9,
userDef: 'fromJs',
lastTime: '11:02:27.599'
},
{
functionType: 0,
date: '2023/10/24',
seqNo: '00000000003',
branchNo: '6460',
account: '26',
orderNo: 'bA720',
assetType: 0,
market: 'TAIEX',
marketType: Common,
stockNo: '2888',
buySell: Buy,
priceType: Limit,
price: 9.0,
quantity: 2000,
timeInForce: ROD,
orderType: Stock,
isPreOrder: false,
status: 10,
afterPriceType: Limit,
afterPrice: 9.0,
unit: 1000,
afterQty: 2000,
filledQty: 0,
filledMoney: 0,
beforeQty: 0,
beforePrice: 9,
userDef: 'fromJs',
lastTime: '11:02:27.599'
}
]
}