From c854617480135e089fcb7128bf3ce33f733e15ac Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 24 Jun 2026 16:21:41 +0800
Subject: [PATCH] refactor(okxApi): 移除基座止盈挂单逻辑

---
 src/main/java/com/xcong/excoin/modules/okxApi/OkxGridTradeService.java |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxApi/OkxGridTradeService.java b/src/main/java/com/xcong/excoin/modules/okxApi/OkxGridTradeService.java
index f9e7ddd..71e8ddb 100644
--- a/src/main/java/com/xcong/excoin/modules/okxApi/OkxGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/okxApi/OkxGridTradeService.java
@@ -614,24 +614,6 @@
             baseGridElement.setShortOrderId(baseShortTraderParam.getEntryOrderId());
             baseGridElement.setHasShortOrder(true);
 
-            // 挂基座止盈
-            {
-                BigDecimal tpPrice = baseGridElement.getGridPrice().add(config.getStep());
-                executor.placeTakeProfit(tpPrice, "close_long", config.getBaseQuantity(),
-                        profitId -> {
-                            longTakeProfitTraderIdParam(baseGridElement, profitId, true);
-                            log.info("[OKX] 基座多仓止盈已挂, gridId:0, 触发价:{}, tpId:{}", tpPrice, profitId);
-                        });
-            }
-            {
-                BigDecimal tpPrice = baseGridElement.getGridPrice().subtract(config.getStep());
-                executor.placeTakeProfit(tpPrice, "close_short", config.getBaseQuantity(),
-                        profitId -> {
-                            shortTakeProfitTraderIdParam(baseGridElement, profitId, true);
-                            log.info("[OKX] 基座空仓止盈已挂, gridId:0, 触发价:{}, tpId:{}", tpPrice, profitId);
-                        });
-            }
-
             // 挂初始止损
             int stopCount = Integer.parseInt(config.getBaseQuantity()) / Integer.parseInt(config.getQuantity()) + 1;
             for (int id = 2; id <= stopCount; id++) {
@@ -641,7 +623,7 @@
                 }
                 BigDecimal triggerPrice = elem.getGridPrice();
                 int finalId = id;
-                executor.placeTakeProfit(triggerPrice, "close_short", config.getQuantity(),
+                executor.placeStopLoss(triggerPrice, "close_short", config.getQuantity(),
                         profitId -> {
                             elem.setShortStopLossOrderId(profitId);
                             GridElement.refreshIndices();
@@ -655,7 +637,7 @@
                 }
                 BigDecimal triggerPrice = elem.getGridPrice();
                 int finalId = id;
-                executor.placeTakeProfit(triggerPrice, "close_long", config.getQuantity(),
+                executor.placeStopLoss(triggerPrice, "close_long", config.getQuantity(),
                         profitId -> {
                             elem.setLongStopLossOrderId(profitId);
                             GridElement.refreshIndices();
@@ -1144,7 +1126,7 @@
             }
             BigDecimal triggerPrice = elem.getGridPrice();
             int finalSlId = newSlId;
-            executor.placeTakeProfit(triggerPrice, "close_long", config.getQuantity(),
+            executor.placeStopLoss(triggerPrice, "close_long", config.getQuantity(),
                     profitId -> {
                         elem.setLongStopLossOrderId(profitId);
                         GridElement.refreshIndices();
@@ -1172,7 +1154,7 @@
             }
             BigDecimal triggerPrice = elem.getGridPrice();
             int finalSlId = newSlId;
-            executor.placeTakeProfit(triggerPrice, "close_short", config.getQuantity(),
+            executor.placeStopLoss(triggerPrice, "close_short", config.getQuantity(),
                     profitId -> {
                         elem.setShortStopLossOrderId(profitId);
                         GridElement.refreshIndices();

--
Gitblit v1.9.1