Skip to main content

List of Enumerations

Class

Class

OrderObject

ParameterTypeMeaning
buySellBSActionBuy/Sell Type valid in BuySell
symbolstringSymbol
pricestringOrder Price (use null if priceType is not Limit)
quantityintOrder Quantity
marketTypeMarketTypeTrading Session valid in CommonFixingIntradayOddOddEmgEmgOdd
priceTypePriceTypePrice Type valid in LimitLimitUpLimitDownMarketReference
timeInForceTimeInForceTime In Force valid in RODFOKIOC
orderTypeOrderTypeOrder Type valid in StockMarginShortDayTradeSBL
userDef (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 MarketType description for details

caution

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

caution

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.

ParameterTypeMeaning
functionTypeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringTransaction date
seqNostringOrder serial number
branchNostringBranch number
accountstringAccount
orderNostringOrder number
assetTypenumberAsset type : 0 Stock
marketstringMarket type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG EMG
marketTypejs:string / ts:MarketTypeTrading session type : CommonFixingIntradayOddOddEmgEmgOdd
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : BuySell
priceTypejs:string / ts:PriceTypeOriginal order price type : LimitLimitUpLimitDownMarketReference
pricenumberOrder Price
quantitynumberOriginal order quantity
timeInForcejs:string / ts:TimeInForceTime In Force RODFOKIOC
orderTypejs:string / ts:OrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL
isPreOrderboolReservation Flag
statusnumberOrder 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
afterPriceTypejs:string / ts:OrderTypeValid order price type : LimitLimitUpLimitDownMarketReference
afterPricenumberValid order price
unitnumberTrading Unit
afterQtynumberValid Order Quantity (filled quantity included)
filledQtynumberFilled Quantity
filledMoneynumberFilled Value
beforeQtynumberBefore the Quantity Modification
beforePricenumberBefore the Price Modification
userDefstringCustom Fields
lastTimestringLast Modification Time (see below for the format)
errorMessagestringError Message
detailslistOrder Process (The following fields will only appear in the query details)
>> functionTypenumberFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 50 Fully Filled 、 90 Failed
>> modifiedTimestringOrder Modified Time (see below for the format)
>> beforeQtynumberOriginal Order Quantity
>> afterQtynumberValid Order Quantity (filled quantity included)
>> beforePricenumberOriginal Order Price
>> afterPricenumberValid Order Price
>> filledMoneynumberFilled Value
>> statusnumberOrder Status
>> errMsgstringError Message
Time Format

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.

ParameterTypeMeaning
functionTypeintFunction Type : 0 New Order、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringDate
branchNostringBranch Aumber
accountstringAccount
batchSeqNostringBatch Serial Number

ModifyPriceObj

Modified Price Object

ParameterTypeDefault ValueMeaning
OrderResultObject-OrderResult
pricenumber-The price after modification
PriceTypePriceType-The price type after modification : LimitLimitUpLimitDownMarketReference

ModifyQuantityObj

Modified Quantity Object

ParameterTypeDefault ValueMeaning
OrderResultObject-OrderResult
quantityint-The quantity after modification

FilledData

Filled Data Object

ParameterTypeMeaning
datestringFilled Date
branchNostringBranch Number
accountstringAccount
seqNostringOrder serial number (only display on filled callback)
orderNostringOrder Number
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : BuySell
orderTypejs:string / ts:OrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL
filledNostringFilled Serial Number
filledAvgPricenumberFilled Average Price
filledQtynumberFilled Share
filledPricenumberFilled Price
filledTimestringFilled Time
userDefstringCustom Fields (only display on filled callback)

Account

Account Information

ParameterTypeMeaning
namestringCustomer Name
accountstringAccount
branchNostringBranch Number
accountTypestringAccount 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
EmgThousand Shares1000 ~ 499000
EmgOddShare1 ~ 999

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

functionType

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