Skip to main content

Batch Modify Order Price

batch_modify_price

Create ModifyPriceObj using make_modify_price_obj first​

ParameterTypeDescription
orderOrderResultThe Order to be modified
pricestringNew Price
price_typePriceTypeNew Price Type Flag
caution

When the price field has a value, price_type must be std::nullopt; when price_type has a value, price must be std::nullopt.

Pass the Result object into the batch_modify_price method.

Input Parameters​

ParameterTypeDescription
accountAccountAccount Object
ordersModifyPriceObj(list of object)Batch Modify Order Content

Return Result​

ParameterTypeDescription
is_successboolIs Success
dataListReturns Modification Info
messagestringReturns Error Message when is_success = False

Modification Info OrderResult Fields​

Return type: Object

ParameterTypeDescription
function_typeintFunction Type: 0 New Order, 10 Exec New, 15 Mod Price, 20 Mod Qty, 30 Cancel, 90 Failed
datestringTrade Date
seq_nostringSequence Number
branch_nostringBranch Code
accountstringAccount
order_nostringOrder Number
asset_typeintAsset Type: 0 Stock
marketstringMarket: TAIEX (Listed), TAISDAQ (OTC), TAIEMG (Emerging)
market_typeMarketTypeMarket Type: COMMON (Round Lot), FIXING, INTRADAY_ODD, ODD (Post-market Odd), EMG, EMG_ODD
stock_nostringStock Symbol
buy_sellBSActionSide: BUY, SELL
pric_typePriceTypePrice Type: LIMIT, LIMIT_UP, LIMIT_DOWN, MARKET, REFERENCE
pricedoublePrice
quantityintOriginal Order Quantity
time_in_forceTimeInForceTime In Force: ROD, FOK, IOC
order_typeOrderTypeOrder Type: STOCK (Cash), MARGIN, SHORT, DAY_TRADE, SBL
is_pre_orderboolIs Pre-order
statusintOrder Status: 0 Pre-order, 4 Sending, 9 Timeout, 10 Success, 30 Cancelled, 40 Partial Fill/Cancel Remainder, 50 Full Fill, 90 Failed
after_price_typePriceTypeEffective Price Type
after_pricedoubleEffective Price
unitintUnit Size
after_qtyintEffective Quantity (Includes filled portion)
filled_qtyintFilled Quantity
filled_moneyintFilled Amount
before_qtyintQuantity Before Modification
before_pricedoublePrice Before Modification
user_defstringUser Defined Field
last_timestringLast Modified Time
detailslistOrder History (Available in order_result_detail or order_history)
error_messagestringError 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(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​

is_success = true,
message = ,
data =[
OrderResult{ // Batch Modify Price (Using batch detailResult content)
function_type = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seq_no = 00000322356, // Sequence Number (string)
branch_no = 6460, // Branch Code (string)
account = 26, // Account (string)
order_no = x0018, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MarketType)
stock_no = 1101, // Stock Symbol (string)
buy_sell = Sell, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // 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 = Limit, // Effective Price Type (PriceType)
after_price = 41.1, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 2000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = , // Quantity Before Mod (int)
before_price = 41.3, // Price Before Mod (double)
user_def = 12345678, // User Defined Field (string)
last_time = 13:56:57.713, // Last Modified Time (string)
details = , // Order History (list)
error_message = // Error Message (string)
},
OrderResult{
function_type = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seq_no = 00000322355, // Sequence Number (string)
branch_no = 6460, // Branch Code (string)
account = 26, // Account (string)
order_no = x0017, // Order Number (string)
asset_type = 0, // Asset Type (int)
market = TAIEX, // Market (string)
market_type = Common, // Market Type (MarketType)
stock_no = 1101, // Stock Symbol (string)
buy_sell = Sell, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // 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)
...
}
]
}

// The following is an excerpt of data content
[ OrderResult{ // Batch Modify Price (Using different individual orders)
function_type = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seq_no = 00000322388, // 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 (string)
market_type = Common, // Market Type (MarketType)
stock_no = 1101, // Stock Symbol (string)
buy_sell = Sell, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // 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 = Limit, // Effective Price Type (PriceType)
after_price = 41.1, // Effective Price (double)
unit = 1000, // Unit Size (int)
after_qty = 2000, // Effective Quantity (int)
filled_qty = 0, // Filled Quantity (int)
filled_money = 0, // Filled Amount (int)
before_qty = , // Quantity Before Mod (int)
before_price = 41.3, // Price Before Mod (double)
user_def = 12345678, // User Defined Field (string)
last_time = 10:56:57.713, // Last Modified Time (string)
details = , // Order History (list)
error_message = // Error Message (string)
},
OrderResult{
function_type = 15, // Function Type (int)
date = 2023/11/22, // Trade Date (string)
seq_no = 00000322386, // 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 (string)
market_type = Common, // Market Type (MarketType)
stock_no = 1101, // Stock Symbol (string)
buy_sell = Sell, // Side (BsAction)
price_type = Limit, // Original Price Type (PriceType)
price = 41.2, // Price (double)
quantity = 5000, // 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)
...
}
]