From dad0b1cd6cd39d2525f23b1b33df19932fc4cddb Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 29 Jun 2026 11:28:27 +0800
Subject: [PATCH] 止损追单逻辑(多仓/空仓对称): 触发 → 查询 → 计算 → 下单 清理:取消相邻网格旧挂单 + 取消最远止盈单 一句话总结:每次止损触发补回 quantity*2 张,但总持仓不超 maxPositionSize,也不再累加放大。
---
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
index 0da4642..af91983 100644
--- a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
+++ b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
@@ -37,13 +37,11 @@
// 可以操作
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());
}
}
- log.info("---->{}", JSONObject.toJSONString(list));
if (CollectionUtils.isNotEmpty(list)) {
dealAscPriceOrderAndSenMq(list, symbol);
}
@@ -88,6 +86,7 @@
for (AscBigDecimal asc : list) {
String key = asc.getValue().toPlainString();
assert orderMap != null;
+ log.info("----->->{}, --> {}", JSONObject.toJSONString(orderMap), key);
if (orderMap.containsKey(key)) {
orderModelList.addAll(orderMap.get(key));
orderMap.remove(key);
@@ -160,6 +159,7 @@
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);
--
Gitblit v1.9.1