Skip to main content

List of Enumerations

Class

Class

OrderObject

ParameterTypeMeaning
buy_sellBSActionBuy/Sell Type valid in BuySell
symbolstringSymbol
pricestringOrder Price (use None if priceType is not Limit)
quantityintOrder Quantity
market_typeMarketTypeTrading Session valid in CommonFixingIntradayOddOddEmgEmgOdd
price_typePriceTypePrice Type valid in LimitLimitUpLimitDownMarketReference
time_in_forceTimeInForceTime In Force valid in RODFOKIOC
order_typeOrderTypeOrder Type valid in StockMarginShortDayTradeSBL
user_def (optional)stringCustomer Field (Up to 10 characters, no special characters supported、Not applicable to Emg)
caution

The units and ranges for 'quantity' vary for different MarketTypes. Please refer to the market_type description for details

caution

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

caution

When directly short selling common stocks, order_type should be DayTrade, buy_sell is Sell, and market_type is Common

OrderResult

OrderResult; You can use get_order_result(accounts) to get data.

ParameterTypeMeaning
function_typeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringTransaction Date
seq_nostringOrder Serial Number
branch_nostringBranch Number
accountstringAccount
order_nostringOrder Number
asset_typeintAsset Type : 0 Stock
marketstringMarket Type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG EMG
market_typeMarketTypeTrading Session Type : CommonFixingIntradayOddOddEmgEmgOdd
stock_nostringSymbol
buy_sellBSActionBuy/Sell Type : BuySell
price_typePriceTypeOriginal Order Price Type : LimitLimitUpLimitDownMarketReference
pricefloatOrder Price
quantityintOriginal Order Quantity
time_in_forceTimeInForceTime In Force : ROD FOKIOC
order_typeOrderTypeOrder Type : StockMarginShortDayTradeSBL
is_pre_orderboolReservation Order Flag
statusintOrder 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
after_price_typePriceTypeValid Order Price Type : LimitLimitUpLimitDownMarketReference
after_pricefloatValid Order Price
unitintTrading Unit
after_qtyintValid Order Quantity (filled quantity included)
filled_qtyintFilled Quantity
filled_moneyintFilled Value
before_qtyintBefore the Quantity Modification
before_pricefloatBefore the Price Modification
user_defstringCustom Fields
last_timestringLast Modification Time (see below for the format)
error_messagestringError Message
detailslistOrder Process (Return value when query order_result_detail or order_history )
>> function_typeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 50 Fully Filled 、 90 Failed
>> modified_timestringOrder Modified Time (see below for the format)
>> before_qtyintOriginal Order Quantity
>> after_qtyintValid Order Quantity (filled quantity included)
>> before_pricefloatOriginal Order Price
>> after_pricefloatValid Order Price
>> filled_moneyfloatFilled Value
>> statusintOrder Status
>> err_msgstringError Message
Time Format

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.

ParameterTypeMeaning
function_typeintFunction Type : 0 New Order、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringDate
branch_nostringBranch Number
accountstringAccount
batch_seq_nostringBatch Serial Number

ModifyPriceObj

Modified Price Object

ParameterTypeMeaning
OrderResultObjectOrderResult
pricestringThe price after modification
Price_typePriceTypeThe price type after modification : LimitLimitUpLimitDownMarketReference

ModifyQuantityObj

Modified Quantity Object

ParameterTypeMeaning
OrderResultObjectOrderResult
quantityintThe quantity after modification

FilledData

Filled Data Object

ParameterTypeMeaning
datestringFilled Date
branch_nostringBranch Number
accountstringAccount
seq_nostringOrder Serial Number (only display on filled callback)
order_nostringOrder Number
stock_nostringSymbol
buy_sellBSActionBuy/Sell Type : BuySell
order_typeOrderTypeOrder Type : StockMarginShortDayTradeSBL
filled_nostringFilled Serial Number
filled_avg_pricefloatFilled Average Price
filled_qtyintFilled Share
filled_pricefloatFilled Price
filled_timestringFilled Time
user_defstringCustom Fields (only display on filled callback)

Account

Account Information

ParameterTypeMeaning
namestringCustomer Name
accountstringAccount
branch_nostringBranch Number
account_typestringAccount Type : stockfutopt

Constants ( Corresponding Values for Returned Fields )

BSAction

Buy / Sell Type

NameMeaning
BuyBuy
SellSell

MarketType

Trading Session Type

NameMeaning
CommonRegular Session
FixingFixing Session
IntradayOddIntraday Odd Lot
OddOdd
EmgEmerging Stock Market
EmgOddEmerging Stock Market (share Unit )

When using different MarketTypes, the corresponding units and ranges represented by Quantity may also vary. Details are as follows

NameQuantity UnitQuantity Ranges
CommonThousand Shares1000 ~ 499000
FixingThousand Shares1000 ~ 499000
IntradayOddShare1 ~ 999
OddShare1 ~ 999
EmgShare1 ~ 999 ; 1000 ~ 499000 (Over 1000 ,minimum tick size is 1000)

When using different MarketTypes, the available PriceType and TimeInForce as below.

MarketTypeAvailable PriceTypeAvailable TimeInForce
CommonLimit 、 LimitUp 、 LimitDown 、 Market 、 ReferenceROD 、 IOC 、 FOK
FixingReferenceROD
IntradayOddLimit 、 LimitUp 、 LimitDown 、 ReferenceROD
OddLimit 、 LimitUp 、 LimitDown 、 ReferenceROD
EmgLimitROD
EmgOddLimitROD

PriceType

Price Type

NameMeaning
LimitLimit
LimitUpLimit Up
LimitDownLimit Down
MarketMarket
ReferenceReference Price (Fixing Price at Fixing Session)

TimeInForce

Time In Force

NameMeaning
RODRest of Day
FOKFill-or-Kill
IOCImmediate-or-Cancel

OrderType

Order Type

NameMeaning
StockCommon Stock
MarginMargin
ShortShort sale
DayTradeDayTrade
SBLSecurity Lending

function_type

Function Type

NameValue
New Order0
New Order Executed10
Change Price15
Change Quantity20
Cancel Order30
Fully Filled (for OrderResult details)50
Order Failed90

market

Market Category

NameValue
Listed stocksTAIEX
Over-the-Counter (OTC) stocksTAISDAQ
Emerging StockTAIEMG

status

Order Status

NameValue
Reservation0
Sending to the system backend4 (Using GetOrderResult to retrieve the latest status)
Processing by the backend8 (Using GetOrderResult to retrieve the latest status)
Timeout9 (Please wait a moment and use GetOrderResult to retrieve the latest status ; or contact your broker agent)
Active order10
Canceled30
Partially filled, others canceled40
Fully filled50
Fail to modify order price19
Fail to modify order quantity29
Fail to cancel39
Order not valid90