Skip to main content

Batch Modify Order Quantity

batch_modify_quantity

Create ModifyQuantityObj using make_modify_quantity_obj first

ParameterTypeDescription
orderResultOrderResultThe Order to be modified
quantityintModified Order Quantity (Includes filled portion of this order)

Pass the Result object into the batch_modify_quantity method.

Input Parameters

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

Return Result

ParameterTypeDescription
is_successboolIs Success
dataListReturns Modification Info
messagestringReturns Error Message when isSuccess = 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 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(target_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

{
isSuccess = true,
message = ,
data =[ OrderResult{ // Batch Modify Qty (Using batch detailResult content)
functionType = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seqNo = 00000000042, // Sequence Number (string)
branchNo = 20112, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0026, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 2881, // Stock Symbol (string)
buySell = Buy, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // 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 = , // Effective Price Type (PriceType)
afterPrice = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 1000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = 2000, // Quantity Before Mod (int)
beforePrice = , // Price Before Mod (double)
userDef = batch 2, // User Defined Field (string)
lastTime = 12:21:51.023, // Last Modified Time (string)
details = , // Order History (list)
errorMessage = // Error Message (string)
},
OrderResult{ // Batch Modify Qty (Using batch detailResult content)
functionType = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seqNo = 00000000041, // Sequence Number (string)
branchNo = 20112, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0025, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 2881, // Stock Symbol (string)
buySell = Buy, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // 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 = , // Effective Price Type (PriceType)
afterPrice = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 1000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = 2000, // Quantity Before Mod (int)
beforePrice = , // Price Before Mod (double)
userDef = batch 1, // User Defined Field (string)
lastTime = 12:21:51.023, // Last Modified Time (string)
errorMessage = // Error Message (string)
}
]
}

// The following is an excerpt of data content

[
OrderResult{ // Batch Modify Qty (Using different individual orders)
functionType = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seqNo = 00000000043, // Sequence Number (string)
branchNo = 20112, // Branch Code (string)
account = "26", // Account (string)
orderNo = x0027, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MaeketType)
stockNo = 2881, // Stock Symbol (string)
buySell = Buy, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // 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 = , // Effective Price Type (PriceType)
afterPrice = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 1000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = 2000, // Quantity Before Mod (int)
beforePrice = , // Price Before Mod (int)
userDef = Test, // User Defined Field (string)
lastTime = 12:21:53.023, // Last Modified Time (string)
details = , // Order History (list)
errorMessage = // Error Message (string)
},
OrderResult{
functionType = 20, // Function Type (int)
date = 2024/03/08, // Trade Date (string)
seqNo = 00000000044, // Sequence Number (string)
branchNo = 20112, // Branch Code (string)
account = 26, // Account (string)
orderNo = x0028, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market (string)
marketType = Common, // Market Type (MarketType)
stockNo = 2881, // Stock Symbol (string)
buySell = Buy, // Side (BsAction)
priceType = Limit, // Original Price Type (PriceType)
price = 66, // Price (double)
quantity = 2000, // 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 = , // Effective Price Type (PriceType)
afterPrice = 66, // Effective Price (double)
unit = 1000, // Unit Size (int)
afterQty = 1000, // Effective Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Amount (int)
beforeQty = 2000, // Quantity Before Mod (int)
beforePrice = , // Price Before Mod (string)
userDef = Test, // User Defined Field (string)
lastTime = 12:21:53.023, // Last Modified Time (string)
errorMessage = // Error Message (string)
}
]