| | |
| | | null); |
| | | |
| | | if (newShortFirst.compareTo(shortEntryPrice) > 0 |
| | | && newShortFirst.compareTo(longEntryPrice) < 0) { |
| | | && newShortFirst.compareTo(longEntryPrice) < 0 |
| | | && longPositionSize.compareTo(new BigDecimal("3")) < 0) { |
| | | BigDecimal reverseLongTp = newShortFirst.add(step).setScale(1, RoundingMode.HALF_UP); |
| | | longTakeProfitQueue.add(reverseLongTp); |
| | | longTakeProfitQueue.sort(BigDecimal::compareTo); |
| | |
| | | null); |
| | | |
| | | if (newLongFirst.compareTo(shortEntryPrice) > 0 |
| | | && newLongFirst.compareTo(longEntryPrice) < 0) { |
| | | && newLongFirst.compareTo(longEntryPrice) < 0 |
| | | && shortPositionSize.compareTo(new BigDecimal("3")) < 0) { |
| | | BigDecimal reverseShortTp = newLongFirst.subtract(step).setScale(1, RoundingMode.HALF_UP); |
| | | shortTakeProfitQueue.add(reverseShortTp); |
| | | shortTakeProfitQueue.sort((a, b) -> b.compareTo(a)); |