Batch Modify Quantity
batch_modify_quantity
First, using 'make_modify_quantity_obj' create a 'ModifyQuantityObj' object
Parameter | Type | Meaning |
---|---|---|
order | orderResult | The intended order result object to be modified |
quantity | int | The quantity after modification ( The modified quantity includes the partially filled portion of this order ) |
Put the returned object into the 'modify_quantity' function
Request Parameter
Parameter | Type | Meaning |
---|---|---|
account | Account | Account |
orders | ModifyQtyObj (list of object ) | The object for Quantity modification |
Result Response
Parameter | Type | Meaning |
---|---|---|
is_success | bool | Interface result |
data | List | Modified content is returned |
message | string | is_success = False error description is returned |
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 : 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_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 quantity modification ( modifying orders using the content returned by batch detail )
modify_objects = [
sdk.stock.make_modify_quantity_obj(batch_results_detail.data[0], 1000),
sdk.stock.make_modify_quantity_obj(batch_results_detail.data[1], 1000),
]
sdk.stock.batch_modify_quantity(target_user, modify_objects)
# Batch quantity modification ( Using different individual orders )
modify_objects = [
sdk.stock.make_modify_quantity_obj(orders.data[37], 1000),
sdk.stock.make_modify_quantity_obj(orders.data[35], 1000),
]
sdk.stock.batch_modify_quantity(target_user, modify_objects)
Response
Result {
is_success: True,
message: None,
data :[
OrderResult{ # Batch quantity modification ( modifying orders using the content returned by batch detail )
function_type: 20, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000000042", # Order Serial Number (string)
branch_no: "20112", # Branch Number (string)
account: "26", # Account (string)
order_no: x0026, # Order Number (string)
asset_type: 0, # Asset Type (int)
market: TAIEX, # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: 2881, # Symbol (string)
buy_sell: Buy, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 66, # Price (float)
quantity: 2000, # 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: 10, # Order Status (int)
after_price_type: None, # Valid Order Price Type (PriceType)
after_price: 66, # Valid Order Price (float)
unit: 1000, # Trading Unit (int)
after_qty: 1000, # Valid Order Quantity (int)
filled_qty: 0, # Filled Quantity (int)
filled_money: 0, # Filled Value (int)
before_qty: 2000, # Before the Quantity Modification (int)
before_price: None, # Before the Price Modification (string)
user_def: "batch 2", # Custom Fields (string)
last_time: "12:21:51.023", # Last Modification Time (string)
details: None, # Order Process (list)
error_message: None # Error Message (string)
},
OrderResult{
function_type: 20, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000000041", # Order Serial Number (string)
branch_no: "20112", # Branch Number (string)
account: "26", # Account (string)
order_no: x0025, # Order Number (string)
asset_type: 0, # Asset Type: Stock (int)
market: TAIEX, # Market Type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: 2881, # Symbol (string)
buy_sell: Buy, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 66, # Price (float)
quantity: 2000, # 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: 10, # Order Status (int)
after_price_type: None, # Valid Order Price Type (PriceType)
after_price: 66, # Valid Order Price (float)
...
}]
}
Below example only extract data content
[OrderResult({ # Batch quantity modification ( Using different individual orders )
function_type: 20, # Function Type (int)
date: "2024/03/08", # Transaction date (string)
seq_no: "00000000043", # Order sequence number (string)
branch_no: "20112", # Branch Number (string)
account: "26", # Account number (string)
order_no: "x0027", # Order number (string)
asset_type: 0, # Asset type (int)
market: "TAIEX", # Market type (string)
market_type: Common, # Trading Session Type (MarketType)
stock_no: "2881", # Stock code (string)
buy_sell: Buy, # Buy/sell type (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 66, # Price (float)
quantity: 2000, # 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: 10, # Order status (int)
after_price_type: None, # Valid Order Price Type (PriceType)
after_price: 66, # Valid Order Price (float)
unit: 1000, # Trading Unit (int)
after_qty: 1000, # Valid Order Quantity (int)
filled_qty: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_qty: 2000, # Before the Quantity Modification (int)
before_price: None, # Before the Price Modification (string)
user_def: "Test", # Custom Fields (string)
last_time: "12:21:53.023", # Last Modification Time (string)
details: None, # Order Process (list)
error_message: None # Error message (string)
}),
OrderResult({
function_type: 20, # Function Type (int)
date: "2024/03/08", # Transaction Date (string)
seq_no: "00000000044", # Order Serial Number (string)
branch_no: "20112", # Branch Number (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: 2881, # Symbol (string)
buy_sell: Buy, # Buy/Sell Type (BSAction)
price_type: Limit, # Original Order Price Type (PriceType)
price: 66, # Order Price (float)
quantity: 2000, # 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: 10, # Order Status (int)
...
})]