| | |
| | | String quantity = String.valueOf((accumulatedLongLossCount + 1) * Integer.parseInt(config.getQuantity())); |
| | | // 向上遍历取消所有遗留多单(跳过基础入场网格0) |
| | | GridElement cancelCursor = GridElement.findById(newEntryGrid.getUpId()); |
| | | while (cancelCursor != null && cancelCursor.getId() < 0) { |
| | | while (cancelCursor != null) { |
| | | if (cancelCursor.isHasLongOrder()) { |
| | | for (String longOrderId : new ArrayList<>(cancelCursor.getLongOrderIds())) { |
| | | GridElement finalCancelCursor = cancelCursor; |
| | |
| | | String quantity = String.valueOf((accumulatedShortLossCount + 1) * Integer.parseInt(config.getQuantity())); |
| | | // 向下遍历取消所有遗留空单(跳过基础入场网格0) |
| | | GridElement cancelCursor = GridElement.findById(newEntryGrid.getDownId()); |
| | | while (cancelCursor != null && cancelCursor.getId() > 0) { |
| | | while (cancelCursor != null) { |
| | | if (cancelCursor.isHasShortOrder()) { |
| | | for (String shortOrderId : new ArrayList<>(cancelCursor.getShortOrderIds())) { |
| | | GridElement finalCancelCursor = cancelCursor; |