Administrator
2026-05-18 e167ed6f9ad83f2caa7aadb0f9dd9ae223cbfcbf
src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
@@ -1,6 +1,7 @@
package com.xcong.excoin.modules.gateApi;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -172,6 +173,38 @@
        }
    }
    /**
     * 获取所有已挂多仓条件单的网格元素。
     *      小于空仓仓位线的多单
     *
     * @return 已挂多仓条件单的 GridElement 列表
     */
    public static List<GridElement> findAllLongOrders(BigDecimal currentPrice) {
        List<GridElement> result = new ArrayList<>();
        for (GridElement e : INDEX.values()) {
            if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) < 0) {
                result.add(e);
            }
        }
        return result;
    }
    /**
     * 获取所有已挂空仓条件单的网格元素。
     *      大于多仓仓位线的空单
     *
     * @return 已挂空仓条件单的 GridElement 列表
     */
    public static List<GridElement> findAllShortOrders(BigDecimal currentPrice) {
        List<GridElement> result = new ArrayList<>();
        for (GridElement e : INDEX.values()) {
            if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) < 0) {
                result.add(e);
            }
        }
        return result;
    }
    private static void putDynamicIndices(GridElement e) {
        PRICE_INDEX.put(e.getGridPrice(), e);
        if (e.getLongOrderId() != null) {