| | |
| | | @Autowired |
| | | private NamedParameterJdbcOperations namedParameterJdbcTemplate; |
| | | |
| | | /* public static void main(String[] args) { |
| | | BigDecimal a = BigDecimal.valueOf(0.006); |
| | | BigDecimal b = BigDecimal.valueOf(3600); |
| | | public static void main(String[] args) { |
| | | BigDecimal a = BigDecimal.valueOf(0.0007); |
| | | BigDecimal b = BigDecimal.valueOf(333); |
| | | BigDecimal c = a.divide(b, 6, BigDecimal.ROUND_HALF_UP); |
| | | System.out.println(c); |
| | | }*/ |
| | | } |
| | | @Override |
| | | public void initBySql(String symbol) { |
| | | this.bulidBySql(symbol, Kline.PERIOD_1MIN); |
| | |
| | | kline.setHigh(kline.getHigh().add(currentValue)); |
| | | kline.setAdjusted(true); |
| | | |
| | | BigDecimal last = AdjustmentValueCache.getLastValue().get(symbol); |
| | | /*BigDecimal last = AdjustmentValueCache.getLastValue().get(symbol); |
| | | if (last != null && last.compareTo(BigDecimal.ZERO) > 0) { |
| | | BigDecimal adj = currentValue.subtract(last); |
| | | if (adj.compareTo(BigDecimal.ZERO) > 0) { //递增 |
| | |
| | | } |
| | | } else { |
| | | AdjustmentValueCache.getLastValue().put(symbol, currentValue); |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | | klineDBService.save(kline); |