| | |
| | | |
| | | BigDecimal baseQuantity = new BigDecimal(config.getBaseQuantity()); |
| | | BigDecimal subtract = baseQuantity.subtract(longPositionSize); |
| | | String size = new BigDecimal(config.getQuantity()).add(new BigDecimal("1")).toString(); |
| | | if (subtract.compareTo(BigDecimal.ZERO) >=0){ |
| | | size = subtract.add(new BigDecimal("1")).toString(); |
| | | String size = new BigDecimal(config.getQuantity()).add(new BigDecimal(config.getQuantity())).toString(); |
| | | if (subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | size = subtract.add(new BigDecimal(config.getQuantity())).toString(); |
| | | } |
| | | log.info("[Gate] 多仓止损触发 gridId:{}, 在gridId:{}挂{}基础张多单", |
| | | gridId, newEntryGridId, size); |
| | |
| | | |
| | | BigDecimal baseQuantity = new BigDecimal(config.getBaseQuantity()); |
| | | BigDecimal subtract = baseQuantity.subtract(shortPositionSize); |
| | | String size = new BigDecimal(config.getQuantity()).add(new BigDecimal("1")).toString(); |
| | | if (subtract.compareTo(BigDecimal.ZERO) >=0){ |
| | | size = subtract.add(new BigDecimal("1")).toString(); |
| | | |
| | | String size = new BigDecimal(config.getQuantity()).add(new BigDecimal(config.getQuantity())).toString(); |
| | | if (subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | size = subtract.add(new BigDecimal(config.getQuantity())).toString(); |
| | | } |
| | | log.info("[Gate] 空仓止损触发 gridId:{}, 在gridId:{}挂{}基础张空单", |
| | | gridId, newEntryGridId, size); |