List of Enumerations
Classes
Class
OrderObject
| Parameter | Type | Meaning |
|---|---|---|
| buy_sell | BSAction | Side Options: BUY, SELL |
| symbol | string | Stock Symbol |
| price | string | Order Price (Enter std::nullopt if not using LIMIT price) |
| quantity | int | Order Quantity |
| market_type | MarketType | Market Type Options: COMMON (Round Lot), FIXING (Fixed Price), INTRADAY_ODD (Intraday Odd Lot), ODD (Post-market Odd Lot), EMG (Emerging Market), EMG_ODD (Emerging Odd Lot) |
| price_type | PriceType | Price Flag Options: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE |
| time_in_force | TimeInForce | Time In Force Options: ROD, FOK, IOC |
| order_type | OrderType | Order Type Options: STOCK (Spot), MARGIN (Margin Buy), SHORT (Short Sell), DAY_TRADE (Day Trade - Sell First), SBL (Securities Borrowing) |
| user_def (optional) | string | User Defined Field (Max 10 characters, no special characters or Chinese, not applicable for Emerging Markets) |
The unit and range for quantity vary depending on the MarketType. Please refer to the Market Type section.
When MarketType is MarketType.COMMON, MarketType.ODD, or MarketType.INTRADAY_ODD, and priceType is PriceType.LIMIT, the price field must be filled. In other cases, the price field should be std::nullopt.
For Day Trade Sell First: order_type must be DAY_TRADE, buy_sell must be SELL, and market_type must be COMMON.
OrderResult
Order list, retrieved via get_order_result(accounts).
| Parameter | Type | Description |
|---|---|---|
| function_type | int | Function Type: 0 New Order, 10 New Order Execution, 15 Modify Price, 20 Modify Qty, 30 Cancel Order, 90 Failed |
| date | string | Trade Date |
| seq_no | string | Order Sequence Number |
| branch_no | string | Branch Code |
| account | string | Account Number |
| order_no | string | Order Book Number |
| asset_type | int | Asset Type: 0 Securities |
| market | string | Market Type: TAIEX (Listed), TAISDAQ (OTC), TAIEMG (Emerging) |
| market_type | MarketType | Trading Unit: COMMON, FIXING, INTRADAY_ODD, ODD, EMG, EMG_ODD |
| stock_no | string | Stock Symbol |
| buy_sell | BSAction | Side: BUY, SELL |
| price_type | PriceType | Original Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE |
| price | double | Price |
| quantity | int | Original Order Quantity |
| time_in_force | TimeInforce | Time In Force: ROD, FOK, IOC |
| order_type | OrderType | Order Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL |
| is_pre_order | bool | Is Pre-order |
| status | int | Order Status: 0 Pre-order, 4 Sending to Backend, 9 Timeout, 10 Success, 30 Cancelled (Unfilled), 40 Partially Filled (Remainder Cancelled), 50 Fully Filled, 90 Failed |
| after_price_type | PriceType | Effective Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE |
| after_price | double | Effective Price |
| unit | int | Unit Count |
| after_qty | int | Effective Quantity (Includes filled portion) |
| filled_qty | int | Filled Quantity |
| filled_money | int | Filled Amount |
| before_qty | int | Valid Qty Before Modification |
| before_price | double | Valid Price Before Modification |
| user_def | string | Custom Field |
| last_time | string | Last Modified Time (See format below) |
| error_message | string | Error Message |
| details | list | Order History (Populated when querying order_result_detail or order_history) |
| >> function_type | int | Function Type: 0 New, 10 Exec, 15 Mod Price, 20 Mod Qty, 30 Cancel, 50 Filled, 90 Fail |
| >> modified_time | string | Modification Time (See format below) |
| >> before_qty | int | Original Order Qty |
| >> after_qty | int | Effective Order Qty (Includes filled) |
| >> before_price | double | Original Order Price |
| >> after_price | double | Effective Order Price |
| >> filled_money | double | Filled Amount |
| >> status | int | Order Status |
| >> err_msg | string | Error Message |
Time format for last_time and modified_time: HH:MM:SS.fff or HH:MM:SS (omitted when .fff = .000).
BatchResult
Batch order list, retrieved via BatchOrderLists(account).
| Parameter | Type | Meaning |
|---|---|---|
| function_type | int | Function Type: 0 New, 10 Exec, 15 Mod Price, 20 Mod Qty, 30 Cancel, 90 Fail |
| date | string | Trade Date |
| branch_no | string | Branch Code |
| account | string | Account Number |
| batch_seq_no | string | Batch Sequence Number |
ModifyPriceObj
Object for modifying price.
| Parameter | Type | Meaning |
|---|---|---|
| order_result | Object | Order List |
| price | string | New Price |
| price_type | PriceType | New Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE |
ModifyQuantityObj
Object for modifying quantity.
| Parameter | Type | Meaning |
|---|---|---|
| order_result | Object | Order List |
| quantity | int | New Quantity |
FilledData
Trade execution report object.
| Parameter | Type | Description |
|---|---|---|
| date | string | Date |
| branch_no | string | Branch Code |
| account | string | Account Number |
| seq_no | string | Order Sequence Number (Only returned for active push reports) |
| order_no | string | Order Book Number |
| stock_no | string | Stock Symbol |
| buy_sell | BSAction | Side: BUY, SELL |
| order_type | OrderType | Order Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL |
| filled_no | string | Execution Sequence Number |
| filled_avg_price | double | Average Filled Price |
| filled_qty | int | Filled Quantity |
| filled_price | double | Filled Price |
| filled_time | string | Filled Time |
| user_def | string | User Defined Field (Only returned for active push reports) |
Account
Account Information
| Parameter | Type | Meaning |
|---|---|---|
| name | string | Client Name |
| account | string | Account Number |
| branch_no | string | Branch Code |
| account_type | string | Account Type: stock (Securities), futopt (Futures/Options) |
Constants (Field Value Mapping)
BSAction
Buy/Sell Action
| Name | Value | Meaning |
|---|---|---|
| BUY | 1 | Buy |
| SELL | 2 | Sell |
| UN_SUPPORTED | 3 | Unsupported Type |
| UN_DEFINED | 4 | Undefined Type |
MarketType
Market Type (Trading Unit)
| Name | Value | Meaning |
|---|---|---|
| COMMON | 1 | Round Lot |
| FIXING | 2 | Fixed Price |
| ODD | 3 | Post-market Odd Lot |
| INTRADAY_ODD | 4 | Intraday Odd Lot |
| EMG | 5 | Emerging Market |
| EMG_ODD | 6 | Emerging Odd Lot |
| UN_SUPPORTED | 7 | Unsupported Type |
| UN_DEFINED | 8 | Undefined Type |
The unit and range for Quantity differ when using different MarketTypes, as shown below:
| Name | Quantity Unit | Quantity Ranges |
|---|---|---|
| COMMON | 1000 Shares | 1000 ~ 499000 |
| FIXING | 1000 Shares | 1000 ~ 499000 |
| INTRADAY_ODD | Shares | 1 ~ 999 |
| ODD | Shares | 1 ~ 999 |
| EMG | 1000 Shares | 1000 ~ 499000 |
| EMG_ODD | Shares | 1 ~ 999 |
Available PriceType and TimeInForce vary by MarketType, as shown below:
| MarketType | Available PriceType | Available TimeInForce |
|---|---|---|
| COMMON | LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE | ROD, IOC, FOK |
| FIXING | REFERENCE | ROD |
| INTRADAY_ODD | LIMIT, LIMIT_UP, LIMIT_DOWN, REFERENCE | ROD |
| ODD | LIMIT, LIMIT_UP, LIMIT_DOWN, REFERENCE | ROD |
| EMG | LIMIT | ROD |
| EMG_ODD | LIMIT | ROD |
PriceType
Price Type
| Name | Value | Meaning |
|---|---|---|
| LIMIT | 1 | Limit Price |
| LIMIT_UP | 2 | Limit Up (Ceiling) |
| LIMIT_DOWN | 3 | Limit Down (Floor) |
| MARKET | 4 | Market Price |
| REFERENCE | 5 | Reference Price (Fixed Price during fixing) |
| UN_SUPPORTED | 6 | Unsupported Type |
| UN_DEFINED | 7 | Undefined Type |
TimeInForce
Time In Force Condition
| Name | Value | Meaning |
|---|---|---|
| ROD | 1 | Rest of Day |
| FOK | 2 | Fill-or-Kill |
| IOC | 3 | Immediate-or-Cancel |
| UN_SUPPORTED | 4 | Unsupported Type |
| UN_DEFINED | 5 | Undefined Type |
OrderType
Order Type
| Name | Value | Meaning |
|---|---|---|
| STOCK | 1 | Spot (Cash) |
| MARGIN | 2 | Margin Buy |
| SHORT | 3 | Short Sell |
| SBL | 4 | Securities Borrowing |
| DAY_TRADE | 5 | Day Trade |
| UN_SUPPORTED | 6 | Unsupported Type |
| UN_DEFINED | 7 | Undefined Type |
StockType
Stock Category
| Name | Value | Meaning |
|---|---|---|
| Stock | 0 | Stock |
| ConvertBond | 1 | Convertible Bond |
| Warrent | 2 | Warrant |
| ETF_and_ETN | 3 | ETF & ETN |
| Bond_with_Warrent | 4 | Depositary Receipt with Warrant |
| ForeignStock | 5 | Foreign Stock |
| CGS | 6 | Central Government Securities |
function_type
Function Category
| Name | Value |
|---|---|
| New Order | 0 |
| New Order Exec | 10 |
| Modify Price | 15 |
| Modify Qty | 20 |
| Cancel Order | 30 |
| Fully Filled (for History) | 50 |
| Failed | 90 |
market
Market
| Name | Value |
|---|---|
| Listed | TAIEX |
| OTC | TAISDAQ |
| Emerging | TAIEMG |
status
Order Status
| Name | Value |
|---|---|
| Pre-order | 0 |
| Sending to Backend | 4 (Use GetOrderResult to query status) |
| Backend Transmitting | 8 (Use GetOrderResult to query status) |
| Connection Timeout | 9 (Please use GetOrderResult later or contact agent) |
| Success | 10 |
| Cancelled (Unfilled) | 30 |
| Partially Filled, Remainder Cancelled | 40 |
| Fully Filled | 50 |
| Modify Price Failed | 19 |
| Modify Qty Failed | 29 |
| Cancel Failed | 39 |
| Failed | 90 |