跳转至

创建止盈止损单

地址: /v1/futures/order/place_strategy

接收参数

需要

提交方式:post

示例

Bash
curl -X POST "https://oapi.websea.com/v1/futures/order/place_strategy" 
  -H "Content-Type: application/x-www-form-urlencoded" 
  -H "Token: YOUR_TOKEN" 
  -H "Nonce: 1700000000_abcd1" 
  -H "Signature: GENERATED_SIGNATURE" 
  --data-urlencode "strategy_type=1" 
  --data-urlencode "symbol=ETH-USDT" 
  --data-urlencode "margin_mode=1" 
  --data-urlencode "side=1" 
  --data-urlencode "price=1865.5" 
  --data-urlencode "quantity=100" 
  --data-urlencode "trigger_price=1850" 
  --data-urlencode "stop_loss_price=1830" 
  --data-urlencode "take_profit_price=1900"

提交参数

参数名 是否必需 类型 示例 说明
strategy_type num 1 止盈止损类型;
1:普通止盈止损(包括市价、限价)
2:仓位止盈止损(仓位止盈止损不传数量)
3:移动止盈止损
symbol string ETH-USDT 合约交易对名称
margin_mode string 1 保证金模式:
1:逐仓
2:全仓
side number 1 方向:
1:多
2:空
price number 1 委托价。不传/空表示市价;传值表示限价。当 strategy_type=1 且走限价止盈止损时使用
quantity number 100 数量(单位:张,需 >0)。strategy_type=1/3 时必填;strategy_type=2 时不传(系统按整仓处理)
trigger_price string 5 触发价。strategy_type=1 且传了 price(限价)时必填;strategy_type=3 建议必填(激活价)
stop_loss_price string 3 止损价格。(需 >0 且不超过交易对价格精度)
take_profit_price string 7 止盈价格。(需 >0 且不超过交易对价格精度)
callback_rate num 0.2 回调幅度(如 20%=0.2)。strategy_type=3 时必填;取值范围:[0.0001-0.1]

返回参数

参数名 是否必需 类型 示例 说明
errno int 0 返回状态码
errmsg string ok 返回信息
result obj 见示例 返回数据

result参数

参数名 是否必需 类型 示例 说明
order_id string BL786401542840282676 订单id;当strategy_type=1且是市价时(price为空),该订单号会返回两个单号并以英文逗号隔开,第一个是止盈订单号,第二个是止损订单号

返回示例

JSON
{
  "errno": 0,
  "errmsg": "ok",
  "result": {
    "order_id": "BL786401542840282676"
  }
}