Ws 合约批量下单
place_batch_orders
是否验签: 是
接口权限: 交易
限频: 共享REST限频次数。
接口描述: 该接口仅支持websocket合约批量下单。
订阅地址
线上环境
wss://api.sunx.io/ws/v1/trade
线上环境(aws客户首选)
wss://api.sunx.io/ws/v1/trade
订阅参数
op
string
必填;操作名称为 place_batch_orders;
cid
string
选填; 请求唯一 ID
data
array
批量下单的参数
请求参数
<data>
true
订单参数
contract_code
String
true
合约代码
margin_mode
String
true
保证金模式 cross:全仓 ;
position_side
String
false
仓位方向
"long":多 "short":空 “both”:单向持仓,开平模式必填,买卖模式默认为both。
side
String
true
订单方向
buy:买 "sell":卖
type
String
true
订单类型;枚举
"market": 市价,"limit":限价, "post_only":只做maker
price_match
String
false
最优档位,和price互斥
opponent-对手价、"optimal_5":最优5档,"optimal_10":最优10档,"optimal_20":最优20档
time_in_force
String
false
枚举fok, ioc, gtc,非必填,默认是gtc
client_order_id
String
false
用户自定义订单ID
[1-9223372036854775807]
price
String
false
价格,仅当限价单的时候有效,市价无需输入。
volume
String
true
委托张数。
reduce_only
Integer
false
只减仓 0-否,1-是
tp_trigger_price
String
false
止盈触发价格
tp_order_price
String
false
止盈委托价格(最优N档委托类型时无需填写价格)
tp_type
String
false
止盈委托类型,不填默认为market;市价:market,限价:limit ,最优5档: optimal_5,最优10档:optimal_10,最优20档:optimal_20
tp_trigger_price_type
String
false
止盈价格触发类型,默认是最新价
"last":最新价,"mark":标记价格
sl_trigger_price
String
false
止损触发价格
sl_order_price
String
false
止损委托价格(最优N档委托类型时无需填写价格)
sl_type
String
false
止损委托类型,不填默认为market; 市价:market,限价:limit ,最优5档: optimal_5,最优10档:optimal_10,最优20档:optimal_20
sl_trigger_price_type
String
false
止损价格触发类型,默认是最新价
"last":最新价,"mark":标记价格
price_protect
boolean
false
价差保护,默认为false。仅当设置止盈/止损需要该参数。
false 或者 true
self_match_prevent
String
false
防自成交
cancel_taker :撤销taker单 cancel_maker:撤销maker单 cancel_both:撤销全部订单
默认为 cancel_taker
<data>
false
cid
string
false
表示本次请求id
备注: 备注: position_side持仓方向 单向持仓模式下此参数非必填 如果填写仅可以选择both;在双向持仓模式下必填,且仅可选择 long 或 short。 双向持仓模式下,side和position_side需要进行组合 买入开多(side 填写 buy; position_side 填写 long ) 卖出开空(side 填写 sell; position_side 填写 short ) 卖出平多(side 填写 sell;position_side 填写 long ) 买入平空(side 填写 buy; position_side 填写 short ) 单向持仓模式下,多仓返回buy,空仓返回sell
返回参数
code
int
true
响应编码
200:成功、非200:失败
message
String
true
响应描述
<data>
object
true
code
int
true
下单响应编码
200:成功、非200:失败
message
String
true
下单响应描述
order_id
String
true
订单ID
client_order_id
String
false
用户下单时填写的客户端订单ID,没填则不返回
</data>
false
ts
long
true
响应生成时间点,单位:毫秒
订阅示例
订阅成功示例
最后更新于