Place Batch Order
batchPlaceOrder
Request Parameter
Parameter | Type | Meaning |
---|---|---|
account | Account | Account |
OrderObject | OrderObject (list of object) | Order Object |
Result Response
Parameter | Type | Meaning |
---|---|---|
isSuccess | bool | Interface result |
data | Object | OrderResult list is returned |
message | string ? (optional) | isSuccess = False error description is returned |
OrderResult Parameter
Return type : Object
Parameter | Type | Meaning |
---|---|---|
functionType | int | 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 | js:string / ts:MarketType | Trading session type : Common 、 Fixing 、 IntradayOdd 、 Odd 、 Emg 、 EmgOdd |
stockNo | string | Symbol |
buySell | js:string / ts:BSAction | Buy/Sell Type : Buy 、 Sell |
priceType | js:string / ts:PriceType | Original order price type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference |
price | number | Order Price |
quantity | number | Original order quantity |
timeInForce | js:string / ts:TimeInForce | Time In Force ROD 、 FOK 、 IOC |
orderType | js:string / ts:OrderType | Order Type : Stock 、 Margin 、 Short Short sale 、 DayTrade 、 SBL |
isPreOrder | bool | Reservation Flag |
status | number | Order 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 |
afterPriceType | js:string / ts:PriceType | Valid order price type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference |
afterPrice | number | Valid order price |
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 |
userDef | 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: "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)
}
]
}