Skip to main content

Cancel Order

CancelOrder

Request Parameter

ParameterTypeMeaning
accountAccountAccount
orderResultorderResultThe intended order result object to be cancel
unblockbool (optional) (default = false)unblock

Result Reponse

ParameterTypeMeaning
isSuccessboolInterface result
dataOrderResultModified content 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 : CommonFixingIntradayOddOddEmgEmgOdd
stockNostringSymbol
buySellBsActionBuy/Sell Type : BuySell
priceTypePriceTypeOriginal OPrder Price Type : LimitLimitUpLimitDownMarketReference
pricedoubleOrder Price
quantityintOriginal Order Quantity
timeInForceTimeInForceTime In Force : RodFokIoc
orderTypeOrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL
isPreOrderboolReservation 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
afterPriceTypePriceTypeValid Order Price Type : LimitLimitUpLimitDownMarketReference
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

Console.WriteLine(sdk.Stock.CancelOrder(account, cancel_order));

Response Example

{
isSuccess = True,
message = ,
data = OrderResult{
functionType = 30, // Function Type (int)
date = 2024/03/08, // Transaction Date (string)
seqNo = 00000308948, // Order Serial Number (string)
branchNo = 6460, // Branch Number (string)
account = 26, // Account (string)
orderNo = x0023, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market Type (string)
marketType = Common, // Trading Session Type (MarketType)
stockNo = 1101, // Symbol (string)
buySell = Sell, // Buy/Sell Type (BsAction)
priceType = Limit, // Original Order Price Type (PriceType)
price = 41.2, // Order Price (double)
quantity = 5000, // Original Order Quantity (int)
timeInForce = Rod, // Time In Force (TimeInforce)
orderType = Stock, // Order Type (string)
isPreOrder = False, // Reservation Order Flag (bool)
status = 30, // Order Status (int)
afterPriceType = Limit, // Valid Order Price Type (PriceType)
afterPrice = 41.2, // Valid Order Price (double)
unit = 1000, // Trading Unit (int)
afterQty = 0, // Valid Order Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Value (int)
beforeQty = 5000, // Before the Quantity Modification (int)
beforePrice = 41.2, // Before the Price Modification (double)
userDef = 12345678, // Custom Fields (string)
lastTime = 12:53:57.536, // Last Modification Time (string)
details = , // Order Process (list)
errorMessage = // Error Message (string)
}
}