Skip to main content

Cancel Order

cancelOrder

Input Parameters

ParameterTypeMeaning
accountAccountAccount
orderResultorderResultOrder result object to cancel
unblockbool? (default = false)Whether to use non-blocking mode

Result

ParameterTypeMeaning
isSuccessboolWhether successful
dataObjectModified content is returned
messagestring ? (optional)Error message returned when isSuccess = false

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypenumberFunction 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 : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : Buy, Sell
priceTypejs:string / ts:PriceTypeOriginal order price type : Limit, LimitUp, LimitDown, Market, Reference
pricenumberOrder Price
quantitynumberOriginal order quantity
timeInForcejs:string / ts:TimeInForceTime In Force ROD, FOK, IOC
orderTypejs:string / ts:OrderTypeOrder Type : Stock, Margin, Short Short sale, DayTrade, SBL
isPreOrderboolReservation Flag
statusnumberOrder status, for details please refer to STATUS
afterPriceTypejs:string / ts:PriceTypeValid order price type : Limit, LimitUp, LimitDown, Market, Reference
afterPricenumberValid order price
unitnumberTrading Unit
afterQtynumberValid Order Quantity (filled quantity included)
filledQtynumberFilled Quantity
filledMoneynumberFilled Value
beforeQtynumberBefore the Quantity Modification
beforePricenumberBefore the Price Modification
user_defstringCustom Fields
lastTimestringLast Modification Time
detailslistOrder Process (Return value when query orderResultDetail or orderHistory )
errorMessagestringError Message

Request Example

sdk.stock.cancelOrder(account, cancel_order)

Response Example

{
isSuccess: true,
data: {
functionType: 30, // Function Type (number)
date: '2024/03/08', // Transaction Date (string)
seqNo: '00000308948', // Order sequence number (string)
branchNo: '6460', // Branch code (string)
account: '26', // Account (string)
orderNo: 'x0023', // Order Number (string)
assetType: 0, // Asset Type (number)
market: 'TAIEX', // Market Type (string)
marketType: 'Common', // Trading session type (string)
stockNo: '1101', // Symbol (string)
buySell: 'Sell', // Buy/sell side (string)
priceType: 'Limit', // Original order price type (string)
price: 41.2, // Price (number)
quantity: 5000, // Original Order Quantity (number)
timeInForce: 'ROD', // Time in force (string)
orderType: 'Stock', // Order type (string)
isPreOrder: false, // Reservation Order Flag (bool)
status: 30, // Order Status (number)
afterPriceType: 'Limit', // Valid order price type (string)
afterPrice: 41.2, // Valid Order Price (number)
unit: 1000, // Trading unit (number)
afterQty: 0, // Valid Order Quantity (number)
filledQty: 0, // Filled Quantity (number)
filledMoney: 0, // Filled Value (number)
beforeQty: 5000, // Before the Quantity Modification (number)
beforePrice: 41.2, // Before the Price Modification (number)
userDef: '12345678', // Custom Fields (string)
lastTime: '12:53:57.536', // Last Modification Time (string)
}
}