| | |
| | | // 可以操作 |
| | | System.out.println("当前价格:" + price + "---正序---" + "队列价格:" + b.getValue().toPlainString() + " time:" + new Date()); |
| | | while (queue.peek() != null && queue.peek().compareTo(now) <= 0) { |
| | | log.info("------->"); |
| | | // 可以发送消息操作 |
| | | list.add(queue.remove()); |
| | | } |
| | |
| | | DescBigDecimal b = queue.peek(); |
| | | // 当前价格 |
| | | DescBigDecimal now = new DescBigDecimal(price); |
| | | log.info("--->{}", JSONObject.toJSONString(b)); |
| | | log.info("--->{}", JSONObject.toJSONString(now)); |
| | | List<DescBigDecimal> list = new ArrayList<DescBigDecimal>(); |
| | | // 找到比当前价格还大的就是需要操作的 开多止损 |
| | | // 即最大的币当前价大 那么需要开多止损 |
| | |
| | | } |
| | | |
| | | } |
| | | log.info("------>{}", JSONObject.toJSONString(orderModelList)); |
| | | if (CollectionUtils.isEmpty(orderModelList)) { |
| | | return; |
| | | } |
| | |
| | | for (DescBigDecimal desc : list) { |
| | | String key = desc.getValue().toPlainString(); |
| | | assert orderMap != null; |
| | | log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key); |
| | | if (orderMap.containsKey(key)) { |
| | | orderModelList.addAll(orderMap.get(key)); |
| | | orderMap.remove(key); |