List of Enumerations
Class
Class
Order
| Parameter | Type | Meaning |
|---|---|---|
| BuySell | BsAction | Buy/Sell Optional parameters: BsActionBuy Buy, BsActionSell Sell |
| Symbol | string | Stock Symbol |
| Price | *string | Order Price (If not using PriceTypeLimit (Limit Price), pass nil) |
| Quantity | int64 | Order Quantity |
| MarketType | MarketType | Market Type Optional parameters: MarketTypeCommon Regular, MarketTypeFixing Fixing, MarketTypeIntradayOdd Intraday Odd Lot, MarketTypeOdd Post-market Odd Lot, MarketTypeEmg Emerging, MarketTypeEmgOdd Emerging Odd Lot |
| PriceType | PriceType | Price Flag Optional parameters: PriceTypeLimit Limit, PriceTypeLimitUp Limit Up, PriceTypeLimitDown Limit Down, PriceTypeMarket Market, PriceTypeReference Reference |
| TimeInForce | TimeInForce | Order Condition Optional parameters: TimeInForceRod, TimeInForceFok, TimeInForceIoc |
| OrderType | OrderType | Order Type Optional parameters: OrderTypeStock Common, OrderTypeMargin Margin, OrderTypeShort Short Sell, OrderTypeDayTrade Day Trade (for Day Trade Sell First), OrderTypeSbl SBL |
| UserDef | *string | User Defined Field (Max 10 characters, special characters and Chinese not supported. Not applicable for Emerging market) |
Different MarketType corresponds to different units and ranges for Quantity. Please refer to the Market Type description.
When MarketType is one of MarketTypeCommon, MarketTypeOdd, or MarketTypeIntradayOdd, and PriceType is PriceTypeLimit, the Price field must be filled; otherwise, the Price field should be nil.
For Day Trade Sell First operations: OrderType = OrderTypeDayTrade, BuySell must be BsActionSell, and MarketType must be MarketTypeCommon. (For other day trade entry/exit operations, orderType = OrderTypeStock)
OrderResult
Order List, retrieved via OrderResults(account).
| Parameter | Type | Description |
|---|---|---|
| FunctionType | *int64 | Function Type: 0 New Order, 10 Execute New Order, 15 Change Price, 20 Change Qty, 30 Cancel Order, 90 Fail |
| Date | *string | Transaction Date |
| SeqNo | *string | Order Sequence Number |
| BranchNo | *string | Branch Code |
| Account | *string | Account |
| OrderNo | *string | Order Number |
| AssetType | *int64 | Asset Type: 0 Securities |
| Market | *string | Market Type: TAIEX Listed Stocks, TAISDAQ OTC Stocks, TAIEMG Emerging Stocks |
| MarketType | MarketType | Market Type Category: MarketTypeCommon Regular, MarketTypeFixing Fixing, MarketTypeIntradayOdd Intraday Odd Lot, MarketTypeOdd Post-market Odd Lot, MarketTypeEmg Emerging, MarketTypeEmgOdd Emerging Odd Lot |
| StockNo | *string | Stock Symbol |
| BuySell | *BsAction | Buy/Sell Action: BsActionBuy Buy, BsActionSell Sell |
| PriceType | *PriceType | Original Order Price Type: PriceTypeLimit Limit, PriceTypeLimitUp Limit Up, PriceTypeLimitDown Limit Down, PriceTypeMarket Market, PriceTypeReference Reference |
| Price | *string | Price |
| Quantity | *int64 | Original Order Quantity |
| TimeInForce | *TimeInForce | Order Condition: TimeInForceRod ROD, TimeInForceFok FOK, TimeInForceIoc IOC |
| OrderType | *OrderType | Order Type: OrderTypeStock Common, OrderTypeMargin Margin, OrderTypeShort Short Sell, OrderTypeDayTrade Day Trade, OrderTypeSbl SBL |
| IsPreOrder | *bool | Is Pre-order |
| Status | *int64 | Order Status: 0 Pre-order, 4 Sending to Backend, 9 Connection Timeout, 10 Order Success, 30 Cancelled Unfilled, 40 Partial Fill/Rest Cancelled, 50 Fully Filled, 90 Fail |
| AfterPriceType | *PriceType | Effective Price Type: PriceTypeLimit Limit, PriceTypeLimitUp Limit Up, PriceTypeLimitDown Limit Down, PriceTypeMarket Market, PriceTypeReference Reference |
| AfterPrice | *string | Effective Order Price |
| Unit | *int64 | Unit |
| AfterQty | *int64 | Effective Order Quantity (including filled part) |
| FilledQty | *int64 | Filled Quantity |
| FilledMoney | *int64 | Filled Amount |
| BeforeQty | *int64 | Effective Qty Before Change |
| BeforePrice | *string | Effective Price Before Change |
| UserDef | *string | User Defined Field |
| LastTime | *string | Last Modified Time (Format: HH:MM:SS.fff or HH:MM:SS) |
| ErrorMessage | *string | Error Message |
| Details | *[]OrderDetail | Order History (Value exists only when querying OrderResultsDetail or OrderHistory) |
| >> FunctionType | *int64 | Function Type: 0 New Order, 10 Execute New Order, 15 Change Price, 20 Change Qty, 30 Cancel Order, 50 Fully Filled, 90 Fail |
| >> ModifiedTime | *string | Modified Time (Format: HH:MM:SS.fff or HH:MM:SS) |
| >> BeforeQty | *int64 | Original Order Quantity |
| >> AfterQty | *int64 | Effective Order Quantity (including filled part) |
| >> BeforePrice | *string | Original Order Price |
| >> AfterPrice | *string | Effective Order Price |
| >> FilledMoney | *string | Filled Amount |
| >> Status | *int64 | Order Status |
| >> ErrMsg | *string | Error Message |
last_time and modified_time format: HH:MM:SS.fff or HH:MM:SS (omitted when .fff = .000)
BatchResult
Batch Order List, retrieved via BatchOrderLists(account).
| Parameter | Type | Meaning |
|---|---|---|
| functionType | int | Function Type: 0 New Order, 10 Execute New Order, 15 Change Price, 20 Change Qty, 30 Cancel Order, 90 Fail |
| date | string | Transaction Date |
| branchNo | string | Branch Code |
| account | string | Account |
| batchSeqNo | string | Batch Order Sequence Number |
ModifyPriceObj
Modify Price Object
| Parameter | Type | Meaning |
|---|---|---|
| OrderResult | OrderResult | Order List |
| Price | *string | Price after modification |
| PriceType | *PriceType | Price Type after modification: PriceTypeLimit Limit, PriceTypeLimitUp Limit Up, PriceTypeLimitDown Limit Down, PriceTypeMarket Market, PriceTypeReference Reference |
ModifyQuantityObj
Modify Quantity Object
| Parameter | Type | Meaning |
|---|---|---|
| OrderResult | OrderResult | Order List |
| Quantity | int64 | Quantity after modification |
FilledData
Filled Report Object
| Parameter | Type | Meaning |
|---|---|---|
| Date | *string | Date |
| BranchNo | *string | Branch Code |
| Account | *string | Account |
| SeqNo | *string | Order Sequence Number (Only returned for active reports) |
| OrderNo | *string | Order Number |
| StockNo | *string | Stock Symbol |
| BuySell | *BsAction | Buy/Sell Action: BsActionBuy Buy, BsActionSell Sell |
| OrderType | *OrderType | Order Type: OrderTypeStock Common, OrderTypeMargin Margin, OrderTypeShort Short Sell, OrderTypeDayTrade Day Trade, OrderTypeSbl SBL |
| FilledNo | *string | Fill Sequence Number |
| FilledAvgPrice | *string | Filled Average Price |
| FilledQty | *int64 | Filled Quantity |
| FilledPrice | *string | Filled Unit Price |
| FilledTime | *string | Filled Time |
| UserDef | *string | User Defined Field (Only returned for active reports) |
Account
Account Information
| Parameter | Type | Meaning |
|---|---|---|
| Name | string | Client Name |
| Account | string | Account |
| BranchNo | string | Branch Code |
| AccountType | string | Account Type, returns stock for Securities, futopt for Futures/Options |
Constants (Enum Values)
BsAction
Buy/Sell Action
| Name | Value | Meaning |
|---|---|---|
| BsActionBuy | 1 | Buy |
| BsActionSell | 2 | Sell |
MarketType
Market Type
| Name | Value | Meaning |
|---|---|---|
| MarketTypeCommon | 1 | Regular (Common) |
| MarketTypeFixing | 2 | Fixing |
| MarketTypeOdd | 3 | Post-market Odd Lot |
| MarketTypeIntradayOdd | 4 | Intraday Odd Lot |
| MarketTypeEmg | 5 | Emerging |
| MarketTypeEmgOdd | 6 | Emerging Odd Lot |
When using different MarketType, the unit and range represented by Quantity will differ, as shown below:
| Name | Quantity Unit | Quantity Ranges |
|---|---|---|
| MarketTypeCommon | 1,000 Shares | 1000 ~ 499000 |
| MarketTypeFixing | 1,000 Shares | 1000 ~ 499000 |
| MarketTypeIntradayOdd | Shares | 1 ~ 999 |
| MarketTypeOdd | Shares | 1 ~ 999 |
| MarketTypeEmg | 1,000 Shares | 1000 ~ 499000 |
| MarketTypeEmgOdd | Shares | 1 ~ 999 |
When using different MarketType, the available PriceType and TimeInForce will differ, as shown below:
| MarketType | Available PriceType | Available TimeInForce |
|---|---|---|
| MarketTypeCommon | PriceTypeLimit, PriceTypeLimitUp, PriceTypeLimitDown, PriceTypeMarket, PriceTypeReference | TimeInForceRod, TimeInForceIoc, TimeInForceFok |
| MarketTypeFixing | PriceTypeReference | TimeInForceRod |
| MarketTypeIntradayOdd | PriceTypeLimit, PriceTypeLimitUp, PriceTypeLimitDown, PriceTypeReference | TimeInForceRod |
| MarketTypeOdd | PriceTypeLimit, PriceTypeLimitUp, PriceTypeLimitDown, PriceTypeReference | TimeInForceRod |
| MarketTypeEmg | PriceTypeLimit | TimeInForceRod |
| MarketTypeEmgOdd | PriceTypeLimit | TimeInForceRod |
PriceType
Price Type
| Name | Value | Meaning |
|---|---|---|
| PriceTypeLimit | 1 | Limit |
| PriceTypeLimitUp | 2 | Limit Up |
| PriceTypeLimitDown | 3 | Limit Down |
| PriceTypeMarket | 4 | Market |
| PriceTypeReference | 5 | Reference (Fixing Price during Fixing) |
TimeInForce
Order Condition
| Name | Value | Meaning |
|---|---|---|
| TimeInForceRod | 1 | Rest of Day (ROD) |
| TimeInForceFok | 2 | Fill-or-Kill (FOK) |
| TimeInForceIoc | 3 | Immediate-or-Cancel (IOC) |
OrderType
Order Type
| Name | Value | Meaning |
|---|---|---|
| OrderTypeStock | 1 | Common (Stock) |
| OrderTypeMargin | 2 | Margin |
| OrderTypeShort | 3 | Short Sell |
| OrderTypeSbl | 4 | SBL (Securities Borrowing and Lending) |
| OrderTypeDayTrade | 5 | Day Trade |
StockType
Stock Category
| Name | Value | Meaning |
|---|---|---|
| StockTypeStock | 0 | Stock |
| StockTypeConvertBond | 1 | Convertible Bond |
| StockTypeEtfAndEtn | 3 | ETF and ETN |
FunctionType
Function Type
| Name | Value |
|---|---|
| New Order | 0 |
| Execute New Order | 10 |
| Change Price | 15 |
| Change Qty | 20 |
| Cancel Order | 30 |
| Fully Filled (for Order History) | 50 |
| Fail | 90 |
Market
Market
| Name | Value |
|---|---|
| Listed Stocks | TAIEX |
| OTC Stocks | TAISDAQ |
| Emerging Stocks | TAIEMG |
Status
Order Status
| Name | Value |
|---|---|
| Pre-order | 0 |
| Sending to Backend | 4 (Use OrderResults to check status) |
| Sending to Exchange | 8 (Use OrderResults to check status) |
| Connection Timeout | 9 (Please check OrderResults later or contact your agent) |
| Order Success | 10 |
| Cancelled Unfilled | 30 |
| Partial Fill/Rest Cancelled | 40 |
| Fully Filled | 50 |
| Order History Query Flag | 14 - Change Price ACK, 24 - Change Qty ACK, 34 - Cancel ACK |
| Change Price Success (Order History) | 15 |
| Change Qty Success (Order History) | 20 |
| Change Price Failed (Active Report) | 19 |
| Change Qty Failed (Active Report) | 29 |
| Cancel Failed (Active Report) | 39 |