Batch Cancel Order
batch_cancel_Order
Input Parameters
| Parameter | Type | Meaning |
|---|---|---|
| account | Account | Account |
| cancel_object | orderResults | The object list for cancel |
Result
| Parameter | Type | Meaning |
|---|---|---|
| is_success | bool | Whether successful |
| data | List | Modified content is returned |
| message | string | Error message returned when is_success = false |
OrderResult Parameter
Return type : Object
| Parameter | Type | Meaning |
|---|---|---|
| function_type | int | Function Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed |
| date | string | Transaction Date |
| seq_no | string | Order Serial Number |
| branch_no | string | Branch Number |
| account | string | Account |
| order_no | string | Order Number |
| asset_type | int | Asset Type : 0 Stock |
| market | string | Market Type : TAIEX Listed, TAISDAQ OTC, TAIEMG EMG |
| market_type | MarketType | Trading Session Type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd |
| stock_no | string | Symbol |
| buy_sell | BSAction | Buy/Sell Type : Buy, Sell |
| price_type | PriceType | Original Order Price Type : Limit, LimitUp, LimitDown, Market, Reference |
| price | float | Order Price |
| quantity | int | Original Order Quantity |
| time_in_force | TimeInforce | Time In Force : ROD FOK, IOC |
| order_type | OrderType | Order Type : Stock, Margin, Short, DayTrade, SBL |
| is_pre_order | bool | Reservation Order Flag |
| status | int | Order Status, for details please refer to STATUS |
| after_price_type | PriceType | Valid Order Price Type : Limit, LimitUp, LimitDown, Market, Reference |
| after_price | float | Valid Order Price |
| unit | int | Trading Unit |
| after_qty | int | Valid Order Quantity (filled quantity included) |
| filled_qty | int | Filled Quantity |
| filled_money | int | Filled Value |
| before_qty | int | Before the Quantity Modification |
| before_price | float | Before the Price Modification |
| user_def | string | Custom Fields |
| last_time | string | Last Modification Time |
| details | list | Order Process (Return value when query order_result_detail or order_history ) |
| error_message | string | Error 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 sequence number (string)
branch_no: "6460", # Branch code (string)
account: "26", # Account (string)
order_no: "x0028", # 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 side (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 amount (int)
before_qty: 5000, # Valid quantity before modification (int)
before_price: 41.2, # Valid price before modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "16:53:57.536", # Last Modification Time (string)
details: None, # Order history (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 sequence number (string)
branch_no: "6460", # Branch code (string)
account: "26", # Account (string)
order_no: "x0029", # 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 side (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)
...
}
]}
以下範例擷取data內容
[OrderResult{ # Batch Cancel ( Using different individual orders )
function_type: 30, # Function type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000307789", # Order sequence number (string)
branch_no: "6460", # Branch code (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 side (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 amount (int)
before_qty: 5000, # Valid quantity before modification (int)
before_price: 41.2, # Valid price before modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "16:53:58.536", # Last Modification Time (string)
error_message: None # Error message (string)
},
OrderResult{
function_type: 30, # Function type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000307785", # Order sequence number (string)
branch_no: "6460", # Branch code (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 side (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)
...
}]