Administrator
3 days ago 98986bf100201ad41843cbba52d803911c7277f0
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -58,8 +58,8 @@
        WAITING_KLINE, OPENING, ACTIVE, STOPPED
    }
    private static final String ORDER_TYPE_CLOSE_LONG = "close-long-position";
    private static final String ORDER_TYPE_CLOSE_SHORT = "close-short-position";
    private static final String ORDER_TYPE_CLOSE_LONG = "plan-close-long-position";
    private static final String ORDER_TYPE_CLOSE_SHORT = "plan-close-short-position";
    private final GateConfig config;
    private final GateTradeExecutor executor;
@@ -362,10 +362,11 @@
                }
            }
        }
        log.info("[Gate] 原空队列:{}", shortPriceQueue);
        if (matched.isEmpty()) {
            log.info("[Gate] 空仓队列未触发, 当前价:{}", currentPrice);
            return;
        }
        log.info("[Gate] 空仓队列触发, 匹配{}个元素, 当前价:{}", matched.size(), currentPrice);
        if (!isMarginSafe()) {
            log.warn("[Gate] 保证金超限,跳过空单开仓");
@@ -381,7 +382,9 @@
                min = min.multiply(BigDecimal.ONE.subtract(step)).setScale(1, RoundingMode.HALF_UP);
                shortPriceQueue.add(min);
            }
            shortPriceQueue.sort((a, b) -> b.compareTo(a));
            shortPriceQueue.sort(BigDecimal::compareTo);
            log.info("[Gate] 现空队列:{}", shortPriceQueue);
        }
        synchronized (longPriceQueue) {
@@ -404,7 +407,9 @@
                }
            }
        }
        log.info("[Gate] 原多队列:{}", longPriceQueue);
        if (matched.isEmpty()) {
            log.info("[Gate] 多仓队列未触发,  当前价:{}", currentPrice);
            return;
        }
@@ -424,6 +429,8 @@
                longPriceQueue.add(max);
            }
            longPriceQueue.sort(BigDecimal::compareTo);
            log.info("[Gate] 现多队列:{}", longPriceQueue);
        }
        synchronized (shortPriceQueue) {