| | |
| | | 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) { |
| | |
| | | while (longPriceQueue.size() > config.getGridQueueSize()) { |
| | | longPriceQueue.remove(longPriceQueue.size() - 1); |
| | | } |
| | | |
| | | log.info("[Gate] 多队列:{}", shortPriceQueue); |
| | | } |
| | | } |
| | | |
| | |
| | | longPriceQueue.add(max); |
| | | } |
| | | longPriceQueue.sort(BigDecimal::compareTo); |
| | | |
| | | log.info("[Gate] 多队列:{}", shortPriceQueue); |
| | | } |
| | | |
| | | synchronized (shortPriceQueue) { |
| | |
| | | while (shortPriceQueue.size() > config.getGridQueueSize()) { |
| | | shortPriceQueue.remove(shortPriceQueue.size() - 1); |
| | | } |
| | | |
| | | log.info("[Gate] 空队列:{}", shortPriceQueue); |
| | | } |
| | | } |
| | | |