Batch Modify Order Price
batch_modify_price
Create ModifyPriceObj using make_modify_price_obj first
| Parameter | Type | Description |
|---|---|---|
| orderResult | OrderResult | The Order to be modified |
| price | string | New Price |
| priceType | PriceType | New Price Type Flag |
caution
When the price field has a value, priceType must be std::nullopt; when priceType has a value, price must be std::nullopt.
Pass the Result object into the batch_modify_price method.
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account Object |
| ModifyPriceObj | ModifyPriceObj(list of object) | Batch Modify Order Content |
Return Result
| Parameter | Type | Description |
|---|---|---|
| isSuccess | bool | Is Success |
| data | List | Returns Modification Info |
| message | string | Returns Error Message when isSuccess = 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 Price (Using batch detailResult content)
std::vector<ModifyPrice> modify_orders = {
sdk->stock->make_modify_price_obj(batch_list_res.data.value()[0], "41.1", std::nullopt),
sdk->stock->make_modify_price_obj(batch_list_res.data.value()[1], "41.2", std::nullopt)
};
// Batch Modify Price (Using different individual orders)
std::vector<ModifyPrice> modify_orders = {
sdk->stock->make_modify_price_obj(order_res.data.value()[10], "41.1", std::nullopt),
sdk->stock->make_modify_price_obj(order_res.data.value()[13], "41.2", std::nullopt)
};
auto batch_price = sdk->stock->batch_modify_price(target_account, modify_orders);
if (!batch_price.is_success) {
std::cout << "batch_price failed reason: "
<< (batch_price.message.has_value() ? batch_price.message.value() : "No message")
<< std::endl;
}
else {
if (batch_price.data.has_value()) {
std::cout << batch_price << std::endl;
}
else {
std::cout << "batch_price success but no data returned." << std::endl;
}
}
ResultExample
isSuccess = true,
message = ,
data =[
OrderResult{ // Batch Modify Price (Using batch detailResult content)
functionType = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seqNo = 00000322356, // Sequence Number (string)
branchNo = 6460, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0018, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 1101, // Stock Symbol (string)
buySell = Sell, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // Original Quantity (int)
timeInForce = Rod, // Time In Force (TimeInForce)
orderType = Stock, // Order Type (OrderType)
isPreOrder = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
afterPriceType = Limit, // Effective Price Type (PriceType)
afterPrice = 41.1, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 2000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = , // Quantity Before Mod (int)
beforePrice = 41.3, // Price Before Mod (double)
userDef = 12345678, // User Defined Field (string)
lastTime = 13:56:57.713, // Last Modified Time (string)
details = , // Order History (list)
errorMessage = // Error Message (string)
},
OrderResult{
functionType = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seqNo = 00000322355, // Sequence Number (string)
branchNo = 6460, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0017, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 1101, // Stock Symbol (string)
buySell = Sell, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // Original Quantity (int)
timeInForce = Rod, // Time In Force (TimeInForce)
orderType = Stock, // Order Type (OrderType)
isPreOrder = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
...
}
]
}
// The following is an excerpt of data content
[ OrderResult{ // Batch Modify Price (Using different individual orders)
functionType = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seqNo = 00000322388, // Sequence Number (string)
branchNo = 6460, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0033, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 1101, // Stock Symbol (string)
buySell = Sell, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // Original Quantity (int)
timeInForce = Rod, // Time In Force (TimeInForce)
orderType = Stock, // Order Type (OrderType)
isPreOrder = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
afterPriceType = Limit, // Effective Price Type (PriceType)
afterPrice = 41.1, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 2000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = , // Quantity Before Mod (int)
beforePrice = 41.3, // Price Before Mod (double)
userDef = 12345678, // User Defined Field (string)
lastTime = 10:56:57.713, // Last Modified Time (string)
details = , // Order History (list)
errorMessage = // Error Message (string)
},
OrderResult{
functionType = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seqNo = 00000322386, // Sequence Number (string)
branchNo = 6460, // Branch Code (string)
account = "26", // Account (string)
orderNo = x0031, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 1101, // Stock Symbol (string)
buySell = Sell, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // Original Quantity (int)
timeInForce = Rod, // Time In Force (TimeInForce)
orderType = Stock, // Order Type (OrderType)
isPreOrder = False, // Is Pre-order (bool)
status = 10, // Order Status (int)
...
}
]