Comment on page
下單設定
new_order("XXXXXXXXXXXXXX", OrderData)
XXXXXXXXXXXXXX→帶入交易連線的SessionKey
OrderData→下單參數
OrderData = {"BrokerID":"XXXXX",
"Account":"XXXXX",
"Symbol":"XXXXX",
"Price":"XXXXX",
"StopPrice":"XXXXX",
......}
參數 | 說明 |
BrokerID | 券商 |
Account | 資金帳戶 |
Symbol | 商品代碼 |
Price | 委託價格 or 欄位 +/- 價格 欄位為固定字,可為LAST or BID or ASK or MID or FILLED FILLED為OTO,OTOCO使用,其他單不可使用FILLED ex. FILLED-15 |
StopPrice | 停損價 or 欄位 +/- 價格 欄位為固定字,可為LAST or BID or ASK or MID or FILLED FILLED為OTO,OTOCO使用,其他單不可使用FILLED |
Side | 買賣別(複式單為整體買賣方向)1:買方 2:賣方 |
TimeInForce | 0:None 1:ROD Day order 2:IOC/FAK Immediate or Cancel/Fill and Kill 3:FOK Fill or Kill 4:GTC Good-Till-Cancel 5:GTD Good-Till-Date 6:OPG 盤前預約單 |
OrderType | 1:Market order(MARKET) 2:Limit order(LIMIT) 3:Stop order(STOP) 4:Stop limit order(STPLMT) 5:Trailing Stop(TSTOP) 6:Trailing StopLimit(TSTPLMT) 7:Market if Touched Order(MIT) 8:Limit if Touched Order(LIT) 9:Trailing Limit(TLMT) 12:DOM-Triggered Stop(DTS) 13:DOM-Triggered Stop Limit(DTSL) 14:Breakeven(BE) 24:市價轉限價(MTL) 25:一定範圍市價(MWP) |
ContingentSymbol | 追蹤Symbol 僅Synthetic = 1 OrderType=7 或 OrderType=8使用 |
TrailingField | 僅Synthetic = 1 OrderType=5 或 OrderType=6使用 0:None 1:Last 2:Bid 3Ask |
TrailingType | 僅Synthetic = 1 OrderType=5 或 OrderType=6使用 0:None
1:依價格 2:依TrailingPrice百分比 3:依TickSize幾跳 |
TrailingAmount | 僅Synthetic = 1 OrderType=5 或 OrderType=6使用 TrailingType=1時,TrailingAmount為百分比
TrailingType=2時,TrailingAmount為點數 TrailingType=3時,TrailingAmount為幾跳 |
TouchPrice | 僅Synthetic = 1 OrderType=7 或 OrderType=8使用 觸發價 or 欄位 +/- 價格
欄位為固定字,可為LAST or BID or ASK or FILLED FILLED為OTO,OTOCO使用,其他單不可使用FILLED |
TouchField | 僅Synthetic = 1 OrderType=3 或 OrderType=4 或 OrderType=7 或 OrderType=8 或 OrderType=12 或 OrderType=13使用 0:None 1:Last 2:Bid 3:Ask |
TouchCondition | 僅Synthetic = 1 OrderType=7 或 OrderType= 8使用 0:touch or 穿價 1:Greater 2:GreaterEqual 3:Equl 4:LessEqual 5:Less |
OrderQty | 下單口數 |
PositionEffect | 0:Open Open position 1:Close Close position 4:Auto Auto select Open/Close position |
DayTrade | 0:None 1:當沖 |
Synthetic | 0:None 1:Synthetic |
GroupType | 0:None 1:Normal 2:OCO 3:OTO 4:OTOCO
5:OTOs(單線) |
GroupID | GroupID or OCOID or OTOID or OTOCOID or OTOSID |
ChasePrice | 追價 格式為[每次增加價格|追價幾次|每次追價幾秒最後下市價或刪單或掛單(M or C or L)|PriceType 限價追價 |
SlicedType | 不支援群組單 0 : None 1 : Iceberg 2 : TimeSliced 3 : VolumeSliced 4 : AllSliced 5 : AllSliced After PriceTrigger |
DiscloseQty | 僅SlicedType =1 或 SlicedType =2 或SlicedType =3 或SlicedType =4或SlicedType =5使用
逐筆揭露數量 |
Variance | 僅SlicedType =1 或 SlicedType =2或 SlicedType =3使用
逐筆變動比例% |
Interval | 僅SlicedType =2或 SlicedType =3使用
SlicedType =2 : 間隔時間,ms SlicedType =3 : 間隔成交量 |
LeftoverAction | 僅SlicedType =2或 SlicedType =3使用
0 : Leave 繼續掛著(預設)
1 : Merge 取消該筆,剩餘數量加入下筆下單
2 : Market 轉市價單
3 : Payup 追價(未實做) |
SlicedPriceField | 0 -> Fixed price mode 非0 -> Relative price mode
0 : None
1 : Last
2 : Bid
3 : Ask |
SlicedTicks | SlicedPriceField != 0 TickSize幾跳 |
Breakeven | 僅OrderType=14使用 Breakeven觸發價/欄位 +/- 價格 欄位為固定字, 可為LAST or BID or ASK or FILLED FILLED為OTO, OTOCO使用, 其他單不可使用FILLED |
BreakevenOffset | 僅OrderType=14使用 Breakeven停損價/欄位 +/- 價格 欄位為固定字, 可為LAST or BID or ASK or FILLED FILLED為OTO, OTOCO使用, 其他單不可使用FILLED |
Threshold | 僅OrderType=12或OrderType=13使用 |
ExtCommands | 延伸下單參數 多個參數請用;隔開 1.自動單反向延遲 請帶 DelayTransPosition=3000 表延遲3秒 2.下單前 將平倉掛單都刪單 CancelCloseWorking=1 or 2 3.下單速度是否調慢與設定相同 FitOrderFreq=1 |
Consecutive | 1 : 連續送單 2:TW連續IOC |
NumberOfRetries | 僅Consecutive=1使用 |