From a986f3571c7e18ade4665fe5999b445b5762264d Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 11 May 2026 23:07:15 +0800
Subject: [PATCH] refactor(gateApi): 修改网格交易队列生成算法

---
 src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md |  215 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 167 insertions(+), 48 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md b/src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md
index 7bbe42d..525793f 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md
@@ -7,7 +7,7 @@
 | [GateWebSocketClientManager](#gatewebsocketclientmanager) | `@Component` | Spring 启动入口,组装组件 + 生命周期 |
 | [GateConfig](#gateconfig) | 配置 | Builder 模式:API 密钥、合约、策略参数、环境切换 |
 | [GateKlineWebSocketClient](#gateklinewebsocketclient) | WS 连接管理 | 连接/心跳/重连/消息路由 |
-| [GateGridTradeService](#gategridtradeservice) | 交易服务 | 网格队列策略 + 保证金安全阀 + 盈亏管理 |
+| [GateGridTradeService](#gategridtradeservice) | 交易服务 | 网格队列策略 + 保证金安全阀 + 盈亏管理 + 额外反向开仓 |
 | [GateTradeExecutor](#gatetradeexecutor) | 异步执行器 | 独立线程池执行 REST 下单,成功/失败双回调 |
 | [GateWebSocketClientMain](#gatewebsocketclientmain) | main 入口 | 独立测试启动 |
 | [Example.java](#examplejava) | 示例 | Gate SDK 用法参考 |
@@ -19,7 +19,7 @@
 | `wsHandler/GateChannelHandler.java` | **接口** | subscribe / unsubscribe / handleMessage / getChannelName |
 | `wsHandler/AbstractPrivateChannelHandler.java` | **抽象类** | 私有频道基类:HMAC-SHA512 签名 + 认证请求 |
 | `wsHandler/handler/CandlestickChannelHandler.java` | 公开频道 | K 线解析 → `onKline()` |
-| `wsHandler/handler/PositionsChannelHandler.java` | 私有频道 | 仓位推送 → `onPositionUpdate()`(传 `Position.ModeEnum`) |
+| `wsHandler/handler/PositionsChannelHandler.java` | 私有频道 | 仓位推送 → `onPositionUpdate()`(传 `Position.ModeEnum`),日志输出全部20个推送字段 |
 | `wsHandler/handler/PositionClosesChannelHandler.java` | 私有频道 | 平仓推送 → `onPositionClose()` |
 
 ---
@@ -64,10 +64,11 @@
 ├─ futures.positions (私有, HMAC-SHA512)
 │   └─ PositionsChannelHandler
 │       ├─ 解析 mode → Position.ModeEnum(DUAL_LONG / DUAL_SHORT)
+│       ├─ 日志输出全部 20 个推送字段(contract/mode/size/entry_price/.../update_id)
 │       └─ gridTradeService.onPositionUpdate(contract, mode, size, entryPrice)
 │           ├─ 有仓位: 标记活跃,首次成交记录入场价并设止盈
 │           │   ├─ 基底开仓 → 首次成交 → 记录基底入场价 → 双基底都成交后生成网格队列
-│           │   └─ 网格开仓 → 成交后立即设止盈单
+│           │   └─ 网格开仓 → 成交后立即设止盈单(plan-close-*-position)
 │           └─ 无仓位(size=0): 标记不活跃
 │
 ├─ futures.position_closes (私有, HMAC-SHA512)
@@ -78,8 +79,36 @@
 └─ 所有下单操作
     └─ GateTradeExecutor (单线程 + 64队列 + CallerRunsPolicy)
         ├─ openLong/Short(qty, onSuccess, onFailure)
-        └─ placeTakeProfit → 条件单 (REST)
+        └─ placeTakeProfit → 条件单(plan-close-*-position, REST)
 ```
+
+### PositionsChannelHandler 完整推送字段(20个)
+
+| 字段 | 类型 | 描述 |
+|------|------|------|
+| contract | String | 合约名称 |
+| mode | String | 持仓模式:dual_long / dual_short |
+| size | String/Integer | 合约张数(正=多头,负=空头) |
+| entry_price | Float | 开仓均价 |
+| cross_leverage_limit | Float | 全仓模式下的杠杆倍数上限 |
+| history_pnl | Float | 已平仓的仓位总盈亏 |
+| history_point | Float | 已平仓的点卡总盈亏 |
+| last_close_pnl | Float | 最近一次平仓的盈亏 |
+| leverage | Integer | 杠杆倍数(0=全仓,正数=逐仓) |
+| leverage_max | Integer | 当前风险限额下允许的最大杠杆倍数 |
+| liq_price | Float | 爆仓价格 |
+| maintenance_rate | Float | 当前风险限额下维持保证金比例 |
+| margin | Float | 保证金 |
+| realised_pnl | Float | 已实现盈亏 |
+| realised_point | Float | 点卡已实现盈亏 |
+| risk_limit | Integer | 风险限额 |
+| time | Integer | 更新 unix 时间戳(秒) |
+| time_ms | Integer | 更新 unix 时间戳(毫秒) |
+| user | String | 用户 ID |
+| update_id | Integer | 消息序列号,每次推送 order 后自增1 |
+
+> 以上 20 个字段在 PositionsChannelHandler.handleMessage() 中通过 SLF4J 日志全部输出。
+> 回调给 GateGridTradeService.onPositionUpdate() 的仅有 mode、size、entryPrice 三个核心字段。
 
 ---
 
@@ -89,7 +118,7 @@
 GateChannelHandler (接口)
   ├── CandlestickChannelHandler          (公开频道)
   └── AbstractPrivateChannelHandler      (私有频道基类: HMAC-SHA512)
-        ├── PositionsChannelHandler       (解析 mode → Position.ModeEnum)
+        ├── PositionsChannelHandler       (解析 mode → Position.ModeEnum,日志输出20个字段)
         └── PositionClosesChannelHandler
 ```
 
@@ -110,7 +139,9 @@
      │                        │                 ├─ cumPnl ≥ overallTp → STOPPED
      │                        │                 ├─ cumPnl ≤ -maxLoss → STOPPED
      │                        │                 ├─ 保证金超限 → 跳过开仓,队列照常更新
-     │                        │                 └─ 网格触发 → 开仓+设止盈+队列转移
+     │                        │                 ├─ 网格触发 → 开仓+设止盈+队列转移(以对方队列首元素为种子)
+     │                        │                 ├─ 多>空且价格夹在中间 → 额外反向开仓
+     │                        │                 └─ 转移元素贴近持仓均价 → 跳过(过滤)
      ▼                        ▼
    STOPPED  ←──────────────────┘
 ```
@@ -128,7 +159,7 @@
 
 ### 概述
 
-策略采用"基底 + 价格网格队列"模式:先开一对基底多空仓位,然后以基底入场价为基准生成价格队列。每当K线穿破队列元素,就开新仓位并设止盈条件单,同时将穿破的元素转移到反方向队列。
+策略采用"基底 + 价格网格队列"模式:先开一对基底多空仓位,然后以基底入场价为基准生成价格队列。每当K线穿破队列元素,就开新仓位并设止盈条件单,同时以对方队列首元素为种子生成新元素加入对方队列。
 
 ### 基底开仓
 
@@ -141,12 +172,14 @@
 
 ### 网格队列生成
 
-以基底入场价为基准,按 `gridRate`(百分比步长)生成 N 个价格(N = gridQueueSize,默认50):
+以空头基底入场价 `shortBaseEntryPrice` 为唯一基准,计算绝对步长 `step = shortBaseEntryPrice × gridRate`(保留1位小数),存入 config。
+
+两个队列均从 `shortBaseEntryPrice` 出发,按 `step` 绝对偏移生成 N 个价格(N = gridQueueSize,默认50):
 
 | 队列 | 计算方式 | 排序 |
 |------|---------|------|
-| 空仓队列 shortPriceQueue | 基底空入场价 × (1 − gridRate × i) (i=1..N) | 降序(大→小) |
-| 多仓队列 longPriceQueue | 基底多入场价 × (1 + gridRate × i) (i=1..N) | 升序(小→大) |
+| 空仓队列 shortPriceQueue | 首元素 = shortBaseEntryPrice − step,后续依次 −step (i=0..N-1) | 降序(大→小) |
+| 多仓队列 longPriceQueue | 首元素 = shortBaseEntryPrice + step,后续依次 +step (i=0..N-1) | 升序(小→大) |
 
 ### K线触发网格
 
@@ -154,36 +187,95 @@
 K线到达(ACTIVE状态):
 │
 ├─ processShortGrid: 当前价 < 空仓队列元素(价格跌破了队列中的高价)
-│   ├─ 匹配: 收集所有 > 当前价的空仓队列元素
-│   ├─ 保证金检查: positionInitialMargin / initialPrincipal < marginRatioLimit(20%)
-│   │   ├─ 安全 → openShort 开空单(成交后仓位推送会自动设止盈)
-│   │   └─ 超限 → 跳过开仓,队列照常更新
-│   ├─ 空仓队列: 移除匹配元素,尾部补充新价格(尾价 × (1 − gridRate))
-│   └─ 多仓队列: 接收匹配元素,升序排列,截断到 gridQueueSize
+│   ├─ 匹配: 收集所有 > 当前价的空仓队列元素(降序,一旦遇≤即停止)
+│   ├─ 空仓队列: 移除 matched,尾部补充新元素(尾价 − step 循环递减)
+│   ├─ 多仓队列转移:
+│   │   ├─ 以多仓队列首元素(最小价)为种子
+│   │   ├─ 生成 matched.size() 个递减元素: seed − step × i
+│   │   ├─ 贴近过滤: |currentPrice − longEntryPrice| < longEntryPrice × gridRate → 跳过
+│   │   └─ 升序排列,截断到 gridQueueSize
+│   └─ 下单(队列已更新,避免竞态):
+│       ├─ 保证金检查: positionInitialMargin / initialPrincipal < marginRatioLimit(20%)
+│       │   ├─ 安全 → openShort 开空单
+│       │   │   └─ 额外条件: 多>空 且 空仓均价 < 当前价 < 多仓均价×(1−gridRate) → openLong 额外开多一次
+│       │   └─ 超限 → 跳过开仓
 │
 └─ processLongGrid: 当前价 > 多仓队列元素(价格涨超了队列中的低价)
-    ├─ 匹配: 收集所有 < 当前价的多仓队列元素
-    ├─ 保证金检查: 同上
-    │   ├─ 安全 → openLong 开多单
-    │   └─ 超限 → 跳过开仓
-    ├─ 多仓队列: 移除匹配元素,尾部补充新价格(尾价 × (1 + gridRate))
-    └─ 空仓队列: 接收匹配元素,降序排列,截断到 gridQueueSize
+    ├─ 匹配: 收集所有 < 当前价的多仓队列元素(升序,一旦遇≥即停止)
+    ├─ 多仓队列: 移除 matched,尾部补充新元素(尾价 + step 循环递增)
+    ├─ 空仓队列转移:
+    │   ├─ 以空仓队列首元素(最高价)为种子
+    │   ├─ 生成 matched.size() 个递增元素: seed + step × i
+    │   ├─ 贴近过滤: |currentPrice − shortEntryPrice| < shortEntryPrice × gridRate → 跳过
+    │   └─ 降序排列,截断到 gridQueueSize
+    └─ 下单(队列已更新,避免竞态):
+        ├─ 保证金检查: 同上
+        │   ├─ 安全 → openLong 开多单
+        │   │   └─ 额外条件: 多>空 且 空仓均价×(1+gridRate) < 当前价 < 多仓均价 → openShort 额外开空一次
+        │   └─ 超限 → 跳过开仓
 ```
+
+### 队列转移规则(新)
+
+触发后**不再简单复制** matched 元素到对方队列,而是以对方队列首元素为种子,按绝对步长 step 生成新元素:
+
+| 触发方向 | 目标队列 | 种子元素 | 生成公式 | 排序 |
+|---------|---------|---------|---------|------|
+| 空仓触发 → | 多仓队列 | 多仓队列首元素(最小价) | 种子 − step × i | 升序 |
+| 多仓触发 → | 空仓队列 | 空仓队列首元素(最高价) | 种子 + step × i | 降序 |
+
+### 贴近持仓均价过滤(新)
+
+转移生成新元素时,若元素与对应方向持仓均价的差距小于 gridRate,则跳过:
+
+| 目标队列 | 过滤条件 | 含义 |
+|---------|---------|------|
+| 多仓队列 | \|elem − longEntryPrice\| < longEntryPrice × gridRate | 太贴近多仓成本,跳过 |
+| 空仓队列 | \|elem − shortEntryPrice\| < shortEntryPrice × gridRate | 太贴近空仓成本,跳过 |
+
+> 过滤仅在对应方向有持仓时生效(entryPrice > 0),避免在持仓成本附近生成无效网格线。
+
+### 额外反向开仓条件(新)
+
+当触发价夹在多/空持仓均价之间,且多仓均价大于空仓均价(多>空倒挂)时,额外反向开仓一次:
+
+| 触发方向 | 额外操作 | 条件 |
+|---------|---------|------|
+| 空仓队列触发 | 额外开多 | shortEntryPrice > 0 && longEntryPrice > shortEntryPrice && shortEntryPrice < currentPrice < longEntryPrice × (1 − gridRate) |
+| 多仓队列触发 | 额外开空 | shortEntryPrice > 0 && longEntryPrice > shortEntryPrice && shortEntryPrice × (1 + gridRate) < currentPrice < longEntryPrice |
+
+**条件解释:**
+- `longEntryPrice > shortEntryPrice`:多仓均价高于空仓均价("倒挂"状态)
+- `shortEntryPrice × (1 + gridRate) < currentPrice`:空仓触发时金额够远离空仓均价
+- `currentPrice < longEntryPrice × (1 − gridRate)`:空仓触发时金额够远离多仓均价
+
+> 背后的思路:当"多亏空赚"发生倒挂时,在价格区间中间补一单反方向仓位,利用均值回归获利。
 
 ### 队列转移示意
 
 ```
-ETH_USDT, gridRate=0.0035, 基底空入场价=2275, 基底多入场价=2275:
+ETH_USDT, gridRate=0.0035, shortBaseEntryPrice=2270, step=2270×0.0035≈7.9, gridQueueSize=4:
 
 初始状态:
-  空仓队列: [2267.1, 2270.0, 2272.5, 2275.0]  (降序,base×0.9965, base×0.993...)
-  多仓队列: [2275.0, 2277.5, 2280.0, 2282.5]  (升序,base×1.0035, base×1.007...)
+  空仓队列: [2262.1, 2254.2, 2246.3, 2238.4]  (降序, shortBaseEntryPrice−step 起递减)
+  多仓队列: [2277.9, 2285.8, 2293.7, 2301.6]  (升序, shortBaseEntryPrice+step 起递增)
 
-价格跌到 2271 → processShortGrid 触发:
-  匹配: [2275.0, 2272.5](都 > 2271)
-  
-  空仓队列: 移除[2275.0,2272.5] → [2270.0,2267.1] → 补充[2267.1×0.9965≈2259.1, 2259.1×0.9965≈2251.2] → [2270.0,2267.1,2259.1,2251.2]
-  多仓队列: 接收[2275.0,2272.5] → 合并后截断到4 → [2272.5,2275.0,2277.5,2280.0]
+价格涨到 2290 → processLongGrid 触发:
+  匹配: [2277.9, 2285.8](都 < 2290)
+
+  多仓队列: 移除[2277.9,2285.8] → [2293.7,2301.6]
+    补充: max=2301.6 → 2301.6+7.9=2309.5 → 2309.5+7.9=2317.4
+    → [2293.7, 2301.6, 2309.5, 2317.4]
+
+  空仓队列转移:
+    种子=空仓首元素 2262.1
+    生成: 2262.1+7.9=2270.0, 2262.1+7.9×2=2277.9
+    贴近过滤(shortEntryPrice=2270):
+      |2270.0−2270|=0.0 < 2270×0.0035=7.9 → 跳过
+      |2277.9−2270|=7.9 ≥ 7.9 → 通过
+    空仓队列: [2277.9, 2262.1, 2254.2, 2246.3, 2238.4] → 截断到4 → [2262.1, 2254.2, 2246.3, 2238.4](2277.9被移除...)
+
+  注:当空仓队列已满时,新元素可能因排序+截断被丢弃。缩小 gridRate 可增加步长密度。
 ```
 
 ---
@@ -230,12 +322,19 @@
 每根K线 → onKline → updateUnrealizedPnl → processShortGrid + processLongGrid
 
 仓位推送(每次开仓成交后自动触发):
-  → DUAL_LONG, size>0, 非基底 → 设多头止盈单 entryPrice × (1+gridRate)
-  → DUAL_SHORT, size<0, 非基底 → 设空头止盈单 entryPrice × (1-gridRate)
+  → DUAL_LONG, size>0, 非基底 → 设多头止盈单:止盈价=longPriceQueue[0](多仓队列首元素),
+      使用 plan-close-long-position,平仓张数=-quantity(负=平多),rule=NUMBER_1(≥)
+  → DUAL_SHORT, size<0, 非基底 → 设空头止盈单:止盈价=shortPriceQueue[0](空仓队列首元素),
+      使用 plan-close-short-position,平仓张数=+quantity(正=平空),rule=NUMBER_2(≤)
+
+额外反向开仓(多>空倒挂时):
+  → 空仓队列触发 + 条件满足 → 额外开多一次
+  → 多仓队列触发 + 条件满足 → 额外开空一次
 ```
 
 > 止盈由 Gate 服务端条件单自动执行。服务端监控价格,达到触发价后自动平仓。
-> 平仓后仓位变为0,盈亏通过 position_closes 频道推送到 cumulativePnl。
+> 每次网格触发开仓 quantity 张,只在该批张数上设止盈,与之前已设的止盈单互不影响。
+> 平仓后仓位减少 quantity 张,盈亏通过 position_closes 频道推送到 cumulativePnl。
 
 ### 阶段 4:停止
 
@@ -262,7 +361,8 @@
 | leverage | 10 | 倍数 |
 | marginMode | cross | 全仓 |
 | positionMode | dual | 双向持仓 |
-| gridRate | 0.0035 | 网格间距 0.35% |
+| gridRate | 0.0035 | 网格间距比率 0.35%(用于过滤阈值计算) |
+| step | 运行时计算 | 网格绝对步长 = shortBaseEntryPrice × gridRate(队列元素生成用) |
 | overallTp | 0.5 USDT | 整体止盈 |
 | maxLoss | 7.5 USDT | 最大亏损 |
 | quantity | 1 | 下单张数 |
@@ -292,9 +392,18 @@
 |------|------|
 | `openLong(qty, onSuccess, onFailure)` | 异步 IOC 市价开多,双回调 |
 | `openShort(qty, onSuccess, onFailure)` | 异步 IOC 市价开空,双回调 |
-| `placeTakeProfit(trigger, rule, type, auto)` | 异步条件单。已存在则清除旧单重试 |
+| `placeTakeProfit(trigger, rule, type, size)` | 异步止盈条件单(plan-close-*-position)。size 为显式平仓张数(正=平空,负=平多),多次调用互不影响 |
 | `cancelAllPriceTriggeredOrders()` | 清除所有条件单 |
 | `shutdown()` | 等待10秒,超时强制关闭 |
+
+### 止盈条件单 order_type 说明
+
+| order_type | 用途 | size 语义 |
+|-----------|------|----------|
+| `plan-close-long-position` | 部分/全部平多仓 | size<0 表示平多仓张数 |
+| `plan-close-short-position` | 部分/全部平空仓 | size>0 表示平空仓张数 |
+
+> **为何不用 close-*-position**:`close-long-position` 和 `close-short-position` 仅支持全部平仓(size=0),且双仓模式还需设置 `auto_size`。网格策略需要指定张数部分平仓,因此必须使用 `plan-close-*-position`。
 
 ---
 
@@ -306,10 +415,9 @@
 
 **关键常量**:
 ```java
-private static final String AUTO_SIZE_LONG = "close_long";
-private static final String AUTO_SIZE_SHORT = "close_short";
-private static final String ORDER_TYPE_CLOSE_LONG = "close-long-position";
-private static final String ORDER_TYPE_CLOSE_SHORT = "close-short-position";
+// 止盈条件单 order_type:仓位计划止盈止损,支持指定张数部分平仓
+private static final String ORDER_TYPE_CLOSE_LONG = "plan-close-long-position";
+private static final String ORDER_TYPE_CLOSE_SHORT = "plan-close-short-position";
 ```
 
 **核心数据结构**:
@@ -318,10 +426,10 @@
 |------|------|------|
 | shortPriceQueue | List\<BigDecimal\> | 空仓价格队列,降序(大→小),容量 gridQueueSize |
 | longPriceQueue | List\<BigDecimal\> | 多仓价格队列,升序(小→大),容量 gridQueueSize |
-| shortBaseEntryPrice | BigDecimal | 基底空头入场价 |
-| longBaseEntryPrice | BigDecimal | 基底多头入场价 |
-| shortEntryPrice | BigDecimal | 当前空仓入场价(推送更新) |
-| longEntryPrice | BigDecimal | 当前多仓入场价(推送更新) |
+| shortBaseEntryPrice | BigDecimal | 基底空头入场价(仅首次记录,用于生成队列) |
+| longBaseEntryPrice | BigDecimal | 基底多头入场价(仅首次记录,用于生成队列) |
+| shortEntryPrice | BigDecimal | 当前空仓入场价(推送实时更新,加权均价) |
+| longEntryPrice | BigDecimal | 当前多仓入场价(推送实时更新,加权均价) |
 | shortPositionSize | BigDecimal | 当前空仓持仓量(绝对值) |
 | longPositionSize | BigDecimal | 当前多仓持仓量 |
 | baseLongOpened | boolean | 基底多头是否已开 |
@@ -334,8 +442,17 @@
 
 **回调方法**:
 - `onKline(closePrice)`: 更新 lastKlinePrice → 计算 unrealizedPnl → WAITING_KLINE 时触发基底双开,ACTIVE 时驱动 processShortGrid+processLongGrid
-- `onPositionUpdate(contract, mode, size, entryPrice)`: 记录当前入场价和持仓量 → 有仓位时标记活跃+设止盈,无仓位时清空持仓量并标记不活跃
+- `onPositionUpdate(contract, mode, size, entryPrice)`: 记录当前入场价和持仓量 → 基底:首次成交记录入场价、生成队列;非基底:按 quantity 张数创建独立止盈条件单(plan-close-*-position)。无仓位时清空持仓量并标记不活跃
 - `onPositionClose(contract, side, pnl)`: 累加已实现盈亏,检查停止条件
+
+**processShortGrid / processLongGrid 核心逻辑**:
+
+| 步骤 | processShortGrid | processLongGrid |
+|------|-----------------|-----------------|
+| 匹配 | 收集 shortPriceQueue 中 > currentPrice 的元素 | 收集 longPriceQueue 中 < currentPrice 的元素 |
+| 本队补充 | 尾价 − step 循环递减 | 尾价 + step 循环递增 |
+| 对方转移 | 以多仓首元素为种子,递减 step | 以空仓首元素为种子,递增 step |
+| 贴近过滤 | 新增与 longEntryPrice 太近 → 跳过 | 新增与 shortEntryPrice 太近 → 跳过 |
 
 **未实现盈亏计算** (`updateUnrealizedPnl()`):
 
@@ -359,10 +476,12 @@
 
 **止盈计算**:
 
-| 方向 | 公式 | order_type | auto_size | rule |
+| 方向 | 公式 | order_type | size(平仓张数) | rule |
 |------|------|------------|-----------|------|
-| 多头 TP | entry × (1+gridRate) | `close-long-position` | `close_long` | NUMBER_1(≥触发价) |
-| 空头 TP | entry × (1-gridRate) | `close-short-position` | `close_short` | NUMBER_2(≤触发价) |
+| 多头 TP | longPriceQueue[0](多仓队列首元素) | `plan-close-long-position` | `-quantity`(负=平多) | NUMBER_1(≥触发价) |
+| 空头 TP | shortPriceQueue[0](空仓队列首元素) | `plan-close-short-position` | `+quantity`(正=平空) | NUMBER_2(≤触发价) |
+
+> 止盈价取自对应方向队列的首元素(多仓队列升序首=最小价,空仓队列降序首=最高价)。止盈单使用显式张数而非 autoSize。每次网格触发开仓 quantity 张,只为该批张数创建独立的条件单,多个止盈单之间互不覆盖。
 
 **REST API 调用**:
 
@@ -376,7 +495,7 @@
 | 查账户 | `GET /futures/usdt/accounts` | `FuturesApi.listFuturesAccounts()` | 获取初始本金和保证金 |
 | 清除条件单 | `DELETE /futures/usdt/price_orders` | `FuturesApi.cancelPriceTriggeredOrderList()` | |
 | 市价单 | `POST /futures/usdt/orders` | `FuturesApi.createFuturesOrder()` | price=0, tif=IOC |
-| 条件单 | `POST /futures/usdt/price_orders` | `FuturesApi.createPriceTriggeredOrder()` | strategy=0, price_type=0, expiration=0 |
+| 条件单 | `POST /futures/usdt/price_orders` | `FuturesApi.createPriceTriggeredOrder()` | strategy=0, price_type=0, expiration=0, order_type=plan-close-*-position, size=显式张数,多次调用互不冲突 |
 
 **初始化顺序** (`init()`):
 ```

--
Gitblit v1.9.1