| | |
| | | double rate = Arith.div(volume, order.getVolume_open()); |
| | | |
| | | //平仓收益 |
| | | double mul = Arith.mul(order.getDeposit_open(), order.getLever_rate());//仓位 |
| | | double div = Arith.div(mul, order.getTrade_avg_price());//持有币的数量 |
| | | double amount = Arith.mul(div, Arith.sub(order.getClose_avg_price(), order.getTrade_avg_price())); |
| | | // double mul = Arith.mul(order.getDeposit_open(), order.getLever_rate());//仓位 |
| | | // double div = Arith.div(mul, order.getTrade_avg_price());//持有币的数量 |
| | | // double amount = Arith.mul(div, Arith.sub(order.getClose_avg_price(), order.getTrade_avg_price())); |
| | | |
| | | profit = Arith.add(Arith.mul(order.getDeposit_open(),rate),Arith.mul(order.getProfit(),rate)); |
| | | order.setAmount_close(Arith.add(order.getAmount_close(), profit)); |