Skip to main content

Create Order

place_order

Input Parameters

ParameterTypeDescription
accountAccountAccount
orderObjectOrderObjectOrder content
unblockbool (optional) (default = false)Whether non-blocking

Result Response

ParameterTypeDescription
is_successboolWhether successful
dataOrderResultReturned order result
messagestringError message when is_success = False

Order Information Fields (OrderResult)

Return type: Object

ParameterTypeDescription
function_typeintFunction type: 0 New, 10 Execute, 15 Modify Price, 20 Modify Qty, 30 Cancel, 90 Failed
datestringTrade date
seq_nostringOrder sequence number
branch_nostringBranch code
accountstringAccount
order_nostringOrder number
asset_typeintAsset type: 0 Stock
marketstringMarket type: TAIEX Main Board, TAISDAQ OTC, TAIEMG Emerging
market_type[MarketType]Market category: COMMON Regular, FIXING Closing, INTRADAY_ODD Odd-lot Intraday, ODD Odd-lot After, EMG Emerging, EMG_ODD Emerging Odd-lot
stock_nostringStock code
buy_sell[BSAction]Buy/Sell: BUY Buy, SELL Sell
price_type[PriceType]Price type: LIMIT Limit, LIMIT_UP Upper Limit, LIMIT_DOWN Lower Limit, MARKET Market, REFERENCE Reference
pricedoublePrice
quantityintOriginal order quantity
time_in_force[TimeInForce]Time condition: ROD, FOK, IOC
order_type[OrderType]Order type: STOCK Cash, MARGIN Margin, SHORT Short, DAY_TRADE Day Trade, SBL Securities Lending
is_pre_orderboolWhether pre-order
statusintOrder status: 0 Pre-order, 4 Sent, 9 Timeout, 10 Success, 30 Cancel Success, 40 Partial Fill Cancel, 50 Fully Filled, 90 Failed
after_price_type[PriceType]Effective price type after modification
after_pricedoubleEffective price after modification
unitintUnit count
after_qtyintEffective quantity after modification
filled_qtyintFilled quantity
filled_moneyintFilled amount
before_qtyintQuantity before modification
before_pricedoublePrice before modification
user_defstringCustom field
last_timestringLast update time
detailslistOrder history
error_messagestringError message

Request Example

Order order = Order{
BsAction::BUY,
"2888",
"9.0",
1,
MarketType::INTRADAY_ODD,
PriceType::LIMIT,
TimeInForce::ROD,
OrderType::STOCK,
"c++"
};

auto order_result = sdk->stock->place_order(target_account, order, false);

Response Example

{
isSuccess = true,
message = ,
data = OrderResult{
functionType = 0,
date = 2023/10/13,
seqNo = 00000000007,
branchNo = 6460,
account = 26,
orderNo = bA619,
assetType = 0,
market = TAIEX,
marketType = COMMON,
stockNo = 2888,
buySell = BUY,
priceType = LIMIT,
price = 9.1,
quantity = 3000,
timeInForce = ROD,
orderType = STOCK,
isPreOrder = false,
status = 10,
afterPriceType = LIMIT,
afterPrice = 9.1,
unit = 1000,
afterQty = 3000,
filledQty = 0,
filledMoney = 0,
beforeQty = 0,
beforePrice = 9.1,
userDef = ,
lastTime = 12:10:12.546,
details = ,
errorMsg =
}
}