Place Batch Order
batchPlaceOrder
Input Parameters
| Parameter | Type | Meaning |
|---|---|---|
| account | Account | Account |
| OrderObject | OrderObject (list of object) | Order Object |
Result
| Parameter | Type | Meaning |
|---|---|---|
| isSuccess | bool | Whether successful |
| data | Object | OrderResult list is returned |
| message | string ? (optional) | Error message returned when isSuccess = false |
OrderResult Parameter
Return type : Object
| Parameter | Type | Meaning |
|---|---|---|
| functionType | number | Function Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed |
| date | string | Transaction date |
| seqNo | string | Order serial number |
| branchNo | string | Branch number |
| account | string | Account |
| orderNo | string | Order number |
| assetType | number | Asset type : 0 Stock |
| market | string | Market type : TAIEX Listed, TAISDAQ OTC, TAIEMG EMG |
| marketType | MarketType | Trading session type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd |
| stockNo | string | Symbol |
| buySell | BSAction | Buy/Sell Type : Buy, Sell |
| priceType | PriceType | Original order price type : Limit, LimitUp, LimitDown, Market, Reference |
| price | number | Order Price |
| quantity | number | Original order quantity |
| timeInForce | TimeInForce | Time In Force ROD, FOK, IOC |
| orderType | OrderType | Order Type : Stock, Margin, Short Short sale, DayTrade, SBL |
| isPreOrder | bool | Reservation Flag |
| status | number | Order status, for details please refer to STATUS |
| afterPriceType | PriceType | Valid order price type : Limit, LimitUp, LimitDown, Market, Reference |
| afterPrice | number | Valid order price |
| unit | number | Trading Unit |
| afterQty | number | Valid Order Quantity (filled quantity included) |
| filledQty | number | Filled Quantity |
| filledMoney | number | Filled Value |
| beforeQty | number | Before the Quantity Modification |
| beforePrice | number | Before the Price Modification |
| user_def | string | Custom Fields |
| lastTime | string | Last Modification Time |
| details | list | Order Process (Return value when query orderResultDetail or orderHistory ) |
| errorMessage | string | Error 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'
}
]
}