Skip to main content

批次修改委託價格

BatchModifyPrice

先使用 MakeModifyPriceObj 建立 FutOptModifyPrice物件

參數類別說明
orderResultFutOptOrderResult預計修改的委託單
pricestring修改後的價格
priceTypeFutOptPriceType修改後的價格旗標
caution

當 price 欄位有填入值時,priceType 需為null ; 當 priceType 欄位有填入值時,price 需為null

將回傳的物件放入 BatchModifyPrice 的方法中

輸入參數

參數類別說明
accountAccount帳號
FutOptModifyPriceFutOptModifyPrice(list of object)批次修改委託單內容

Result 回傳

參數類別說明
isSuccessbool是否成功
dataList回傳修改資訊
messagestring當isSuccess = False 回傳錯誤訊息

修改資訊 FutOptOrderResult 欄位

Return type : Object

參數類別說明
functionTypeint功能別 : 0 新單 、10 新單執行、 15 改價、 20 改量、30刪單 、90失敗
datestring交易日期
seqNostring委託單流水序號
branchNostring分公司代號
accountstring帳號
orderNostring委託書號
assetTypeint資產類別 : 1 期貨 、2 選擇權
marketstring市場類型 : TAIMEX 期貨、選擇權
marketTypeFutOptMarketType盤別種類 : Future 期貨日盤 、 Option 選擇權日盤 、 FutureNight 期貨夜盤 、 OptionNight 選擇權夜盤
unitint單位數
currencystring幣別
symbolstring商品代號
expiryDatestring到期日
strikePricedouble履約價
callPutLeg2CallPut買賣權 : Call 買權、 Put 賣權
buySellBsAction買賣別 : Buy 買 、 Sell
symbolLeg2string商品代號 - 複式第二隻腳
expiryDateLeg2string到期日 - 複式第二隻腳
strikePriceLeg2double履約價 - 複式第二隻腳
callPutLeg2CallPut買賣權 - 複式第二隻腳 : Call 買權、 Put 賣權
buySellLeg2BsAction買賣別 - 複式第二隻腳: Buy 買 、 Sell
priceTypeFutOptPriceType原始委託價格別 : Limit 限價 、 Market 市價 、 RangeMarket 範圍市價、Reference 參考價
pricedouble價格
lotint原始委託股口數
timeInForceTimeInforce委託條件別 : Rod ROD 、 FOK FOK 、 IOC IOC
orderTypeFutOptOrderType委託單類型 : New 新倉 、 Close 平倉 、 Auto 自動 、 FdayTrade 當沖
isPreOrderbool是否為預約單
statusint委託單狀態 : 0 預約單 、 4 中台收到委託 、 8 後台傳送中 、 9 後台連線逾時 、10 委託成功 、 30刪單成功 、 50 完全成交 、 90 失敗
afterPriceTypeFutOptPriceType有效委託價格別 : Limit 限價 、 Market 市價 、RangeMarket 範圍市價、 Reference 參考價
afterPricedouble有效委託價格
afterLotint有效委託口數
filledLotint成交口數
filledMoneydouble成交價金
beforeLotint改單前有效口數
beforePricedouble改單前有效價
userDefstring自訂欄位
lastTimestring最後異動時間
detaillist委託歷程 (查詢OrderResultDetail or OrderHistory才有值)
errorMessagestring錯誤訊息

請求範例

// 批次改價(利用batch detail回傳的內容改單)
var modified_orders = new List<FutOptModifyPrice> {
sdk.FutOpt.MakeModifyPriceObj(batch_result.data[0], "19900", null),
sdk.FutOpt.MakeModifyPriceObj(batch_result.data[1], "19900", null)
};

var batch_modify_price = sdk.FutOpt.BatchModifyPrice(account, modified_orders);
Console.WriteLine(batch_modify_price);


// 批次改價(利用不同的單筆委託)
var modified_orders = new List<FutOptModifyPrice> {
sdk.FutOpt.MakeModifyPriceObj(orderResults.data[37], "19900", null),
sdk.FutOpt.MakeModifyPriceObj(orderResults.data[35], "19900", null)
};

var batch_modify_price = sdk.FutOpt.BatchModifyPrice(account, modified_orders);
Console.WriteLine(batch_modify_price);

回傳範例

{
isSuccess = True,
message = ,
data =[
FutOptOrderResult{ // 批次改價(利用batch detail回傳的內容改單)
function_type = 15, // 功能別 (int)
date = 2024/03/25, // 交易日期 (string)
seq_no = 00110212664, // 委託單流水序號 (string)
branch_no = 15901, // 分公司代號 (string)
account = 1234567, // 帳號 (string)
order_no = C0006, // 委託書號 (string)
asset_type = 1, // 資產類別 (int)
market = TAIMEX, // 市場類型 (string)
market_type = Future, // 盤別種類 (FutOptMarketType)
unit = , // 單位數 (int)
currency = TWD, // 幣別 (string)
symbol = FITX, // 商品代號 (string)
expiry_date = 0, // 到期日 (string)
strike_price = 0, // 履約價 (double)
call_put = , // 買賣權 (string)
buy_sell = Buy, // 買賣別 (BsAction)
symbol_leg2 = , // 商品代號 - 複式第二隻腳 (string)
expiry_date_leg2 = , // 到期日 - 複式第二隻腳 (string)
strike_price_leg2 = , // 履約價 - 複式第二隻腳 (double)
call_put_leg2 = , // 買賣權 - 複式第二隻腳 (string)
buy_sell_leg2 = , // 買賣別 - 複式第二隻腳 (BsAction)
price_type = Limit, // 原始委託價格別 (FutOptPriceType)
price = 20000, // 價格 (double)
lot = 1, // 原始委託股口數 (int)
time_in_force = Rod, // 委託條件別 (TimeInforce)
order_type = New, // 委託單類型 (FutOptOrderType)
is_pre_order = false, // 是否為預約單 (bool)
status = 10, // 委託單狀態 (int)
after_price_type = Limit, // 有效委託價格別 (FutOptPriceType)
after_price = 19900, // 有效委託價格 (double)
after_lot = 1, // 有效委託股口數 (int)
filled_lot = 0, // 成交股口數 (int)
filled_money = 0, // 成交價金 (int)
before_lot = 0, // 改單前有效股口數 (int)
before_price = 20000, // 改單前有效價格 (double)
user_def = , // 自訂欄位 (string)
last_time = 13:39:05, // 最後異動時間 (string)
detail = , // 委託歷程 (list)
error_message = // 錯誤訊息 (string)
},
FutOptOrderResult{
function_type = 15, // 功能別 (int)
date = 2024/03/25, // 交易日期 (string)
seq_no = 00110212665, // 委託單流水序號 (string)
branch_no = 15901, // 分公司代號 (string)
account = 1234567, // 帳號 (string)
order_no = C0007, // 委託書號 (string)
asset_type = 1, // 資產類別 (int)
market = TAIMEX, // 市場類型 (string)
market_type = Future, // 盤別種類 (FutOptMarketType)
unit = , // 單位數 (int)
currency = TWD, // 幣別 (string)
symbol = FITX, // 商品代號 (string)
expiry_date = 0, // 到期日 (string)
strike_price = 0, // 履約價 (double)
call_put = , // 買賣權 (string)
buy_sell = Buy, // 買賣別 (BsAction)
symbol_leg2 = , // 商品代號 - 複式第二隻腳 (string)
expiry_date_leg2 = , // 到期日 - 複式第二隻腳 (string)
strike_price_leg2 = , // 履約價 - 複式第二隻腳 (double)
call_put_leg2 = , // 買賣權 - 複式第二隻腳 (string)
buy_sell_leg2 = , // 買賣別 - 複式第二隻腳 (BsAction)
price_type = Limit, // 原始委託價格別 (FutOptPriceType)
price = 20000, // 價格 (double)
lot = 1, // 原始委託股口數 (int)
time_in_force = Rod, // 委託條件別 (TimeInforce)
order_type = New, // 委託單類型 (FutOptOrderType)
is_pre_order = false, // 是否為預約單 (bool)
status = 10, // 委託單狀態 (int)
...
}
]
}

以下擷取data內容
[ FutOptOrderResult{ // 批次改價(利用不同的單筆委託)
function_type = 15, // 功能別 (int)
date = 2024/03/25, // 交易日期 (string)
seq_no = 00110212668, // 委託單流水序號 (string)
branch_no = 15901, // 分公司代號 (string)
account = 1234567, // 帳號 (string)
order_no = C0008, // 委託書號 (string)
asset_type = 1, // 資產類別 (int)
market = TAIMEX, // 市場類型 (string)
market_type = Future, // 盤別種類 (FutOptMarketType)
unit = , // 單位數 (int)
currency = TWD, // 幣別 (string)
symbol = FITX, // 商品代號 (string)
expiry_date = 0, // 到期日 (string)
strike_price = 0, // 履約價 (double)
call_put = , // 買賣權 (string)
buy_sell = Buy, // 買賣別 (BsAction)
symbol_leg2 = , // 商品代號 - 複式第二隻腳 (string)
expiry_date_leg2 = , // 到期日 - 複式第二隻腳 (string)
strike_price_leg2 = , // 履約價 - 複式第二隻腳 (double)
call_put_leg2 = , // 買賣權 - 複式第二隻腳 (string)
buy_sell_leg2 = , // 買賣別 - 複式第二隻腳 (BsAction)
price_type = Limit, // 原始委託價格別 (FutOptPriceType)
price = 20000, // 價格 (double)
lot = 1, // 原始委託股口數 (int)
time_in_force = Rod, // 委託條件別 (TimeInforce)
order_type = New, // 委託單類型 (FutOptOrderType)
is_pre_order = false, // 是否為預約單 (bool)
status = 10, // 委託單狀態 (int)
after_price_type = Limit, // 有效委託價格別 (FutOptPriceType)
after_price = 19900, // 有效委託價格 (double)
after_lot = 1, // 有效委託股口數 (int)
filled_lot = 0, // 成交股口數 (int)
filled_money = 0, // 成交價金 (int)
before_lot = 0, // 改單前有效股口數 (int)
before_price = 20000, // 改單前有效價格 (double)
user_def = , // 自訂欄位 (string)
last_time = 13:39:05, // 最後異動時間 (string)
error_message = // 錯誤訊息 (string)
},
FutOptOrderResult{
function_type = 15, // 功能別 (int)
date = 2024/03/25, // 交易日期 (string)
seq_no = 00110212664, // 委託單流水序號 (string)
branch_no = 15901, // 分公司代號 (string)
account = 1234567, // 帳號 (string)
order_no = C0009, // 委託書號 (string)
asset_type = 1, // 資產類別 (int)
market = TAIMEX, // 市場類型 (string)
market_type = Future, // 盤別種類 (FutOptMarketType)
unit = , // 單位數 (int)
currency = TWD, // 幣別 (string)
symbol = FITX, // 商品代號 (string)
expiry_date = 0, // 到期日 (string)
strike_price = 0, // 履約價 (double)
call_put = , // 買賣權 (string)
buy_sell = Buy, // 買賣別 (BsAction)
symbol_leg2 = , // 商品代號 - 複式第二隻腳 (string)
expiry_date_leg2 = , // 到期日 - 複式第二隻腳 (string)
strike_price_leg2 = , // 履約價 - 複式第二隻腳 (double)
call_put_leg2 = , // 買賣權 - 複式第二隻腳 (string)
buy_sell_leg2 = , // 買賣別 - 複式第二隻腳 (BsAction)
price_type = Limit, // 原始委託價格別 (FutOptPriceType)
price = 20000, // 價格 (double)
lot = 1, // 原始委託股口數 (int)
time_in_force = Rod, // 委託條件別 (TimeInforce)
order_type = New, // 委託單類型 (FutOptOrderType)
is_pre_order = false, // 是否為預約單 (bool)
status = 10, // 委託單狀態 (int)
...
}
]