| | |
| | | |
| | | checkProfitAndReset(); |
| | | |
| | | // if (state == StrategyState.ACTIVE && |
| | | // longActive == false && |
| | | // longPositionSize.compareTo(BigDecimal.ZERO) == 0){ |
| | | // processShortGrid(closePrice); |
| | | // } |
| | | // |
| | | // |
| | | // if (state == StrategyState.ACTIVE && |
| | | // shortActive == false && |
| | | // shortPositionSize.compareTo(BigDecimal.ZERO) == 0){ |
| | | // processLongGrid(closePrice); |
| | | // } |
| | | if (state == StrategyState.ACTIVE && |
| | | longActive == false && |
| | | longPositionSize.compareTo(BigDecimal.ZERO) == 0){ |
| | | processShortGrid(closePrice); |
| | | } |
| | | |
| | | |
| | | if (state == StrategyState.ACTIVE && |
| | | shortActive == false && |
| | | shortPositionSize.compareTo(BigDecimal.ZERO) == 0){ |
| | | processLongGrid(closePrice); |
| | | } |
| | | } |
| | | |
| | | /** Gate 永续合约 taker 费率 0.05% */ |
| | |
| | | if (longTpElem != null && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) { |
| | | longTakeProfitTraderIdParam(longTpElem, null, false); |
| | | log.info("[Gate] 多仓止盈触发 gridId:{}, orderId:{}", longTpElem.getId(), orderId); |
| | | // cancelFarthestLongStopLoss(); |
| | | cancelFarthestLongStopLoss(); |
| | | // checkLastTakeProfitAndRestart(); |
| | | return; |
| | | } |
| | |
| | | if (shortTpElem != null && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) { |
| | | shortTakeProfitTraderIdParam(shortTpElem, null, false); |
| | | log.info("[Gate] 空仓止盈触发 gridId:{}, orderId:{}", shortTpElem.getId(), orderId); |
| | | // cancelFarthestShortStopLoss(); |
| | | cancelFarthestShortStopLoss(); |
| | | // checkLastTakeProfitAndRestart(); |
| | | return; |
| | | } |