List of Enumerations
Class
Class
OrderObject
| Parameter | Type | Meaning |
|---|---|---|
| buy_sell | BSAction | Buy/Sell Type valid in Buy, Sell |
| symbol | string | Symbol |
| price | string | Order Price (use None if priceType is not Limit) |
| quantity | int | Order Quantity |
| market_type | MarketType | Trading Session valid in Common,Fixing,IntradayOdd,Odd,Emg, EmgOdd |
| price_type | PriceType | Price Type valid in Limit,LimitUp,LimitDown,Market,Reference |
| time_in_force | TimeInForce | Time In Force valid in ROD,FOK,IOC |
| order_type | OrderType | Order Type valid in Stock,Margin,Short,DayTrade, SBL |
| user_def (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 market_type description for details
When market_type 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 None
When spot short selling common stocks, orderType should be DayTrade, buySell is Sell, and marketType is Commonn
(For other spot day-trading operations, orderType = Stock)
OrderResult
OrderResult; You can use get_order_result(accounts) to get data.
| Parameter | Type | Meaning |
|---|---|---|
| function_type | int | Function Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed |
| date | string | Transaction Date |
| seq_no | string | Order Serial Number |
| branch_no | string | Branch Number |
| account | string | Account |
| order_no | string | Order Number |
| asset_type | int | Asset Type : 0 Stock |
| market | string | Market Type : TAIEX Listed, TAISDAQ OTC, TAIEMG EMG |
| market_type | MarketType | Trading Session Type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd |
| stock_no | string | Symbol |
| buy_sell | BSAction | Buy/Sell Type : Buy, Sell |
| price_type | PriceType | Original Order Price Type : Limit, LimitUp, LimitDown, Market, Reference |
| price | float | Order Price |
| quantity | int | Original Order Quantity |
| time_in_force | TimeInforce | Time In Force : ROD FOK, IOC |
| order_type | OrderType | Order Type : Stock, Margin, Short, DayTrade, SBL |
| is_pre_order | bool | Reservation Order Flag |
| status | int | Order Status, for details please refer to STATUS |
| after_price_type | PriceType | Valid Order Price Type : Limit, LimitUp, LimitDown, Market, Reference |
| after_price | float | Valid Order Price |
| unit | int | Trading Unit |
| after_qty | int | Valid Order Quantity (filled quantity included) |
| filled_qty | int | Filled Quantity |
| filled_money | int | Filled Value |
| before_qty | int | Before the Quantity Modification |
| before_price | float | Before the Price Modification |
| user_def | string | Custom Fields |
| last_time | string | Last Modification Time (see below for the format) |
| error_message | string | Error Message |
| details | list | Order Process (Return value when query order_result_detail or order_history ) |
| >> function_type | int | Function Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 50 Fully Filled, 90 Failed |
| >> modified_time | string | Order Modified Time (see below for the format) |
| >> before_qty | int | Original Order Quantity |
| >> after_qty | int | Valid Order Quantity (filled quantity included) |
| >> before_price | float | Original Order Price |
| >> after_price | float | Valid Order Price |
| >> filled_money | float | Filled Value |
| >> status | int | Order Status |
| >> err_msg | string | Error Message |
last_time and modified_time 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 |
|---|---|---|
| function_type | int | Function Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed |
| date | string | Date |
| branch_no | string | Branch Number |
| account | string | Account |
| batch_seq_no | string | Batch Serial Number |
ModifyPriceObj
Modified Price Object
| Parameter | Type | Meaning |
|---|---|---|
| order_result | Object | OrderResult |
| price | string | The price after modification |
| price_type | PriceType | The price type after modification : Limit,LimitUp,LimitDown,Market,Reference |
The Co-lo version has enabled the use of PriceType.
ModifyQuantityObj
Modified Quantity Object
| Parameter | Type | Meaning |
|---|---|---|
| order_result | Object | OrderResult |
| quantity | int | The quantity after modification |
FilledData
Filled Data Object
| Parameter | Type | Meaning |
|---|---|---|
| date | string | Filled Date |
| branch_no | string | Branch Number |
| account | string | Account |
| seq_no | string | Order Serial Number (only display on filled callback) |
| order_no | string | Order Number |
| stock_no | string | Symbol |
| buy_sell | BSAction | Buy/Sell Type : Buy, Sell |
| order_type | OrderType | Order Type : Stock, Margin, Short, DayTrade, SBL |
| filled_no | string | Filled Serial Number |
| filled_avg_price | float | Filled Average Price |
| filled_qty | int | Filled Share |
| filled_price | float | Filled Price |
| filled_time | string | Filled Time |
| user_def | string | Custom Fields (only display on filled callback) |
Account
Account Information
| Parameter | Type | Meaning |
|---|---|---|
| name | string | Customer Name |
| account | string | Account |
| branch_no | string | Branch Number |
| account_type | string | Account Type : stock, futopt |
Constants (Corresponding Returned Values)
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 | Margin Short Selling |
| DayTrade | Spot Short Selling (day trading) |
| SBL | Short Selling (with security borrowed) |
StockType
Stock Category
| Name | Meaning |
|---|---|
| Stock | Common Stock |
| CovertBond | Convertible Bond |
| EtfAndEtn | ETF and ETN |
function_type
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 |
| Order not valid | 90 |
| Flags for order result details | 14 - ACK of modifying price,24 - ACK of modifying quantity,34 - ACK of canceling |
| Modify price successfully (for history order inquiry) | 15 |
| Modify quantity successfully (for history order inquiry) | 20 |
| Fail to modify order price (for callback) | 19 |
| Fail to modify order quantity (for callback) | 29 |
| Fail to cancel (for callback) | 39 |