From 9023f09e818a20484f80b50b38d3b7d5c357f18a Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 08 May 2026 23:26:41 +0800
Subject: [PATCH] fix(gateApi): 修复双向持仓模式下的杠杆设置功能
---
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
index dfb885a..9381cec 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -134,9 +134,9 @@
closeExistingPositions();
- futuresApi.updateContractPositionLeverageCall(
+ futuresApi.updateDualModePositionLeverageCall(
SETTLE, config.getContract(), config.getLeverage(),
- config.getMarginMode(), config.getPositionMode(), null);
+ config.getMarginMode(), null);
log.info("[Gate] 杠杆: {}x {}", config.getLeverage(), config.getMarginMode());
} catch (GateApiException e) {
log.error("[Gate] 初始化失败, label:{}, msg:{}", e.getErrorLabel(), e.getMessage());
@@ -337,6 +337,8 @@
shortPriceQueue.add(shortBaseEntryPrice.subtract(step.multiply(BigDecimal.valueOf(i))).setScale(1, RoundingMode.HALF_UP));
}
shortPriceQueue.sort((a, b) -> b.compareTo(a));
+ //输出队列:shortPriceQueue;
+ log.info("[Gate] 空队列:{}", shortPriceQueue);
}
private void generateLongQueue() {
@@ -346,6 +348,7 @@
longPriceQueue.add(longBaseEntryPrice.add(step.multiply(BigDecimal.valueOf(i))).setScale(1, RoundingMode.HALF_UP));
}
longPriceQueue.sort(BigDecimal::compareTo);
+ log.info("[Gate] 多队列:{}", longPriceQueue);
}
private void processShortGrid(BigDecimal currentPrice) {
--
Gitblit v1.9.1