| | |
| | | closingPrice = price.multiply(amount).multiply(tradeSetting.getCoinFeeRatio());
|
| | | totalPayPrice = price.multiply(amount).add(closingPrice);
|
| | | entrustAmount = price.multiply(amount);
|
| | | // 限价买不能高于当前10%
|
| | | if (OrderCoinsEntity.ORDERTYPE_BUY == type) {
|
| | | BigDecimal multiply = nowPrice.multiply(new BigDecimal("1.2"));
|
| | | if(price.compareTo(multiply)>0){
|
| | | return Result.fail("不能高于当前价的120%");
|
| | | }
|
| | | }else{
|
| | | // 卖不能小于当前90
|
| | | BigDecimal multiply = nowPrice.multiply(new BigDecimal("0.8"));
|
| | | if(price.compareTo(multiply)<0){
|
| | | return Result.fail("不能低于当前价的80%");
|
| | | }
|
| | | }
|
| | | } else {
|
| | | // 市价
|
| | | if (OrderCoinsEntity.ORDERTYPE_BUY == type) {
|