List of Enumerations
Class
Class
OrderObject
Parameter | Type | Meaning |
---|---|---|
buySell | BSAction | Buy/Sell Type valid in Buy 、 Sell |
symbol | string | Symbol |
price | string | Order Price (use null if priceType is not Limit ) |
quantity | int | Order Quantity |
marketType | MarketType | Trading Session valid in Common 、Fixing 、IntradayOdd 、Odd 、Emg 、EmgOdd |
priceType | PriceType | Price Type valid in Limit 、LimitUp 、LimitDown 、Market 、Reference |
timeInForce | TimeInForce | Time In Force valid in ROD 、FOK 、IOC |
orderType | OrderType | Order Type valid in Stock 、Margin 、Short 、DayTrade 、SBL |
userDef (optional) | string | Customer Field (Up to 10 characters, no special characters supported 、 Not applicable to Emg) |
The units and ranges for 'quantity' vary for different MarketTypes. Please refer to the MarketType description for details
When marketType is one of MarketType.Common, MarketType.Odd, MarketType.IntradayOdd, MarketType.Emg, and priceType is PriceType.Limit, the 'price' field must be filled; otherwise, the 'price' field should be empty or null
When directly short selling common stocks, orderType should be DayTrade, buySell is Sell, and marketType is Common
OrderResult
OrderResult; You can use getOrderResults(accounts) to get data.
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:OrderType | 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 |
userDef | string | Custom Fields |
lastTime | string | Last Modification Time (see below for the format) |
errorMessage | string | Error Message |
details | list | Order Process (The following fields will only appear in the query details) |
>> functionType | number | Function Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 50 Fully Filled 、 90 Failed |
>> modifiedTime | string | Order Modified Time (see below for the format) |
>> beforeQty | number | Original Order Quantity |
>> afterQty | number | Valid Order Quantity (filled quantity included) |
>> beforePrice | number | Original Order Price |
>> afterPrice | number | Valid Order Price |
>> filledMoney | number | Filled Value |
>> status | number | Order Status |
>> errMsg | string | Error Message |
lastTime and modifiedTime format: HH:MM:SS.fff or HH:MM:SS (that is, if .fff = .000, .fff will be ommitted).
BatchResult
BatchResult; You can use BatchOrderLists(accounts) to get data.
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 | Date |
branchNo | string | Branch Aumber |
account | string | Account |
batchSeqNo | string | Batch Serial Number |
ModifyPriceObj
Modified Price Object
Parameter | Type | Default Value | Meaning |
---|---|---|---|
OrderResult | Object | - | OrderResult |
price | number | - | The price after modification |
PriceType | PriceType | - | The price type after modification : Limit 、LimitUp 、LimitDown 、Market 、Reference |
ModifyQuantityObj
Modified Quantity Object
Parameter | Type | Default Value | Meaning |
---|---|---|---|
OrderResult | Object | - | OrderResult |
quantity | int | - | The quantity after modification |
FilledData
Filled Data Object
Parameter | Type | Meaning |
---|---|---|
date | string | Filled Date |
branchNo | string | Branch Number |
account | string | Account |
seqNo | string | Order serial number (only display on filled callback) |
orderNo | string | Order Number |
stockNo | string | Symbol |
buySell | js:string / ts:BSAction | Buy/Sell Type : Buy 、 Sell |
orderType | js:string / ts:OrderType | Order Type : Stock 、 Margin 、 Short Short sale 、 DayTrade 、 SBL |
filledNo | string | Filled Serial Number |
filledAvgPrice | number | Filled Average Price |
filledQty | number | Filled Share |
filledPrice | number | Filled Price |
filledTime | string | Filled Time |
userDef | string | Custom Fields (only display on filled callback) |
Account
Account Information
Parameter | Type | Meaning |
---|---|---|
name | string | Customer Name |
account | string | Account |
branchNo | string | Branch Number |
accountType | string | Account Type : stock 、 futopt |
Constants ( Corresponding Values for Returned Fields )
BSAction
Buy / Sell Type
Name | Meaning |
---|---|
Buy | Buy |
Sell | Sell |
MarketType
Trading Session Type
Name | Meaning |
---|---|
Common | Regular Session |
Fixing | Fixing Session |
IntradayOdd | Intraday Odd Lot |
Odd | Odd |
Emg | Emerging Stock Market |
EmgOdd | Emerging Stock Market ( Share Unit) |
When using different MarketTypes, the corresponding units and ranges represented by Quantity may also vary. Details are as follows
Name | Quantity Unit | Quantity Ranges |
---|---|---|
Common | Thousand Shares | 1000 ~ 499000 |
Fixing | Thousand Shares | 1000 ~ 499000 |
IntradayOdd | Share | 1 ~ 999 |
Odd | Share | 1 ~ 999 |
Emg | Thousand Shares | 1000 ~ 499000 |
EmgOdd | Share | 1 ~ 999 |
When using different MarketTypes, the available PriceType and TimeInForce as below.
MarketType | Available PriceType | Available TimeInForce |
---|---|---|
Common | Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference | ROD 、 IOC 、 FOK |
Fixing | Reference | ROD |
IntradayOdd | Limit 、 LimitUp 、 LimitDown 、 Reference | ROD |
Odd | Limit 、 LimitUp 、 LimitDown 、 Reference | ROD |
Emg | Limit | ROD |
EmgOdd | Limit | ROD |
PriceType
Price Type
Name | Meaning |
---|---|
Limit | Limit |
LimitUp | Limit Up |
LimitDown | Limit Down |
Market | Market |
Reference | Reference Price (Fixing Price at Fixing Session) |
TimeInForce
Time In Force
Name | Meaning |
---|---|
ROD | Rest of Day |
FOK | Fill-or-Kill |
IOC | Immediate-or-Cancel |
OrderType
Order Type
Name | Meaning |
---|---|
Stock | Common Stock |
Margin | Margin |
Short | Short sale |
DayTrade | DayTrade |
SBL | Security Lending |
functionType
Function Type
Name | Value |
---|---|
New Order | 0 |
New Order Executed | 10 |
Change Price | 15 |
Change Quantity | 20 |
Cancel Order | 30 |
Fully Filled (for OrderResult details) | 50 |
Order Failed | 90 |
market
Market Category
Name | Value |
---|---|
Listed stocks | TAIEX |
Over-the-Counter (OTC) stocks | TAISDAQ |
Emerging Stock | TAIEMG |
status
Order Status
Name | Value |
---|---|
Reservation | 0 |
Sending to the system backend | 4 (Using GetOrderResult to retrieve the latest status) |
Processing by the backend | 8 (Using GetOrderResult to retrieve the latest status) |
Timeout | 9 (Please wait a moment and use GetOrderResult to retrieve the latest status ; or contact your broker agent) |
Active order | 10 |
Canceled | 30 |
Partially filled, others canceled | 40 |
Fully filled | 50 |
Fail to modify order price | 19 |
Fail to modify order quantity | 29 |
Fail to cancel | 39 |
Order not valid | 90 |