Batch Modify Order Quantity
batch_modify_quantity
Create ModifyQuantityObj using make_modify_quantity_obj first
| Parameter | Type | Description |
|---|---|---|
| order | OrderResult | The Order to be modified |
| quantity | int | Modified Order Quantity (Includes filled portion of this order) |
Pass the Result object into the batch_modify_quantity method.
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account Object |
| orders | ModifyQuantityObj (list of object) | Batch Modify Order Content |
Return Result
| Parameter | Type | Description |
|---|---|---|
| is_success | bool | Is Success |
| data | List | Returns Modification Info |
| message | string | Returns Error Message when is_success = False |
Modification Info OrderResult Fields
Return type: Object
| Parameter | Type | Description |
|---|---|---|
| function_type | int | Function Type: 0 New Order, 10 Exec New, 15 Mod Price, 20 Mod Qty, 30 Cancel, 90 Failed |
| date | string | Trade Date |
| seq_no | string | Sequence Number |
| branch_no | string | Branch Code |
| account | string | Account |
| order_no | string | Order Number |
| asset_type | int | Asset Type: 0 Stock |
| market | string | Market: TAIEX (Listed), TAISDAQ (OTC), TAIEMG (Emerging) |
| market_type | MarketType | Market Type: COMMON (Round Lot), FIXING, INTRADAY_ODD, ODD (Post-market Odd), EMG, EMG_ODD |
| stock_no | string | Stock Symbol |
| buy_sell | BSAction | Side: BUY, SELL |
| pric_type | PriceType | Price Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE |
| price | double | Price |
| quantity | int | Original Order Quantity |
| time_in_force | TimeInForce | Time In Force: ROD, FOK, IOC |
| order_type | OrderType | Order Type: STOCK (Cash), MARGIN, SHORT, DAY_TRADE, SBL |
| is_pre_order | bool | Is Pre-order |
| status | int | Order Status: 0 Pre-order, 4 Sending, 9 Timeout, 10 Success, 30 Cancelled, 40 Partial Fill/Cancel Remainder, 50 Full Fill, 90 Failed |
| after_price_type | PriceType | Effective Price Type |
| after_price | double | Effective Price |
| unit | int | Unit Size |
| after_qty | int | Effective Quantity (Includes filled portion) |
| filled_qty | int | Filled Quantity |
| filled_money | int | Filled Amount |
| before_qty | int | Quantity Before Modification |
| before_price | double | Price Before Modification |
| user_def | string | User Defined Field |
| last_time | string | Last Modified Time |
| details | list | Order History (Available in order_result_detail or order_history) |
| error_message | string | Error Message |
Request Example
// Batch Modify Quantity (Using batch detailResult content)
std::vector<ModifyQuantity> modify_orders = {
sdk->stock->make_modify_quantity_obj(batch_list_res.data.value()[0], 1000),
sdk->stock->make_modify_quantity_obj(batch_list_res.data.value()[1], 1000)
};
// Batch Modify Quantity (Using different individual orders)
std::vector<ModifyQuantity> modify_orders {
sdk->stock->make_modify_quantity_obj(order_res.data.value()[10], 1000),
sdk->stock->make_modify_quantity_obj(order_res.data.value()[13], 1000)
};
auto batch_qty = sdk->stock->batch_modify_quantity(account, modify_qty);
if (!batch_qty.is_success) {
std::cout << "batch_qty failed reason: "
<< (batch_qty.message.has_value() ? batch_qty.message.value() : "No message")
<< std::endl;
}
else {
if (batch_qty.data.has_value()) {
std::cout << batch_qty << std::endl;
}
else {
std::cout << "batch_qty success but no data returned." << std::endl;
}
}
ResultExample
{
is_success = true,
message = ,
data =[ OrderResult{ // Batch Modify Qty (Using batch detailResult content)
function_type = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seq_no = 00000000042, // Sequence Number (string)
branch_no = 20112, // Branch Code (string)
account = 26, // Account (string)
order_no = x0026, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MarketType)
stock_no = 2881, // Stock Symbol (string)
buy_sell = Buy, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // Original Quantity (int)
time_in_force = Rod, // Time In Force (TimeInForce)
order_type = Stock, // Order Type (OrderType)
is_pre_order = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
after_price_type = , // Effective Price Type (PriceType)
after_price = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 1000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = 2000, // Quantity Before Mod (int)
before_price = , // Price Before Mod (double)
user_def = batch2, // User Defined Field (string)
last_time = 12:21:51.023, // Last Modified Time (string)
details = , // Order History (list)
error_message = // Error Message (string)
},
OrderResult{ // Batch Modify Qty (Using batch detailResult content)
function_type = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seq_no = 00000000041, // Sequence Number (string)
branch_no = 20112, // Branch Code (string)
account = 26, // Account (string)
order_no = x0025, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MarketType)
stock_no = 2881, // Stock Symbol (string)
buy_sell = Buy, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // Original Quantity (int)
time_in_force = Rod, // Time In Force (TimeInForce)
order_type = Stock, // Order Type (OrderType)
is_pre_order = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
after_price_type = , // Effective Price Type (PriceType)
after_price = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 1000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = 2000, // Quantity Before Mod (int)
before_price = , // Price Before Mod (double)
user_def = batch1, // User Defined Field (string)
last_time = 12:21:51.023, // Last Modified Time (string)
error_message = // Error Message (string)
}
]
}
// The following is an excerpt of data content
[
OrderResult{ // Batch Modify Qty (Using different individual orders)
function_type = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seq_no = 00000000043, // Sequence Number (string)
branch_no = 20112, // Branch Code (string)
account = "26", // Account (string)
order_no = x0027, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MaeketType)
stock_no = 2881, // Stock Symbol (string)
buy_sell = Buy, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // Original Quantity (int)
time_in_force = Rod, // Time In Force (TimeInForce)
order_type = Stock, // Order Type (OrderType)
is_pre_order = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
after_price_type = , // Effective Price Type (PriceType)
after_price = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 1000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = 2000, // Quantity Before Mod (int)
before_price = , // Price Before Mod (int)
user_def = Test, // User Defined Field (string)
last_time = 12:21:53.023, // Last Modified Time (string)
details = , // Order History (list)
error_message = // Error Message (string)
},
OrderResult{
function_type = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seq_no = 00000000044, // Sequence Number (string)
branch_no = 20112, // Branch Code (string)
account = 26, // Account (string)
order_no = x0028, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MarketType)
stock_no = 2881, // Stock Symbol (string)
buy_sell = Buy, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // Original Quantity (int)
time_in_force = Rod, // Time In Force (TimeInForce)
order_type = Stock, // Order Type (OrderType)
is_pre_order = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
after_price_type = , // Effective Price Type (PriceType)
after_price = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 1000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = 2000, // Quantity Before Mod (int)
before_price = , // Price Before Mod (string)
user_def = Test, // User Defined Field (string)
last_time = 12:21:53.023, // Last Modified Time (string)
error_message = // Error Message (string)
}
]