Skip to main content

Batch Modify Price

batch_modify_price

First, use make_modify_price_obj to create a ModifyPriceObj object

ParameterTypeMeaning
orderOrderResultThe intended order result object to be modified
pricestringThe price after modification
price_typePriceTypeThe price type after modification (Note.: The Co-lo version has enabled the use of PriceType.)
caution

When 'price' is filled, priceType should be empty or None ; otherwise, the 'price' field should be empty or None

Put the returned object into the 'modify_price' function

Input Parameters

ParameterTypeMeaning
accountAccountAccount
ordersModifyPriceObj (list)The object for price modification

Result

ParameterTypeMeaning
is_successboolWhether successful
dataListModified content is returned
messagestringError message returned when is_success = false

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
function_typeintFunction Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed
datestringTransaction Date
seq_nostringOrder Serial Number
branch_nostringBranch Number
accountstringAccount
order_nostringOrder Number
asset_typeintAsset Type : 0 Stock
marketstringMarket Type : TAIEX Listed, TAISDAQ OTC, TAIEMG EMG
market_typeMarketTypeTrading Session Type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd
stock_nostringSymbol
buy_sellBSActionBuy/Sell Type : Buy, Sell
price_typePriceTypeOriginal Order Price Type : Limit, LimitUp, LimitDown, Market, Reference
pricefloatOrder Price
quantityintOriginal Order Quantity
time_in_forceTimeInforceTime In Force : ROD FOK, IOC
order_typeOrderTypeOrder Type : Stock, Margin, Short, DayTrade, SBL
is_pre_orderboolReservation Order Flag
statusintOrder Status, for details please refer to STATUS
after_price_typePriceTypeValid Order Price Type : Limit, LimitUp, LimitDown, Market, Reference
after_pricefloatValid Order Price
unitintTrading Unit
after_qtyintValid Order Quantity (filled quantity included)
filled_qtyintFilled Quantity
filled_moneyintFilled Value
before_qtyintBefore the Quantity Modification
before_pricefloatBefore the Price Modification
user_defstringCustom Fields
last_timestringLast Modification Time
detailslistOrder Process (Return value when query order_result_detail or order_history )
error_messagestringError Message

Request Example

# Batch price modification ( modifying orders using the content returned by batch detail )
modify_objects = [
sdk.stock.make_modify_price_obj(batch_results_detail.data[0], "41.1"),
sdk.stock.make_modify_price_obj(batch_results_detail.data[1], "41.2"),
]
sdk.stock.batch_modify_price(target_user, modify_objects)


# Batch price modification ( Using different individual orders )
modify_objects = [
sdk.stock.make_modify_price_obj(orders.data[37], "41.1"),
sdk.stock.make_modify_price_obj(orders.data[35], "41.2"),
]

sdk.stock.batch_modify_price(target_user, modify_objects)

Response Example

Result {
is_success: True,
message: None,
data : [ OrderResult{# Batch price modification ( modifying orders using the content returned by batch detail )
function_type: 15, # Function type (int)
date: "2023/11/22", # Transaction Date (string)
seq_no: "00000322356", # Order 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 Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # 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: Limit, # Valid order price type (PriceType)
after_price: 41.1, # Valid order price (float)
unit: 1000, # Trading unit (int)
after_qty: 2000, # Valid order quantity (int)
filled_qty: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_qty: None, # Valid quantity before modification (int)
before_price: 41.3, # Valid price before modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "13:56:57.713", # Last Modification Time (string)
details: None, # Order history (list)
error_message: None # Error message (string)
},
OrderResult{
function_type: 15, # Function type (int)
date: "2023/11/22", # Transaction Date (string)
seq_no: "00000322355", # Order 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 Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: 1101, # Symbol (string)
buy_sell: Sell, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # 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)
...
}]
}


以下範例擷取data內容

[ OrderResult{# Batch price modification ( Using different individual orders )
function_type: 15, # Function type (int)
date: "2023/11/22", # Transaction Date (string)
seq_no: "00000322388", # Order 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 Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: 1101, # Symbol (string)
buy_sell: Sell, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # 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: Limit, # Valid order price type (PriceType)
after_price: 41.1, # Valid order price (float)
unit: 1000, # Trading unit (int)
after_qty: 2000, # Valid order quantity (int)
filled_qty: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_qty: None, # Valid quantity before modification (int)
before_price: 41.3, # Valid price before modification (float)
user_def: "12345678", # Custom Fields (string)
last_time: "10:56:57.713", # Last Modification Time (string)
details: None, # Order history (list)
error_message: None # Error message (string)
},
OrderResult{
function_type: 15, # Function type (int)
date: "2023/11/22", # Transaction Date (string)
seq_no: "00000322386", # Order 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 Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: "1101", # Symbol (string)
buy_sell: Sell, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 41.2, # Price (float)
quantity: 5000, # 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)
...
}]