Skip to main content

PlaceOrder

PlaceOrder

Request Parameter​

ParameterTypeMeaning
accountAccountaccount
orderObjectOrderObjectOrder Object
unblockbool (optional) (default = false)unblock

Result Reponse​

ParameterTypeMeaning
isSuccessboolInterface result
dataOrderResultOrderResult is returned
messagestringisSuccess = False error description is returned

OrderResult Parameter​

Return type : Object

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
assetTypeintAsset Type : 0 Stock
marketstringMarket Type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG Emg
marketTypeMarketTypeTrading Session Type : Common 、 Fixing 、 IntradayOdd 、 Odd 、 Emg 、 EmgOdd
stockNostringSymbol
buySellBsActionBuy/Sell Type : Buy 、 Sell
priceTypePriceTypeOriginal OPrder Price Type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference
pricedoubleOrder Price
quantityintOriginal Order Quantity
timeInForceTimeInForceTime In Force : Rod 、 Fok 、 Ioc
orderTypeOrderTypeOrder Type : Stock 、 Margin 、 Short Short sale 、 DayTrade 、 SBL
isPreOrderboolReservation Order Flag
statusintOrder Status, for details please refer to STATUS
afterPriceTypePriceTypeValid Order Price Type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference
afterPricedoubleValid Order Price
unitintTrading Unit
afterQtyintValid Order Quantity (filled quantity included)
filledQtyintFilled Quantity
filledMoneyintFilled Value
beforeQtyintBefore the Quantity Modification
beforePricedoubleBefore the Price Modification
userDefstringCustom Fields
lastTimestringLast Modification Time
detailslistOrder Process (Return value when query OrderResultDetail or OrderHistory )
errorMessagestringError Message

Request Example​

var order = new Order(
BsAction.Buy,
"2881",
"66",
2000,
MarketType.Common,
PriceType.Limit,
TimeInForce.Rod,
OrderType.Stock,
null // User_def
);

sdk.Stock.PlaceOrder(accounts.data[0],order);

Response Example​

{
isSuccess = True,
message = ,
data = OrderResult{
functionType = 0, // Function Type (int)
date = 2023/10/13, // Trading Date (string)
seqNo = 00000000007, // Order Serial Number (string)
branchNo = 6460, // Branch Number (string)
account = 26, // Account (string)
orderNo = bA619, // Order Number (string)
market = TAIEX, // Market Category (string)
marketType = Common, // Trading Session Type (MarketType)
stockNo = 2888, // Symbol (string)
buySell = Buy, // Transaction Direction (BsAction)
priceType = Limit, // Order Price Type (PriceType)
price = 9.1, // Order Price (double)
quantity = 3000, // Order Quantity (int)
timeInForce = Rod, // Time in Force (TimeInForce)
orderType = Stock, // Order Type (OrderType)
isPreOrder = False, // Reservation Flag (bool)
status = 10, // Order Status (int)
afterPriceType = Limit, // Valid Order Price Type (PriceType)
afterPrice = 9.1, // Valid Order Price (double)
unit = 1000, // Share Unit (int)
afterQty = 3000, // Valid Order Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Value (int)
beforeQty = 0, // Before the Quantity Modification (int)
beforePrice = 9.1, // Before the Price Modification (double)
userDef = , // Custom Fields (string)
lastTime = 12:10:12.546, // Last Modification Time (string)
details = , // Order Process (list)
errorMessage = // Error Message (string)
}
}