移動鎖利條件單
trail_profit
caution
僅支援期貨日盤交易
輸入參 數
| 參數 | 類別 | 說明 | 
|---|---|---|
| account | Account | 帳號 | 
| start_date | string | 條件開始監控時間 | 
| end_date | string | 條件結束監控時間 | 
| stop_sign | StopSign | 條件停止條件 :Full 全部成交為止、Partial部分成交為止、UntilEnd效期結束為止 | 
| fut_opt_trail_order | FutOptTrailOrder | 移動鎖利條件 | 
Result 回傳
| 參數 | 類別 | 說明 | 
|---|---|---|
| isSuccess | bool | 是否成功 | 
| data | Object | 條件單回傳資訊 | 
| message | string ? (optional) | 當isSuccess = false 回傳錯誤訊息 | 
委託資訊 ConditionOrderResult 欄位
Return type : Object
| 參數 | 類別 | 說明 | 
|---|---|---|
| guid | string | 條件單號 | 
請求範例
# 設計條件內容
trail = FutOptTrailOrder(
    symbol = "TXFL4",
    price = "20000",
    direction = Direction.Up ,
    tick_num = 5,  # 漲跌 tick 數
    buy_sell = BSAction.Buy,
    lot = 2,
    price_type = FutOptConditionPriceType.MatchedPrice,
    diff = 5,     # 向上 or 向下追買 tick數 (向下為負值)
    time_in_force = TimeInForce.ROD,
    order_type = FutOptConditionOrderType.Close
)
sdk.futopt.trail_profit(target_account, "20240427","20240516", StopSign.Full, trail)
回傳範例
Result {
    is_success: True,
    message: None,
    data : ConditionOrderResult {
            guid : "44150047-8977-40b1-953c-ce270f0000"
        }
}