| | |
| | | gridTradeService = new GateGridTradeService(config); |
| | | gridTradeService.init(); |
| | | |
| | | // 2. 创建 WS 客户端并注册 3 个频道处理器 |
| | | // 2. 创建 WS 客户端并注册频道处理器 |
| | | wsClient = new GateKlineWebSocketClient(config.getWsUrl()); |
| | | wsClient.addChannelHandler(new CandlestickChannelHandler(config.getContract(), gridTradeService)); |
| | | wsClient.addChannelHandler(new PositionsChannelHandler( |
| | |
| | | config.getApiKey(), config.getApiSecret(), config.getContract(), gridTradeService)); |
| | | wsClient.addChannelHandler(new AutoOrdersChannelHandler( |
| | | config.getApiKey(), config.getApiSecret(), config.getContract(), gridTradeService)); |
| | | gridTradeService.setWsClient(wsClient); |
| | | wsClient.init(); |
| | | log.info("[管理器] WS已连接, 已注册 6 个频道处理器"); |
| | | |