根据仓位下止盈止损订单
HTTP请求
- 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", 默认"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否 |
| takeProfitType | int | false | 止盈类型 0-市价止盈 1-限价止盈 |
| takeProfitOrderPrice | decimal | true | 限价止盈委托价格 |
| stopLossType | long | true | 止损类型 0-市价止损 1-限价止损 |
| stopLossOrderPrice | decimal | true | 限价止损 委托价格 |
返回参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| id | int | 订单id |
| symbol | string | 合约名 |
| leverage | decimal | 杠杆倍数 |
| side | int | 订单方向,1:开多,2:平空,3:开空,4:平多 |
| triggerPrice | decimal | 触发价 |
| price | decimal | 执行价格 |
| vol | decimal | 下单数量 |
| openType | int | 开仓类型,1:逐仓,2:全仓 |
| triggerType | int | 触发类型,1:大于等于,2:小于等于 |
| state | int | 状态 |
| executeCycle | int | 执行周期,单位:小时 |
| trend | int | 触发价格类型,1:最新价,2:合理价,3:指数价 |
| orderType | int | 订单类型,1:限价单,2:Post Only只做Maker,3:立即成交或立即取消,4:全部成交或者全部取消,5:市价单 |
| orderId | long | 订单id,执行成功时返回 |
| errorCode | int | 执行失败时错误码,0:正常 |
| createTime | long | 创建时间 |
| updateTime | long | 修改时间 |
响应
{
"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": ""
}
]
}