| | |
| | | } |
| | | log.info("profitOrLoss:{}", profitOrLoss); |
| | | |
| | | BigDecimal rewardRatio = profitOrLoss.divide(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), 4, BigDecimal.ROUND_DOWN); |
| | | // 保证金 |
| | | BigDecimal bondAmount = CalculateUtil.getBondAmount(holdOrderEntity.getOpeningPrice(), lotNumber, closeCnt, holdOrderEntity.getLeverRatio()); |
| | | |
| | |
| | | contractOrderEntity.setClosingType(closingType); |
| | | contractOrderEntity.setSymbolCnt(closeCnt); |
| | | contractOrderEntity.setRewardAmount(profitOrLoss); |
| | | contractOrderEntity.setRewardRatio(rewardRatio); |
| | | contractOrderEntity.setBondAmount(bondAmount.add(fee)); |
| | | contractOrderEntity.setClosingFeeAmount(fee); |
| | | contractOrderEntity.setClosingTime(new Date()); |
| | |
| | | contractOrderEntity.setEntrustOpeningPrice(newPrice); |
| | | contractOrderEntity.setEntrustTime(new Date()); |
| | | contractOrderEntity.setClosingPrice(newPrice); |
| | | contractOrderEntity.setOrderType(orderType); |
| | | contractOrderEntity.setTradeType(ContractOrderEntity.TRADE_TYPE_LIMIT_PRICE); |
| | | contractOrderEntity.setOrderType(entrustOrder.getEntrustType()); |
| | | contractOrderEntity.setClosingType(closingType); |
| | | contractOrderEntity.setSymbolCnt(closeCnt); |
| | | contractOrderEntity.setRewardAmount(profitOrLoss); |
| | | contractOrderEntity.setBondAmount(bondAmount); |
| | | contractOrderEntity.setClosingTime(new Date()); |
| | | contractOrderEntity.setClosingFeeAmount(fee); |
| | | contractOrderDao.insert(contractOrderEntity); |
| | | |