| | |
| | | if ((depth == null || item.getAdjustmentValue() == null || item.getAdjustmentValue().intValue() == 0) && (item.getMultiple().intValue() == 0 || item.getMultiple().intValue() == 1)) { |
| | | return depth; |
| | | } |
| | | if(CollectionUtil.isNotEmpty(depth.getAsks()) ){ |
| | | List<DepthEntry> asks = depth.getAsks(); |
| | | for (int i = 0; i < asks.size(); i++) { |
| | | DepthEntry depthEntry = asks.get(i); |
| | | |
| | | List<DepthEntry> asks = depth.getAsks(); |
| | | for (int i = 0; i < asks.size(); i++) { |
| | | DepthEntry depthEntry = asks.get(i); |
| | | |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | depthEntry.setAmount(Arith.mul(depthEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | depthEntry.setAmount(depthEntry.getAmount()); |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | depthEntry.setAmount(Arith.mul(depthEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | depthEntry.setAmount(depthEntry.getAmount()); |
| | | } |
| | | depthEntry.setPrice(Arith.add(depthEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | depthEntry.setPrice(Arith.add(depthEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | |
| | | List<DepthEntry> bids = depth.getBids(); |
| | | for (int i = 0; i < bids.size(); i++) { |
| | | DepthEntry depthEntry = bids.get(i); |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | depthEntry.setAmount(Arith.mul(depthEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | depthEntry.setAmount(depthEntry.getAmount()); |
| | | if(CollectionUtil.isNotEmpty(depth.getBids())){ |
| | | List<DepthEntry> bids = depth.getBids(); |
| | | for (int i = 0; i < bids.size(); i++) { |
| | | DepthEntry depthEntry = bids.get(i); |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | depthEntry.setAmount(Arith.mul(depthEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | depthEntry.setAmount(depthEntry.getAmount()); |
| | | } |
| | | depthEntry.setPrice(Arith.add(depthEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | depthEntry.setPrice(Arith.add(depthEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | |
| | | return depth; |
| | | } |
| | | |
| | |
| | | if ((trade == null || item.getAdjustmentValue() == null || item.getAdjustmentValue().doubleValue() == 0) && (item.getMultiple().doubleValue() == 0 || item.getMultiple().doubleValue() == 1)) { |
| | | return trade; |
| | | } |
| | | List<TradeEntry> data = trade.getData(); |
| | | for (int i = 0; i < data.size(); i++) { |
| | | TradeEntry tradeEntry = data.get(i); |
| | | if(CollectionUtil.isNotEmpty(trade.getData())){ |
| | | List<TradeEntry> data = trade.getData(); |
| | | for (int i = 0; i < data.size(); i++) { |
| | | TradeEntry tradeEntry = data.get(i); |
| | | |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | tradeEntry.setAmount(Arith.mul(tradeEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | tradeEntry.setAmount(tradeEntry.getAmount()); |
| | | /** |
| | | * 调整交易量倍数和 行情值 |
| | | */ |
| | | if (item.getMultiple().doubleValue() > 0) { |
| | | tradeEntry.setAmount(Arith.mul(tradeEntry.getAmount(), item.getMultiple().doubleValue())); |
| | | } else { |
| | | tradeEntry.setAmount(tradeEntry.getAmount()); |
| | | } |
| | | tradeEntry.setPrice(Arith.add(tradeEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | tradeEntry.setPrice(Arith.add(tradeEntry.getPrice(), item.getAdjustmentValue().doubleValue())); |
| | | } |
| | | return trade; |
| | | |