| | |
| | | AdjustmentValueCache.getDelayValue().remove(symbol); |
| | | } else { |
| | | // 本次调整值 |
| | | BigDecimal currentValue_frequency = delayValue.getValue().divide(new BigDecimal(frequency), decimal, RoundingMode.HALF_UP); |
| | | BigDecimal currentValue_frequency = delayValue.getValue().divide(new BigDecimal(frequency), decimal, RoundingMode.DOWN); |
| | | |
| | | if (currentValue == null) { |
| | | AdjustmentValueCache.getCurrentValue().put(symbol, currentValue_frequency); |
| | |
| | | currentValue = AdjustmentValueCache.getCurrentValue().get(realtime.getSymbol()); |
| | | |
| | | if (currentValue != null && currentValue.compareTo(BigDecimal.ZERO) != 0) { |
| | | realtime.setClose(realtime.getClose().add(currentValue).setScale(decimal, RoundingMode.HALF_UP)); |
| | | realtime.setClose(realtime.getClose().add(currentValue).setScale(decimal, RoundingMode.DOWN)); |
| | | BigDecimal ask = realtime.getAsk(); |
| | | if(ask!=null){ |
| | | realtime.setAsk(ask.add(currentValue).setScale(decimal, RoundingMode.HALF_UP)); |
| | | realtime.setAsk(ask.add(currentValue).setScale(decimal, RoundingMode.DOWN)); |
| | | } |
| | | BigDecimal bid = realtime.getBid(); |
| | | if(bid!=null){ |
| | | realtime.setBid(bid.add(currentValue).setScale(decimal, RoundingMode.HALF_UP)); |
| | | realtime.setBid(bid.add(currentValue).setScale(decimal, RoundingMode.DOWN)); |
| | | } |
| | | // realtime.setVolume(Arith.add(realtime.getVolume(), Arith.mul(Arith.div(currentValue, realtime.getClose()), realtime.getVolume()))); |
| | | // realtime.setAmount(Arith.add(realtime.getAmount(), Arith.mul(Arith.div(currentValue, realtime.getClose()), realtime.getAmount()))); |