| | |
| | | // if (profit.add(wallet.getMoney()).compareTo(BigDecimal.ZERO) <= 0) { |
| | | //判断买涨还是买跌"buy":买(多) "sell":卖(空) |
| | | if(order.getDirection().equals("buy")){ |
| | | if (currentPrice.toString().compareTo(order.getForceClosePrice()) <= 0) {//达到强平价 |
| | | if (currentPrice.compareTo(new BigDecimal(order.getForceClosePrice())) <= 0) {//达到强平价 |
| | | /** |
| | | * 触发全仓强平 |
| | | */ |
| | |
| | | |
| | | } |
| | | }else{ |
| | | if (currentPrice.toString().compareTo(order.getForceClosePrice())>= 0) {//达到强平价 |
| | | if (currentPrice.compareTo(new BigDecimal(order.getForceClosePrice()))>= 0) {//达到强平价 |
| | | /** |
| | | * 触发全仓强平 |
| | | */ |
| | |
| | | } |
| | | } else { |
| | | if(order.getDirection().equals("buy")){ |
| | | if (currentPrice.toString().compareTo(order.getForceClosePrice()) <= 0) {//达到强平价 |
| | | if (currentPrice.compareTo(new BigDecimal(order.getForceClosePrice())) <= 0) {//达到强平价 |
| | | this.contractOrderService.saveClose(order.getPartyId().toString(), order.getOrderNo(),"强平"); |
| | | } |
| | | }else{ |
| | | if (currentPrice.toString().compareTo(order.getForceClosePrice()) >= 0) {//达到强平价 |
| | | if (currentPrice.compareTo(new BigDecimal(order.getForceClosePrice())) >= 0) {//达到强平价 |
| | | this.contractOrderService.saveClose(order.getPartyId().toString(), order.getOrderNo(),"强平"); |
| | | } |
| | | } |