From 6a51883c6d96702df7e1df023b3ad3e0fd575b16 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 17 Dec 2025 16:15:33 +0800
Subject: [PATCH] feat(okx): 实现新的价格WebSocket客户端并优化量化操作
---
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
index cdb9117..8c97c0b 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
@@ -31,8 +31,6 @@
*/
@Slf4j
public class OkxQuantWebSocketClient {
- private final WangGeService wangGeService;
- private final CaoZuoService caoZuoService;
private final RedisUtils redisUtils;
private final ExchangeInfoEnum account;
@@ -45,11 +43,17 @@
private final AtomicBoolean isConnected = new AtomicBoolean(false);
private final AtomicBoolean isConnecting = new AtomicBoolean(false);
- public OkxQuantWebSocketClient(ExchangeInfoEnum account, WangGeService wangGeService,
- CaoZuoService caoZuoService, RedisUtils redisUtils) {
+ /**
+ * 获取WebSocketClient实例
+ * @return WebSocketClient实例
+ */
+ public WebSocketClient getWebSocketClient() {
+ return webSocketClient;
+ }
+
+ public OkxQuantWebSocketClient(ExchangeInfoEnum account,
+ RedisUtils redisUtils) {
this.account = account;
- this.wangGeService = wangGeService;
- this.caoZuoService = caoZuoService;
this.redisUtils = redisUtils;
}
@@ -372,8 +376,8 @@
OrderInfoWs.handleEvent(response, redisUtils, account.name());
}else if (AccountWs.ACCOUNTWS_CHANNEL.equals(channel)) {
AccountWs.handleEvent(response, account.name());
- String side = caoZuoService.caoZuo(account.name());
- TradeOrderWs.orderEvent(webSocketClient, side, account.name());
+// String side = caoZuoService.caoZuo(account.name());
+// TradeOrderWs.orderEvent(webSocketClient, side, account.name());
} else if (PositionsWs.POSITIONSWS_CHANNEL.equals(channel)) {
PositionsWs.handleEvent(response, account.name());
} else if (BalanceAndPositionWs.CHANNEL_NAME.equals(channel)) {
--
Gitblit v1.9.1