| | |
| | | |
| | | Integer upId = matchedUpGridElement.getUpId(); |
| | | GridElement newEntryGrid = GridElement.findById(upId); |
| | | |
| | | if (newEntryGrid != null) { |
| | | GridElement cancelGridElement = GridElement.findById(newEntryGrid.getUpId()); |
| | | |
| | | if (cancelGridElement != null) { |
| | | |
| | | if (newEntryGrid != null) { |
| | | BigDecimal triggerPrice = newEntryGrid.getGridPrice(); |
| | | String size = cancelGridElement.getLongTraderParam().getQuantity(); |
| | | log.info("[Gate] 多仓仓位归零 gridId:{}, 挂{}基础张多单", |
| | |
| | | placeEntryOrderWithPreFlag(newEntryGrid, true, triggerPrice, |
| | | FuturesPriceTrigger.RuleEnum.NUMBER_1, size); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 看是否有多仓挂单,有就取消 |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private void processLongGrid(BigDecimal currentPrice) { |
| | |
| | | |
| | | Integer downId = matchedUpGridElement.getDownId(); |
| | | GridElement newEntryGrid = GridElement.findById(downId); |
| | | |
| | | if (newEntryGrid != null) { |
| | | GridElement cancelGridElement = GridElement.findById(newEntryGrid.getDownId()); |
| | | |
| | | if (cancelGridElement != null) { |
| | | |
| | | if (newEntryGrid != null) { |
| | | BigDecimal triggerPrice = newEntryGrid.getGridPrice(); |
| | | String size = cancelGridElement.getShortTraderParam().getQuantity(); |
| | | log.info("[Gate] 空仓仓位归零 gridId:{}, 挂{}基础张多单", |
| | |
| | | newEntryGrid.getShortTraderParam().setQuantity(size); |
| | | placeEntryOrderWithPreFlag(newEntryGrid, false, triggerPrice, |
| | | FuturesPriceTrigger.RuleEnum.NUMBER_2, negate(size)); |
| | | } |
| | | |
| | | /** |
| | | * 看是否有空仓挂单,有就取消 |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private void handleLongStopLossTriggered(GridElement gridElement) { |