跳到主要内容

根据仓位下止盈止损订单

HTTP请求

  • POST /api/v1/private/stoporder/place

接口权限要求: 交易下单

请求参数

参数名类型是否必填说明
lossTrendinttrue止损类型:1最新价2合理价3指数价
profitTrendinttrue止盈类型:1最新价2合理价3指数价
positionIdlongtrue仓位id
voldecimaltrue委托数量,必须在合约对允许的下单范围之内,委托数量加上已有的止盈止损委托数量必须小于可平仓的数量,不会对仓位数量进行冻结,但是需要判断
stopLossPricedecimalfalse止损价,和止盈价至少有一个不为空,且必须大于0
takeProfitPricedecimalfalse止盈价,和止损价至少有一个不为空,且必须大于0
priceProtectintfalse条件单触发保护:"1","0", 默认"0"不开启。 仅 计划委托/止盈止损下单时需要此参数
profitLossVolTypestringfalse止盈止损数量类型(SAME: 数量相同;SEPARATE:数量不同)
takeProfitVoldecimalfalse止盈数量 (profitLossVolType == SEPARATE时处理)
stopLossVoldecimalfalse止损数量 (profitLossVolType == SEPARATE时处理)
volTypeintfalse数量类型1、分批止盈止损2、仓位止盈止损
takeProfitReverseintfalse止盈反手:1是2否
stopLossReverseintfalse止损反手:1是2否
takeProfitTypeintfalse止盈类型 0-市价止盈 1-限价止盈
takeProfitOrderPricedecimaltrue限价止盈委托价格
stopLossTypelongtrue止损类型 0-市价止损 1-限价止损
stopLossOrderPricedecimaltrue限价止损 委托价格

返回参数

参数名类型说明
idint订单id
symbolstring合约名
leveragedecimal杠杆倍数
sideint订单方向,1:开多,2:平空,3:开空,4:平多
triggerPricedecimal触发价
pricedecimal执行价格
voldecimal下单数量
openTypeint开仓类型,1:逐仓,2:全仓
triggerTypeint触发类型,1:大于等于,2:小于等于
stateint状态
executeCycleint执行周期,单位:小时
trendint触发价格类型,1:最新价,2:合理价,3:指数价
orderTypeint订单类型,1:限价单,2:Post Only只做Maker,3:立即成交或立即取消,4:全部成交或者全部取消,5:市价单
orderIdlong订单id,执行成功时返回
errorCodeint执行失败时错误码,0:正常
createTimelong创建时间
updateTimelong修改时间

响应

{
"success": false,
"code": 0,
"message": "",
"data": [{
"id": 0,
"symbol": "",
"leverage": 0,
"side": 0,
"triggerPrice": 0.0,
"price": 0.0,
"vol": 0.0,
"openType": 0,
"triggerType": 0,
"state": 0,
"executeCycle": 0,
"trend": 0,
"orderType": 0,
"orderId": 0,
"errorCode": 0,
"createTime": "",
"updateTime": ""
}

]
}