Skip to main content

List of Enumerations

Classes

Class

OrderObject

ParameterTypeMeaning
buy_sellBSActionSide Options: BUY, SELL
symbolstringStock Symbol
pricestringOrder Price (Enter std::nullopt if not using LIMIT price)
quantityintOrder Quantity
market_typeMarketTypeMarket 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_typePriceTypePrice Flag Options: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE
time_in_forceTimeInForceTime In Force Options: ROD, FOK, IOC
order_typeOrderTypeOrder Type Options: STOCK (Spot), MARGIN (Margin Buy), SHORT (Short Sell), DAY_TRADE (Day Trade - Sell First), SBL (Securities Borrowing)
user_def (optional)stringUser Defined Field (Max 10 characters, no special characters or Chinese, not applicable for Emerging Markets)
caution

The unit and range for quantity vary depending on the MarketType. Please refer to the Market Type section.

caution

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.

caution

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).

ParameterTypeDescription
function_typeintFunction Type: 0 New Order, 10 New Order Execution, 15 Modify Price, 20 Modify Qty, 30 Cancel Order, 90 Failed
datestringTrade Date
seq_nostringOrder Sequence Number
branch_nostringBranch Code
accountstringAccount Number
order_nostringOrder Book Number
asset_typeintAsset Type: 0 Securities
marketstringMarket Type: TAIEX (Listed), TAISDAQ (OTC), TAIEMG (Emerging)
market_typeMarketTypeTrading Unit: COMMON, FIXING, INTRADAY_ODD, ODD, EMG, EMG_ODD
stock_nostringStock Symbol
buy_sellBSActionSide: BUY, SELL
price_typePriceTypeOriginal Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE
pricedoublePrice
quantityintOriginal Order Quantity
time_in_forceTimeInforceTime In Force: ROD, FOK, IOC
order_typeOrderTypeOrder Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL
is_pre_orderboolIs Pre-order
statusintOrder 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_typePriceTypeEffective Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE
after_pricedoubleEffective Price
unitintUnit Count
after_qtyintEffective Quantity (Includes filled portion)
filled_qtyintFilled Quantity
filled_moneyintFilled Amount
before_qtyintValid Qty Before Modification
before_pricedoubleValid Price Before Modification
user_defstringCustom Field
last_timestringLast Modified Time (See format below)
error_messagestringError Message
detailslistOrder History (Populated when querying order_result_detail or order_history)
>> function_typeintFunction Type: 0 New, 10 Exec, 15 Mod Price, 20 Mod Qty, 30 Cancel, 50 Filled, 90 Fail
>> modified_timestringModification Time (See format below)
>> before_qtyintOriginal Order Qty
>> after_qtyintEffective Order Qty (Includes filled)
>> before_pricedoubleOriginal Order Price
>> after_pricedoubleEffective Order Price
>> filled_moneydoubleFilled Amount
>> statusintOrder Status
>> err_msgstringError Message
Time Format Description

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).

ParameterTypeMeaning
function_typeintFunction Type: 0 New, 10 Exec, 15 Mod Price, 20 Mod Qty, 30 Cancel, 90 Fail
datestringTrade Date
branch_nostringBranch Code
accountstringAccount Number
batch_seq_nostringBatch Sequence Number

ModifyPriceObj

Object for modifying price.

ParameterTypeMeaning
order_resultObjectOrder List
pricestringNew Price
price_typePriceTypeNew Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE

ModifyQuantityObj

Object for modifying quantity.

ParameterTypeMeaning
order_resultObjectOrder List
quantityintNew Quantity

FilledData

Trade execution report object.

ParameterTypeDescription
datestringDate
branch_nostringBranch Code
accountstringAccount Number
seq_nostringOrder Sequence Number (Only returned for active push reports)
order_nostringOrder Book Number
stock_nostringStock Symbol
buy_sellBSActionSide: BUY, SELL
order_typeOrderTypeOrder Type: STOCK, MARGIN, SHORT, DAY_TRADE, SBL
filled_nostringExecution Sequence Number
filled_avg_pricedoubleAverage Filled Price
filled_qtyintFilled Quantity
filled_pricedoubleFilled Price
filled_timestringFilled Time
user_defstringUser Defined Field (Only returned for active push reports)

Account

Account Information

ParameterTypeMeaning
namestringClient Name
accountstringAccount Number
branch_nostringBranch Code
account_typestringAccount Type: stock (Securities), futopt (Futures/Options)

Constants (Field Value Mapping)

BSAction

Buy/Sell Action

NameValueMeaning
BUY1Buy
SELL2Sell
UN_SUPPORTED3Unsupported Type
UN_DEFINED4Undefined Type

MarketType

Market Type (Trading Unit)

NameValueMeaning
COMMON1Round Lot
FIXING2Fixed Price
ODD3Post-market Odd Lot
INTRADAY_ODD4Intraday Odd Lot
EMG5Emerging Market
EMG_ODD6Emerging Odd Lot
UN_SUPPORTED7Unsupported Type
UN_DEFINED8Undefined Type

The unit and range for Quantity differ when using different MarketTypes, as shown below:

NameQuantity UnitQuantity Ranges
COMMON1000 Shares1000 ~ 499000
FIXING1000 Shares1000 ~ 499000
INTRADAY_ODDShares1 ~ 999
ODDShares1 ~ 999
EMG1000 Shares1000 ~ 499000
EMG_ODDShares1 ~ 999

Available PriceType and TimeInForce vary by MarketType, as shown below:

MarketTypeAvailable PriceTypeAvailable TimeInForce
COMMONLIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCEROD, IOC, FOK
FIXINGREFERENCEROD
INTRADAY_ODDLIMIT, LIMIT_UP, LIMIT_DOWN, REFERENCEROD
ODDLIMIT, LIMIT_UP, LIMIT_DOWN, REFERENCEROD
EMGLIMITROD
EMG_ODDLIMITROD

PriceType

Price Type

NameValueMeaning
LIMIT1Limit Price
LIMIT_UP2Limit Up (Ceiling)
LIMIT_DOWN3Limit Down (Floor)
MARKET4Market Price
REFERENCE5Reference Price (Fixed Price during fixing)
UN_SUPPORTED6Unsupported Type
UN_DEFINED7Undefined Type

TimeInForce

Time In Force Condition

NameValueMeaning
ROD1Rest of Day
FOK2Fill-or-Kill
IOC3Immediate-or-Cancel
UN_SUPPORTED4Unsupported Type
UN_DEFINED5Undefined Type

OrderType

Order Type

NameValueMeaning
STOCK1Spot (Cash)
MARGIN2Margin Buy
SHORT3Short Sell
SBL4Securities Borrowing
DAY_TRADE5Day Trade
UN_SUPPORTED6Unsupported Type
UN_DEFINED7Undefined Type

StockType

Stock Category

NameValueMeaning
Stock0Stock
ConvertBond1Convertible Bond
Warrent2Warrant
ETF_and_ETN3ETF & ETN
Bond_with_Warrent4Depositary Receipt with Warrant
ForeignStock5Foreign Stock
CGS6Central Government Securities

function_type

Function Category

NameValue
New Order0
New Order Exec10
Modify Price15
Modify Qty20
Cancel Order30
Fully Filled (for History)50
Failed90

market

Market

NameValue
ListedTAIEX
OTCTAISDAQ
EmergingTAIEMG

status

Order Status

NameValue
Pre-order0
Sending to Backend4 (Use GetOrderResult to query status)
Backend Transmitting8 (Use GetOrderResult to query status)
Connection Timeout9 (Please use GetOrderResult later or contact agent)
Success10
Cancelled (Unfilled)30
Partially Filled, Remainder Cancelled40
Fully Filled50
Modify Price Failed19
Modify Qty Failed29
Cancel Failed39
Failed90