Skip to main content

建立委託單

placeOrder

輸入參數

參數類別說明
accountAccount帳號
OrderObjectOrderObject委託內容

委託資訊 PlaceOrderResponse 欄位

Return type : Object

參數類別說明
orderDateString委託日期
orderTimeString委託時間
workDateString有效交易日期
isPreOrderBool預約單註記
orderNoString委託書號

請求範例

const order = {
buySell: BSAction.Buy,
symbol: "2888",
price: "8.90",
quantity: 2000,
marketType: MarketType.Common,
priceType: PriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: OrderType.Stock
};

sdk.stock.placeOrder(accounts.data[0],order,false);

回傳範例

 {
orderDate: "20241004", // 委託日期 (String)
orderTime: "152549030", // 委託時間 (String)
workDate: "20241004", // 有效交易日期 (String)
isPreOrder: false, // 委託單狀態 (Bool)
orderNo: "g0002" // 委託書編號 (String)
}