Skip to main content

Batch Cancel Order

batch_cancel_Order

Request Parameter

ParameterTypeMeaning
accountAccountAccount
cancel_objectorderResults(List) (list of object)The object list for cancel

Result Response

ParameterTypeMeaning
is_successboolInterface result
dataListModified content is returned
messagestringis_success = False error description is returned

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
function_typeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed
datestringTransaction Date
seq_nostringOrder Serial Number
branch_nostringBranch Number
accountstringAccount
order_nostringOrder Number
asset_typeintAsset Type : 0 Stock
marketstringMarket Type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG EMG
market_typeMarketTypeTrading Session Type : CommonFixingIntradayOddOddEmgEmgOdd
stock_nostringSymbol
buy_sellBSActionBuy/Sell Type : BuySell
price_typePriceTypeOriginal Order Price Type : LimitLimitUpLimitDownMarketReference
pricefloatOrder Price
quantityintOriginal Order Quantity
time_in_forceTimeInForceTime In Force : ROD FOKIOC
order_typeOrderTypeOrder Type : StockMarginShortDayTradeSBL
is_pre_orderboolReservation 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
after_price_typePriceTypeValid Order Price Type : LimitLimitUpLimitDownMarketReference
after_pricefloatValid Order Price
unitintTrading Unit
after_qtyintValid Order Quantity (filled quantity included)
filled_qtyintFilled Quantity
filled_moneyintFilled Value
before_qtyintBefore the Quantity Modification
before_pricefloatBefore the Price Modification
user_defstringCustom Fields
last_timestringLast Modification Time
detailslistOrder Process (Return value when query order_result_detail or order_history )
error_messagestringError Message

Request Example

# Batch Cancel( Using the content returned by batch detail )
cancel_object = [
batch_results_detail.data[0],
batch_results_detail.data[1],
]
sdk.stock.batch_cancel_order(account, cancel_object)

# Batch Cancel ( Using different individual orders )
cancel_object = [
orders.data[37],
orders.data[35],
]

sdk.stock.batch_cancel_order(account, cancel_object)

Response Example

Result {
is_success: True,
message: None,
data :[
OrderResult{ # Batch Cancel( Using the content returned by batch detail )
function_type: 30, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000308998", # Order Serial Number (string)
branch_no: "6460", # Branch Number (string)
account: "26", # Account (string)
order_no: "x0028", # Order Number (string)
asset_type: 0, # Asset Type: `0` Stock (int)
market: "TAIEX", # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # Original Order Quantity (int)
time_in_force: ROD, # Time In Force (TimeInForce)
order_type: Stock, # Order Type (OrderType)
is_pre_order: False, # Reservation Order Flag (bool)
status: 30, # Order Status (int)
after_price_type: Limit, # Valid Order Price Type (PriceType)
after_price: 41.2, # Valid Order Price (float)
unit: 1000, # Unit (int)
after_qty: 0, # Valid Order Quantity (int)
filled_qty: 0, # Filled Quantity (int)
filled_money: 0, # Filled Value (int)
before_qty: 5000, # Before the Quantity Modification (int)
before_price: 41.2, # Before the Price Modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "16:53:57.536", # Last Modification Time (string)
details: None, # Order Process (list)
error_message: None # Error Message (string)
},
OrderResult{
function_type: 30, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "0000030899", # Order Serial Number (string)
branch_no: "6460", # Branch Number (string)
account: "26", # Account (string)
order_no: "x0029", # Order Number (string)
asset_type: 0, # Asset Type: `0` Stock (int)
market: "TAIEX", # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # Original Order Quantity (int)
time_in_force: ROD, # Time In Force (TimeInForce)
order_type: Stock, # Order Type (string)
is_pre_order: False, # Reservation Order Flag (bool)
status: 30, # Order Status (int)
...
}]
}

Below example only extract data content

[OrderResult({ # Batch Cancel ( Using different individual orders )
function_type: 30, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000307789", # Order Serial Number (string)
branch_no: "6460", # Branch Number (string)
account: "26", # Account (string)
order_no: "x0033", # Order Number (string)
asset_type: 0, # Asset Type (int)
market: "TAIEX", # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # Original Order Quantity (int)
time_in_force: ROD, # Time In Force (TimeInforce)
order_type: Stock, # Order Type (string)
is_pre_order: False, # Reservation Order Flag (bool)
status: 30, # Order Status (int)
after_price_type: Limit, # Valid Order Price Type (PriceType)
after_price: 41.2, # Valid Order Price (float)
unit: 1000, # Trading Unit (int)
after_qty: 0, # Valid Order Quantity (int)
filled_qty: 0, # Filled Quantity (int)
filled_money: 0, # Filled Value (int)
before_qty: 5000, # Before the Quantity Modification (int)
before_price: 41.2, # Before the Price Modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "16:53:58.536", # Last Modification Time (string)
details: None, # Order Process (list)
error_message: None # Error Message (string)
}),
OrderResult({
function_type: 30, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000307785", # Order Serial Number (string)
branch_no: "6460", # Branch Number (string)
account: "26", # Account (string)
order_no: "x0031", # Order Number (string)
asset_type: 0, # Asset Type (int)
market: "TAIEX", # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # Original Order Quantity (int)
time_in_force: ROD, # Time In Force (TimeInforce)
order_type: Stock, # Order Type (string)
is_pre_order: False, # Reservation Order Flag (bool)
status: 30, # Order Status (int)
...
})]