根据仓位下止盈止损订单
响应示例
{
"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": ""
}
]
}
- POST
/api/v1/private/stoporder/place
需要权限: 交易下单
请求参数:
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| lossTrend | int | true | 止损类型:1最新价2合理价3指数价 |
| profitTrend | int | true | 止盈类型:1最新价2合理价3指数价 |
| positionId | long | true | 仓位id |
| vol | decimal | true | 委托数量,必须在合约对允许的下单范围之内,委托数量加上已有的止盈止损委托数量必须小于可平仓的数量,不会对仓位数量进行冻结,但是需要判断 |
| stopLossPrice | decimal | false | 止损价,和止盈价至少有一个不为空,且必须大于0 |
| takeProfitPrice | decimal | false | 止盈价,和止损价至少有一个不为空,且必须大于0 |
| priceProtect | int | false | 触发保护:"1","0" |
| profitLossVolType | string | false | 止盈止损数量类型(SAME: 数量相同;SEPARATE:数量不同) |
| takeProfitVol | decimal | false | 止盈数量 (profitLossVolType == SEPARATE时处理) |
| stopLossVol | decimal | false | 止损数量 (profitLossVolType == SEPARATE时处理) |
| volType | int | false | 数量类型1、分批止盈止损2、仓位止盈止 |
| takeProfitReverse | int | false | 止盈反手:1是2否 |
| stopLossReverse | int | false | 止损反手:1是2否 |
| mtoken | string | false | web端设备id |
| takeProfitType | int | false | 止盈类型 0-市价止盈 1-限价止盈 |
| takeProfitOrderPrice | decimal | true | 限价止盈委托价格 |
| stopLossType | long | true | 止损类型 0-市价止损 1-限价止损 |
| stopLossOrderPrice | decimal | true | 限价止损 委托价格 |
响应参数:
成功时,success =true,data值为订单id,success =false,失败data=null,如果存在相同止盈止损价格且非终态的委托单,则返回之前的id,并异步更新之前委托单的数量