> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monochrome.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# 计划委托、止盈止损与追踪委托

> 合约 API：计划委托、止盈止损与追踪委托。

## 创建计划委托

`POST` `/future/trade/v1/entrust/create-plan`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| clientOrderId | string | false | N/A | 自定义订单id | |
| symbol | string | true | | 交易对 | |
| orderSide | string | true | N/A | 买卖方向：BUY;SELL | BUY;SELL |
| entrustType | string | true | N/A | 委托类型：TAKE\_PROFIT(止盈限价单)；STOP(止损限价单)；TAKE\_PROFIT\_MARKET（止盈市价单）；STOP\_MARKET（止损市价单） | TAKE\_PROFIT;STOP;TAKE\_PROFIT\_MARKET;STOP\_MARKET |
| origQty | number | true | N/A | 数量（张） | |
| price | number | false | N/A | 价格 | |
| stopPrice | number | true | N/A | 触发价 | |
| timeInForce | string | true | N/A | 有效方式：GTC;IOC;FOK;GTX, 市价委托只支持IOC | GTC;IOC;FOK;GTX |
| triggerPriceType | string | true | N/A | 触发价格类型：INDEX\_PRICE(指数价格)；MARK\_PRICE(标记价格)；LATEST\_PRICE(最新价格) | INDEX\_PRICE;MARK\_PRICE;LATEST\_PRICE |
| positionSide | string | true | N/A | 仓位方向：LONG;SHORT | LONG;SHORT |

### 限流规则

200/s/apikey

```text theme={null}
{
    "error": {
    "code": "",
    "msg": ""
    },
    "msgInfo": "",
    "result": {},
    "returnCode": 0
}
title: Response
language: json
```

## 撤销计划委托

`POST` `/future/trade/v1/entrust/cancel-plan`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| entrustId | integer | true | N/A | 计划委托id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## 撤销所有计划委托

`POST` `/future/trade/v1/entrust/cancel-all-plan`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | | 交易对，例如btc\_usdt | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## 查询计划委托

`GET` `/future/trade/v1/entrust/plan-list`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | N/A | 交易对（不传时撤销所有交易对） | |
| page | integer | false | 1 | 页码 | |
| size | integer | false | 10 | 单页数 | |
| startTime | integer | false | N/A | 开始时间 | |
| endTime | integer | false | N/A | 结束时间 | |
| state | string | true | N/A | 委托状态 NOT\_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER\_REVOCATION：用户撤销；PLATFORM\_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期；UNFINISHED：未完成；HISTORY：（历史） | NOT\_TRIGGERED;TRIGGERING;TRIGGERED;USER\_REVOCATION;PLATFORM\_REVOCATION;EXPIRED;UNFINISHED;HISTORY |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "items": [
      {
        "clientOrderId": "", //自定义订单id
        "closePosition": false, //是否触发全平
        "createdTime": 0, //创建时间
        "entrustId": 0, //委托id
        "entrustType": "", //委托类型
        "marketOrderLevel": 0, //市价最优档
        "orderSide": "", //买卖方向
        "ordinary": true,
        "origQty": 0, //数量（张）
        "positionSide": "", //持仓方向
        "price": 0, //订单价格
        "state": "", //订单状态 NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期
        "stopPrice": 0, //触发价格
        "symbol": "", //交易对
        "timeInForce": "", //有效方式
        "triggerPriceType": "" //触发价格类型
      }
    ],
    "page": 0,
    "ps": 0,
    "total": 0
  },
  "returnCode": 0
}
```

## 根据entrustId查询计划委托

`GET` `/future/trade/v1/entrust/plan-detail`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| entrustId | integer | true | N/A | 委托id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "closePosition": false, //是否触发全平
    "createdTime": 0, //创建时间
    "entrustId": 0, //委托id
    "entrustType": "", //委托类型
    "marketOrderLevel": 0, //市价最优档
    "orderSide": "", //买卖方向
    "ordinary": true,
    "origQty": 0, //数量（张）
    "positionSide": "", //持仓方向
    "price": 0, //订单价格
    "state": "", //订单状态 NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期
    "stopPrice": 0, //触发价格
    "symbol": "", //交易对
    "timeInForce": "", //有效方式
    "triggerPriceType": "" //触发价格类型
  },
  "returnCode": 0
}
```

## 查询历史计划委托

`GET` `/future/trade/v1/entrust/plan-list-history`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | N/A | 交易对（不传时撤销所有交易对） | |
| direction | string | false | NEXT | 方向（PREV:上一页；NEXT:下一页） | PREV;NEXT |
| id | integer | false | N/A | id | |
| limit | integer | false | 10 | 条数 | |
| startTime | integer | false | N/A | 起始时间 | |
| endTime | integer | false | N/A | 结束时间 | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "hasNext": false, //是否有下一页
    "hasPrev": false, //是否有上一页
    "items": [ //数据列表
      {
        "clientOrderId": "", //自定义订单id
        "closePosition": false, //是否触发全平
        "createdTime": 0, //创建时间
        "entrustId": 0, //委托id
        "entrustType": "", //委托类型
        "marketOrderLevel": 0, //市价最优档
        "orderSide": "", //买卖方向
        "ordinary": true,
        "origQty": 0, //数量（张）
        "positionSide": "", //持仓方向
        "price": 0, //订单价格
        "state": "", //订单状态 NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期
        "stopPrice": 0, //触发价格
        "symbol": "", //交易对
        "timeInForce": "", //有效方式
        "triggerPriceType": "" //触发价格类型
      }
    ]
  },
  "returnCode": 0
}
```

## 创建止盈止损

`POST` `/future/trade/v1/entrust/create-profit`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | N/A | 交易对 | |
| origQty | integer | true | | 数量（张） | |
| triggerProfitPrice | integer | true | | 止盈触发价 | |
| triggerStopPrice | integer | true | | 止损触发价 | |
| expireTime | integer | true | | 过期时间 | |
| positionSide | string | true | | 仓位方向：LONG;SHORT | LONG;SHORT |

### 限流规则

200/s/apikey

```text theme={null}
{
    "error": {
    "code": "",
    "msg": ""
    },
    "msgInfo": "",
    "result": {},
    "returnCode": 0
}
title: Response
language: json
```

## 撤销止盈止损

`POST` `/future/trade/v1/entrust/cancel-profit-stop`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| profitId | integer | true | N/A | 止盈止损id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## 撤销所有止盈止损

`POST` `/future/trade/v1/entrust/cancel-all-profit-stop`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | | 交易对，例如btc\_usdt | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## 查询止盈止损

`GET` `/future/trade/v1/entrust/profit-list`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| symbol | string | true | N/A | 交易对（不传时撤销所有交易对） | |
| page | integer | false | 1 | 页码 | |
| size | integer | false | 10 | 单页数 | |
| startTime | integer | false | N/A | 开始时间 | |
| endTime | integer | false | N/A | 结束时间 | |
| state | string | true | N/A | 委托状态 NOT\_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER\_REVOCATION：用户撤销；PLATFORM\_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期；UNFINISHED：未完成；HISTORY：（历史） | NOT\_TRIGGERED;TRIGGERING;TRIGGERED;USER\_REVOCATION;PLATFORM\_REVOCATION;EXPIRED;UNFINISHED;HISTORY |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "items": [
      {
        "createdTime": 0, //时间
        "entryPrice": 0, //开仓均价
        "executedQty": 0, //实际成交
        "isolatedMargin": 0, //逐仓保证金
        "origQty": 0, //数量（张）
        "positionSide": "", //仓位方向
        "positionSize": 0, //持仓数量（张）
        "profitId": 0, //委托id
        "state": "", //订单状态 NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期
        "symbol": "", //交易对
        "triggerProfitPrice": 0, //止盈价格
        "triggerStopPrice": 0 //止损价格
      }
    ],
    "page": 0,
    "ps": 0,
    "total": 0
  },
  "returnCode": 0
}
```

## 根据profitId查询止盈止损

`GET` `/future/trade/v1/entrust/profit-detail`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| profitId | integer | true | N/A | 止盈止损id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "createdTime": 0, //时间
    "entryPrice": 0, //开仓均价
    "executedQty": 0, //实际成交
    "isolatedMargin": 0, //逐仓保证金
    "origQty": 0, //数量（张）
    "positionSide": "", //仓位方向
    "positionSize": 0, //持仓数量（张）
    "profitId": 0, //委托id
    "state": "", //订单状态 NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期
    "symbol": "", //交易对
    "triggerProfitPrice": 0, //止盈价格
    "triggerStopPrice": 0 //止损价格
  },
  "returnCode": 0
}
```

## 修改止盈止损

`POST` `/future/trade/v1/entrust/update-profit-stop`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| profitId | integer | true | N/A | 止盈止损id | |
| triggerProfitPrice | number | false | N/A | 止盈触发价s | |
| triggerStopPrice | number | false | N/A | 止损触发价 | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## 创建跟踪委托

`POST` `/future/trade/v1/entrust/create-track`

Content-Type = application/x-www-form-urlencoded

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| callback | string | true | N/A | 回调幅度配置：FIXED(固定)；PROPORTION(比例) | FIXED;PROPORTION |
| callbackVal | number | true | N/A | 回调幅度配置值 | 大于0 |
| orderSide | string | true | N/A | 订单方向 | BUY;SELL |
| origQty | number | true | N/A | 数量（张） | |
| positionSide | string | true | N/A | 持仓方向 | BOTH;LONG;SHORT |
| positionType | string | true | N/A | 仓位模式：CROSSED(全仓),ISOLATED(逐仓) | CROSSED;ISOLATED |
| symbol | string | true | N/A | 交易对 | |
| triggerPriceType | string | true | N/A | 触发价格类型：INDEX\_PRICE(指数价格)；MARK\_PRICE(标记价格)；LATEST\_PRICE(最新价格) | INDEX\_PRICE;MARK\_PRICE;LATEST\_PRICE |
| activationPrice | number | false | N/A | 激活价格 | |
| clientMedia | string | false | N/A | 客户端媒体 | |
| clientMediaChannel | string | false | N/A | 客户端媒体渠道 | |
| clientOrderId | string | false | N/A | 客户端ID | |
| expireTime | integer | false | N/A | 过期时间 | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## 撤销跟踪委托（单个）

`POST` `/future/trade/v1/entrust/cancel-track`

Content-Type = application/x-www-form-urlencoded

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| trackId | integer | true | N/A | 跟踪委托id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## 查询单个跟踪委托

`GET` `/future/trade/v1/entrust/track-detail`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| trackId | integer | true | N/A | 跟踪委托id | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "activationPrice": 0,      //激活价格，如果没有配置，则用当前价格为激活价格
    "avgPrice": 0,             //实际成交均价
    "callback": "",            //回调幅度配置 1比例 2固定
    "callbackVal": 0,          //回调幅度配置值，大于0
    "configActivation": false, //是否配置激活价格
    "createdTime": 0,          //创建时间
    "currentPrice": 0,         //下单时对应类型的实时价格，激活价格和下单行情价格比较，判断激活价格的方向
    "desc": "",                //描述，撤销、委托失败等描述
    "executedQty": 0,          //实际成交数量
    "orderSide": "",           //买卖方向
    "ordinary": true,          //
    "origQty": 0,              //数量（张）
    "positionSide": "",        //持仓方向
    "price": 0,                //订单价格
    "state": "",               //订单状态 NOT_ACTIVATION: 未激活；NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期;DELEGATION_FAILED: 委托失败
    "stopPrice": 0,            //触发价格
    "symbol": "",              //交易对
    "trackId": 0,              //跟踪委托id
    "triggerPriceType": "",    //触发价格类型
    "updatedTime": 0           //更新时间
  },
  "returnCode": 0
}
```

## 查询跟踪委托（所有活跃）

`GET` `/future/trade/v1/entrust/track-list`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| page | integer | false | 1 | 页码 | |
| size | integer | false | 10 | 单页数 | |
| endTime | integer | false | N/A | | |
| startTime | integer | false | N/A | 起始时间 | |
| symbol | string | false | N/A | 交易对 | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    items:[
      "activationPrice": 0,      //激活价格，如果没有配置，则用当前价格为激活价格
      "avgPrice": 0,             //实际成交均价
      "callback": "",            //回调幅度配置 1比例 2固定
      "callbackVal": 0,          //回调幅度配置值，大于0
      "configActivation": false, //是否配置激活价格
      "createdTime": 0,          //创建时间
      "currentPrice": 0,         //下单时对应类型的实时价格，激活价格和下单行情价格比较，判断激活价格的方向
      "desc": "",                //描述，撤销、委托失败等描述
      "executedQty": 0,          //实际成交数量
      "orderSide": "",           //买卖方向
      "ordinary": true,          //
      "origQty": 0,              //数量（张）
      "positionSide": "",        //持仓方向
      "price": 0,                //订单价格
      "state": "",               //订单状态 NOT_ACTIVATION: 未激活；NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期;DELEGATION_FAILED: 委托失败
      "stopPrice": 0,            //触发价格
      "symbol": "",              //交易对
      "trackId": 0,              //跟踪委托id
      "triggerPriceType": "",    //触发价格类型
      "updatedTime": 0           //更新时间
    ],
    page: 1,                     //页码
    ps: 10,                      //一页数量
    total: 20                    //总量
  },
  "returnCode": 0
}
```

## 撤销所有跟踪委托

`POST` `/future/trade/v1/entrust/cancel-all-track`

Content-Type = application/x-www-form-urlencoded

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## 查询历史跟踪委托（非活跃）

`GET` `/future/trade/v1/entrust/track-list-history`

**Parameters**

| 参数 | 数据类型 | 是否必须 | 默认值 | 描述 | 取值范围 |
| - | - | - | - | - | - |
| direction | string | false | NEXT | 方向（PREV:上一页；NEXT:下一页） | PREV;NEXT |
| limit | integer | false | 10 | 条数 | |
| id | integer | false | N/A | | |
| endTime | integer | false | N/A | 结束时间 | |
| startTime | integer | false | N/A | 起始时间 | |
| symbol | string | false | N/A | 交易对 | |

### 限流规则

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    hasNext: true,               //是否有下一页
    hasPre: true,                //是否有上一页
    items:[
      "activationPrice": 0,      //激活价格，如果没有配置，则用当前价格为激活价格
      "avgPrice": 0,             //实际成交均价
      "callback": "",            //回调幅度配置 1比例 2固定
      "callbackVal": 0,          //回调幅度配置值，大于0
      "configActivation": false, //是否配置激活价格
      "createdTime": 0,          //创建时间
      "currentPrice": 0,         //下单时对应类型的实时价格，激活价格和下单行情价格比较，判断激活价格的方向
      "desc": "",                //描述，撤销、委托失败等描述
      "executedQty": 0,          //实际成交数量
      "orderSide": "",           //买卖方向
      "ordinary": true,          //
      "origQty": 0,              //数量（张）
      "positionSide": "",        //持仓方向
      "price": 0,                //订单价格
      "state": "",               //订单状态 NOT_ACTIVATION: 未激活；NOT_TRIGGERED：新建委托（未触发）；TRIGGERING：触发中；TRIGGERED：已触发；USER_REVOCATION：用户撤销；PLATFORM_REVOCATION：平台撤销（拒绝）；EXPIRED：已过期;DELEGATION_FAILED: 委托失败
      "stopPrice": 0,            //触发价格
      "symbol": "",              //交易对
      "trackId": 0,              //跟踪委托id
      "triggerPriceType": "",    //触发价格类型
      "updatedTime": 0           //更新时间
    ]
  },
  "returnCode": 0
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.