| | |
| | | realtime.setTs(Long.valueOf(realtime.getTs() + "000")); |
| | | } |
| | | realtime.setName(item.getName()); |
| | | if (high == null || realtime.getHigh().doubleValue() > high) { |
| | | /*if (high == null || realtime.getHigh().doubleValue() > high) { |
| | | DataCache.getRealtimeHigh().put(symbol, realtime.getHigh().doubleValue()); |
| | | } |
| | | if ((low == null || realtime.getLow().doubleValue() < low) && realtime.getLow().doubleValue() > 0) { |
| | | DataCache.getRealtimeLow().put(symbol, realtime.getLow().doubleValue()); |
| | | }*/ |
| | | if (high != null) { |
| | | realtime.setHigh(BigDecimal.valueOf(high)); |
| | | } |
| | | if (low != null) { |
| | | realtime.setLow(BigDecimal.valueOf(low)); |
| | | } |
| | | this.dataDBService.saveAsyn(realtime); |
| | | } |
| | |
| | | public static void main(String[] args) { |
| | | AbstractGetDataJob abstractGetDataJob = new CryptosGetDataJob(); |
| | | List<BigDecimal> list = new ArrayList<>(); |
| | | int frequency = 200; |
| | | int decimal = 6; |
| | | int frequency = 166; |
| | | int decimal = 4; |
| | | //分几段执行 |
| | | int nums = Math.max(10, frequency / 10); |
| | | List<BigDecimal> result = RandomNumbersGenerator.generateNumbers(BigDecimal.valueOf(0.02), nums, decimal + 4); |
| | | List<BigDecimal> result = RandomNumbersGenerator.generateNumbers(BigDecimal.valueOf(0.0026), nums, decimal + 4); |
| | | System.out.println(result); |
| | | for (int i = 0; i < result.size(); i++) { |
| | | list.addAll(abstractGetDataJob.generateRandomAdjustments(result.get(i), frequency / 10, decimal)); |
| | | List<BigDecimal> numbers = abstractGetDataJob.generateRandomAdjustments(result.get(i), frequency / 10, decimal); |
| | | list.addAll(numbers); |
| | | } |
| | | |
| | | BigDecimal sum = BigDecimal.ZERO; |