| | |
| | | userPositionVO.setStockPlate(position.getStockPlate()); |
| | | userPositionVO.setSpreadRatePrice(position.getSpreadRatePrice()); |
| | | PositionProfitVO positionProfitVO = getPositionProfitVO(position,nowPrice); |
| | | BigDecimal ss = positionProfitVO.getProfitAndLose().divide(userPositionVO.getBuyOrderPrice(),BigDecimal.ROUND_CEILING) |
| | | BigDecimal ss = positionProfitVO.getProfitAndLose().divide(userPositionVO.getOrderTotalPrice(),BigDecimal.ROUND_CEILING) |
| | | .multiply(new BigDecimal(100)); |
| | | userPositionVO.setProfitAndLoseParent(ss+"%"); |
| | | userPositionVO.setProfitAndLose(positionProfitVO.getProfitAndLose()); |
| | |
| | | if ("买跌".equals(position.getOrderDirection())) { |
| | | profitAndLose = profitAndLose.negate(); |
| | | } |
| | | allProfitAndLose = profitAndLose.subtract(position.getOrderFee()).subtract(position.getOrderSpread()).subtract(position.getOrderStayFee()).subtract(position.getSpreadRatePrice()); |
| | | allProfitAndLose = profitAndLose.subtract(position.getOrderSpread()).subtract(position.getOrderStayFee()).subtract(position.getSpreadRatePrice()); |
| | | } else { |
| | | BigDecimal subPrice = nowPrice.subtract(position.getBuyOrderPrice()); |
| | | profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())); |
| | |
| | | profitAndLose = profitAndLose.negate(); |
| | | } |
| | | //总盈亏= 浮动盈亏 – 手续费 – 印花税 – 留仓费 – 点差费 |
| | | allProfitAndLose = profitAndLose.subtract(position.getOrderFee()).subtract(position.getOrderSpread()).subtract(position.getOrderStayFee()).subtract(position.getSpreadRatePrice()); |
| | | allProfitAndLose = profitAndLose.subtract(position.getOrderSpread()).subtract(position.getOrderStayFee()).subtract(position.getSpreadRatePrice()); |
| | | } |
| | | PositionProfitVO positionProfitVO = new PositionProfitVO(); |
| | | positionProfitVO.setProfitAndLose(profitAndLose); |