Skip to main content

Place Batch Order

batch_place_order

Input Parameters

ParameterTypeMeaning
accountAccountAccount
Order_objectOrderObject (list of object)Order Object

Result

ParameterTypeMeaning
is_successboolWhether successful
dataListOrderResult list 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

orders = [
Order(
buy_sell = BSAction.Buy,
symbol = "2881",
price = "66",
quantity = 2000,
market_type = MarketType.Common,
price_type = PriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = OrderType.Stock,
user_def = "batch1" # optional field
), Order(
buy_sell = BSAction.Buy,
symbol = "2881",
price = "66.1",
quantity = 2000,
market_type = MarketType.Common,
price_type = PriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = OrderType.Stock,
user_def = "batch2" # optional field
) ]

sdk.stock.batch_place_order(target_user, orders)

Response Example

Result {
is_success: True,
message: None,
data : [ OrderResult{
function_type: 0, # Function type (int)
date: "2023/10/16", # Transaction Date (string)
seq_no: "00000000011", # Order sequence number (string)
branch_no: "6460", # Branch code (string)
account: "26", # Account (string)
order_no: None, # Order Number (string)
asset_type: 0, # Asset type (int)
market: "TAIEX", # Market Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: "2881", # Symbol (string)
buy_sell: Buy, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 66, # Price (float)
quantity: 2000, # 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: 4, # Order status (int)
after_price_type: Limit, # Valid order price type (PriceType)
after_price: 66, # 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: 0, # Valid quantity before modification (int)
before_price: 8.9, # Valid price before modification (float)
user_def: "batch1", # Custom Fields (string)
last_time: "13:33:21.817", # Last Modification Time (string)
details: None, # Order history (list)
error_message: None # Error message (string)
},
OrderResult{
function_type: 0, # Function type (int)
date: "2023/10/16", # Transaction Date (string)
seq_no: "00000000012", # Order sequence number (string)
branch_no: "6460", # Branch code (int)
account: "26", # Account (string)
order_no: None, # Order Number (string)
asset_type: None, # Asset type (int)
market: None, # Market Type (string)
market_type: Common, # Trading session type (MarketType)
stock_no: "2881", # Symbol (string)
buy_sell: Buy, # Buy/sell side (BSAction)
price_type: Limit, # Original order price type (PriceType)
price: 66.1, # Price (float)
quantity: 2000, # 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: 4, # Order status (int)
after_price_type: Limit, # Valid order price type (PriceType)
after_price: 66.1, # Valid order price (float)
unit: None, # Trading unit (int)
after_qty: 2000, # Valid order quantity (int)
filled_qty: 0, # Filled quantity (int)
filled_money: 0, # Filled amount (int)
before_qty: 0, # Valid quantity before modification (int)
before_price: 66.1, # Valid price before modification (float)
user_def: "batch2", # Custom Fields (string)
last_time: "13:33:21.817", # Last Modification Time (string)
details: None, # Order history (list)
error_message: None # Error message (string)
}]}