Administrator
just now 0d9c31cc7be76229cf71e141444598992758ebf6
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -513,11 +513,13 @@
            log.info("[Gate] 多止盈队列:{}", longTakeProfitQueue);
            log.info("[Gate] 空止盈队列:{}", shortTakeProfitQueue);
            executor.placeGridLimitOrder(longPriceQueue.get(0), config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 初始限价多单已挂, id:{}", orderId); },
            executor.placeConditionalEntryOrder(longPriceQueue.get(0),
                    FuturesPriceTrigger.RuleEnum.NUMBER_1, config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 初始条件多单已挂, id:{}, trigger:{}", orderId, longPriceQueue.get(0)); },
                    null);
            executor.placeGridLimitOrder(shortPriceQueue.get(0), negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 初始限价空单已挂, id:{}", orderId); },
            executor.placeConditionalEntryOrder(shortPriceQueue.get(0),
                    FuturesPriceTrigger.RuleEnum.NUMBER_2, negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 初始条件空单已挂, id:{}, trigger:{}", orderId, shortPriceQueue.get(0)); },
                    null);
            state = StrategyState.ACTIVE;
@@ -638,15 +640,17 @@
        log.info("[Gate] 空止盈队列增加:{}, 现止盈队列:{}", stpElem, shortTakeProfitQueue);
        if (!isMarginSafe()) {
            log.warn("[Gate] 保证金超限,跳过挂限价单");
            log.warn("[Gate] 保证金超限,跳过挂条件单");
        } else {
            String oldLongId = currentLongOrderId;
            executor.cancelOrder(oldLongId);
            executor.placeGridLimitOrder(newShortFirst, negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 新限价空单, id:{}, price:{}", orderId, newShortFirst); },
            executor.cancelConditionalOrder(oldLongId);
            executor.placeConditionalEntryOrder(newShortFirst,
                    FuturesPriceTrigger.RuleEnum.NUMBER_2, negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 新条件空单, id:{}, trigger:{}", orderId, newShortFirst); },
                    null);
            executor.placeGridLimitOrder(newLongFirst, config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 新限价多单, id:{}, price:{}", orderId, newLongFirst); },
            executor.placeConditionalEntryOrder(newLongFirst,
                    FuturesPriceTrigger.RuleEnum.NUMBER_1, config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 新条件多单, id:{}, trigger:{}", orderId, newLongFirst); },
                    null);
        }
@@ -736,15 +740,17 @@
        log.info("[Gate] 多止盈队列增加:{}, 现止盈队列:{}", ltpElem, longTakeProfitQueue);
        if (!isMarginSafe()) {
            log.warn("[Gate] 保证金超限,跳过挂限价单");
            log.warn("[Gate] 保证金超限,跳过挂条件单");
        } else {
            String oldShortId = currentShortOrderId;
            executor.cancelOrder(oldShortId);
            executor.placeGridLimitOrder(newLongFirst, config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 新限价多单, id:{}, price:{}", orderId, newLongFirst); },
            executor.cancelConditionalOrder(oldShortId);
            executor.placeConditionalEntryOrder(newLongFirst,
                    FuturesPriceTrigger.RuleEnum.NUMBER_1, config.getQuantity(),
                    orderId -> { currentLongOrderId = orderId; log.info("[Gate] 新条件多单, id:{}, trigger:{}", orderId, newLongFirst); },
                    null);
            executor.placeGridLimitOrder(newShortFirst, negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 新限价空单, id:{}, price:{}", orderId, newShortFirst); },
            executor.placeConditionalEntryOrder(newShortFirst,
                    FuturesPriceTrigger.RuleEnum.NUMBER_2, negate(config.getQuantity()),
                    orderId -> { currentShortOrderId = orderId; log.info("[Gate] 新条件空单, id:{}, trigger:{}", orderId, newShortFirst); },
                    null);
        }