移動鎖利條件單
trailProfit
輸入參數
參數 | 類別 | 說明 |
---|---|---|
account | Account | 帳號 |
start_date | string | 條件開始監控時間 |
end_date | string | 條件結束監控時間 |
stop_sign | StopSign | 條件停止條件 : Full 全部成交為止、Partial 部分成交為止、UntilEnd 效期結束為止 |
trailOrder | TrailOrder | 移動鎖利條件 |
caution
TrailOrder 內之 基準價 (price) 只可輸入至多小數點後兩位,若超出將造成系統洗價失敗
info
當前股票價格價觸及觸發價時(以基準價計算之漲跌 % 數) 即下單
例: 若初始基準價設 100, 向下 5% 下單停損/利,初始觸發價為 95,若價格無上漲超過 100(即基準價無調整), 則市場價為 95 時將觸發條件下單
Result 回傳
參數 | 類別 | 說明 |
---|---|---|
isSuccess | bool | 是否成功 |
data | Object | 條件單回傳資訊 |
message | string ? (optional) | 當isSuccess = false 回傳錯誤訊息 |
委託資訊 ConditionOrderResult 欄位
Return type : Object
參數 | 類別 | 說明 |
---|---|---|
guid | string | 條件單號 |
reply_code | string | 回覆狀態代號 |
advisory | string | 回覆狀態內容 |
請求範例
// 設計條件內容
const trail = {
symbol: "2330",
price: "860",
direction: Direction.Down,
percentage: 5,
buySell: BSAction.Sell,
quantity: 2000,
priceType: ConditionPriceType.MatchedPrice,
diff: 5,
timeInForce: TimeInForce.ROD,
orderType: ConditionOrderType.Stock
};
sdk.stock.trailProfit(target_account, "20240427","20240516", StopSign.Full, trail)
回傳範例
{
isSuccess: true,
data : {
guid : "44150047-8977-40b1-953c-ce2XXXXXX"
}
}