| | |
| | | log.info("------------------currentPrice-------------:"+currentPrice); |
| | | log.info("------------------order.getForceClosePrice()-------------"+order.getForceClosePrice()); |
| | | log.info("------------------开多强平-------------"); |
| | | |
| | | double number = strongLevelCalculationService.countSheets(earnings.doubleValue(), order.getLeverRate().intValue(), 0.01, order.getTradeAvgPrice().doubleValue()); |
| | | BigDecimal qpPoint = currentPrice.subtract(order.getTradeAvgPrice()); |
| | | BigDecimal qpAmount = qpPoint.multiply(new BigDecimal("0.01")).multiply(new BigDecimal(number)).setScale(4, BigDecimal.ROUND_DOWN);; |
| | | log.info(order.getOrderNo()+"--------强平收益:"+amount); |
| | | order.setProfit(qpAmount); |
| | | this.contractOrderService.allClose(order.getPartyId()); |
| | | |
| | | } |
| | |
| | | log.info("------------------currentPrice-------------:"+currentPrice); |
| | | log.info("------------------order.getForceClosePrice()-------------"+order.getForceClosePrice()); |
| | | log.info("------------------开空强平-------------"); |
| | | double number = strongLevelCalculationService.countSheets(earnings.doubleValue(), order.getLeverRate().intValue(), 0.01, order.getTradeAvgPrice().doubleValue()); |
| | | BigDecimal qpPoint = currentPrice.subtract(order.getTradeAvgPrice()); |
| | | BigDecimal qpAmount = qpPoint.multiply(new BigDecimal("0.01")).multiply(new BigDecimal(number)).setScale(4, BigDecimal.ROUND_DOWN);; |
| | | log.info(order.getOrderNo()+"--------强平收益:"+amount); |
| | | order.setProfit(qpAmount.negate()); |
| | | this.contractOrderService.allClose(order.getPartyId()); |
| | | |
| | | } |