Skip to main content

Batch Cancel Order

batch_cancel_Order

Request Parameter

ParameterTypeMeaning
accountAccountAccount
cancel_objectFutOptOrderResult(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

FutOptOrderResult Parameter

Return type : Object

ParameterTypeMeaning
function_typeintFunction Type : 0 New 、10 Execute New、 15 Amend Price 、 20 Amend Lot 、 30 Cancel、90Failed
datestringTransaction Date
seq_nostringOrder Serial Number
branch_nostringBranch Number
accountstringAccount
order_nostringOrder Number
asset_typeintAsset Type : 1 Future 、2 Option
marketstringMarket Type : TAIMEX Future、Option
market_typeFutOptMarketTypeTrading Session Type : FutureOptionFutureNight After-Hour Future、 OptionNight After-Hour Option
unitintUnit
currencystringTrading Currency
symbolstringSymbol
expiry_datestringExpiry Date
strike_pricefloatStrike Price
call_putCallPutCall / Put : CallPut
buy_sellBSActionBuy/Sell Type : BuySell
symbol_leg2stringSpread Symbol
expiry_date_leg2stringExpiry Date - Spread Order
strike_price_leg2floatStrike Price - Spread Order
call_put_leg2CallPutCall / Put : CallPut
buy_sell_leg2BSActionBuy/Sell Type - Spread Order: BuySell
price_typeFutOptPriceTypeOriginal Order Price Type : LimitMarketRangeMarket Market with Protection Orders 、 Reference
pricefloatOrder Price
lotsintOriginal Order Lot
time_in_forceTimeInForceTime In Force : ROD FOKIOC
order_typeFutOptOrderTypeOrder Type : NewCloseAutoFdayTrade DayTrade
is_pre_orderboolReservation Order Flag
statusintOrder Status : 0 Reservation 、 4 In queue 、 8 Processing by system backend 、 9 TimeOut 、 10 Active Order 、 30 Cancel Order 、 50 Fully Filled 、 90 Order Failed
after_price_typeFutOptPriceTypeValid Order Price Type : Limit MarketRangeMarket Market with Protection Orders 、 Reference
after_pricefloatValid Order Price
after_lotintValid Order Lot
filled_lotintFilled Lot
filled_moneyfloatFilled Value
before_lotintBefore the Lot 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 :[
FutOptOrderResult{ # Batch Cancel( Using the content returned by batch detail )
function_type: 30, # Function type (int)
date: "2024/03/25", # Transaction date (string)
seq_no: "00110212608", # Order sequence number (string)
branch_no: "15901", # Branch number (string)
account: "1234567", # Account (string)
order_no: "C0001", # Order number (string)
asset_type: 1, # Asset type (int)
market: "TAIMEX", # Market type (string)
market_type: Future, # Market type category (FutOptMarketType)
unit: 1, # Unit (int)
currency: "TWD", # Currency (string)
symbol: "FITF", # Symbol (string)
expiry_date: "202404", # Expiry date (string)
strike_price: None, # Strike price (float)
call_put: None, # Call or put (CallPut)
buy_sell: Buy, # Buy or sell (BSAction)
symbol_leg2: None, # Spread Symbol (string)
expiry_date_leg2: None, # Expiry date - Spread Order (string)
strike_price_leg2: None, # Strike price - Spread Order (float)
call_put_leg2: None, # Call or put - Spread Order (CallPut)
buy_sell_leg2: None, # Buy or sell - Spread Order (BSAction)
price_type: Limit, # Original order price type (FutOptPriceType)
price: 1822.6, # Price (float)
lot: 2, # Original order quantity (int)
time_in_force: ROD, # Time in force (TimeInforce)
order_type: Auto, # Order type (FutOptOrderType)
is_pre_order: false, # Is pre-order (bool)
status: 30, # Order status (int)
after_price_type: None, # Valid order price type (FutOptPriceType)
after_price: 1822.6, # Valid order price (float)
after_lot: 0, # Valid order quantity (int)
filled_lot: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_lot: None, # Lot before amendment (int)
before_price: None, # Price before amendment (float)
user_def: None, # User-defined field (string)
last_time: "13:21:34", # Last modification time (string)
details: None, # Order Process (list)
error_message: None # Error message (string)
},
FutOptOrderResult{
function_type: 30, # Function type (int)
date: "2024/03/25", # Transaction date (string)
seq_no: "00110212609", # Order sequence number (string)
branch_no: "15901", # Branch number (string)
account: "1234567", # Account (string)
order_no: "C0002", # Order number (string)
asset_type: 1, # Asset type (int)
market: "TAIMEX", # Market type (string)
market_type: Future, # Market type category (FutOptMarketType)
unit: 1, # Unit (int)
currency: "TWD", # Currency (string)
symbol: "FITF", # Symbol (string)
expiry_date: "202404", # Expiry date (string)
strike_price: None, # Strike price (float)
call_put: None, # Call or put (CallPut)
buy_sell: Buy, # Buy or sell (BSAction)
symbol_leg2: None, # Spread Symbol (string)
expiry_date_leg2: None, # Expiry date - Spread Order (string)
strike_price_leg2: None, # Strike price - Spread Order (float)
call_put_leg2: None, # Call or put - Spread Order (CallPut)
buy_sell_leg2: None, # Buy or sell - Spread Order (BSAction)
price_type: Limit, # Original order price type (FutOptPriceType)
price: 1822.6, # Price (float)
lot: 2, # Original order quantity (int)
time_in_force: ROD, # Time in force (TimeInforce)
order_type: Auto, # Order type (FutOptOrderType)
is_pre_order: false, # Is pre-order (bool)
status: 30, # Order status (int)
...
}]
}

Below example only extract data content

[FutOptOrderResult({ # Batch Cancel ( Using different individual orders )
function_type: 30, # Function type (int)
date: "2024/03/25", # Transaction date (string)
seq_no: "00110212708", # Order sequence number (string)
branch_no: "15901", # Branch number (string)
account: "1234567", # Account (string)
order_no: "C0011", # Order number (string)
asset_type: 1, # Asset type (int)
market: "TAIMEX", # Market type (string)
market_type: Future, # Market type category (FutOptMarketType)
unit: 1, # Unit (int)
currency: "TWD", # Currency (string)
symbol: "FITF", # Symbol (string)
expiry_date: "202404", # Expiry date (string)
strike_price: None, # Strike price (float)
call_put: None, # Call or put (CallPut)
buy_sell: Buy, # Buy or sell (BSAction)
symbol_leg2: None, # Spread Symbol (string)
expiry_date_leg2: None, # Expiry date - Spread Order (string)
strike_price_leg2: None, # Strike price - Spread Order (float)
call_put_leg2: None, # Call or put - Spread Order (CallPut)
buy_sell_leg2: None, # Buy or sell - Spread Order (BSAction)
price_type: Limit, # Original order price type (FutOptPriceType)
price: 1822.6, # Price (float)
lot: 2, # Original order quantity (int)
time_in_force: ROD, # Time in force (TimeInforce)
order_type: Auto, # Order type (FutOptOrderType)
is_pre_order: false, # Is pre-order (bool)
status: 30, # Order status (int)
after_price_type: None, # Valid order price type (FutOptPriceType)
after_price: 1822.6, # Valid order price (float)
after_lot: 0, # Valid order quantity (int)
filled_lot: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_lot: None, # Lot before amendment (int)
before_price: None, # Price before amendment (float)
user_def: None, # User-defined field (string)
last_time: "13:30:34", # Last modification time (string)
details: None, # Order Process (list)
error_message: None # Error message (string)
},
FutOptOrderResult{
function_type: 30, # Function type (int)
date: "2024/03/25", # Transaction date (string)
seq_no: "00110212709", # Order sequence number (string)
branch_no: "15901", # Branch number (string)
account: "1234567", # Account (string)
order_no: "C0012", # Order number (string)
asset_type: 1, # Asset type (int)
market: "TAIMEX", # Market type (string)
market_type: Future, # Market type category (FutOptMarketType)
unit: 1, # Unit (int)
currency: "TWD", # Currency (string)
symbol: "FITF", # Symbol (string)
expiry_date: "202404", # Expiry date (string)
strike_price: None, # Strike price (float)
call_put: None, # Call or put (CallPut)
buy_sell: Buy, # Buy or sell (BSAction)
symbol_leg2: None, # Spread Symbol (string)
expiry_date_leg2: None, # Expiry date - Spread Order (string)
strike_price_leg2: None, # Strike price - Spread Order (float)
call_put_leg2: None, # Call or put - Spread Order (CallPut)
buy_sell_leg2: None, # Buy or sell - Spread Order (BSAction)
price_type: Limit, # Original order price type (FutOptPriceType)
price: 1822.6, # Price (float)
lot: 2, # Original order quantity (int)
time_in_force: ROD, # Time in force (TimeInforce)
order_type: Auto, # Order type (FutOptOrderType)
is_pre_order: false, # Is pre-order (bool)
status: 30, # Order status (int)
...
})]