| | |
| | | package com.xcong.excoin.modules.gateApi; |
| | | |
| | | import com.xcong.excoin.modules.gateApi.wsHandler.handler.CandlestickChannelHandler; |
| | | import com.xcong.excoin.modules.gateApi.wsHandler.handler.OrdersChannelHandler; |
| | | import com.xcong.excoin.modules.gateApi.wsHandler.handler.PositionClosesChannelHandler; |
| | | import com.xcong.excoin.modules.gateApi.wsHandler.handler.PositionsChannelHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | config.getApiKey(), config.getApiSecret(), config.getContract(), gridTradeService)); |
| | | wsClient.addChannelHandler(new PositionClosesChannelHandler( |
| | | config.getApiKey(), config.getApiSecret(), config.getContract(), gridTradeService)); |
| | | wsClient.addChannelHandler(new OrdersChannelHandler( |
| | | config.getApiKey(), config.getApiSecret(), config.getContract(), gridTradeService)); |
| | | wsClient.init(); |
| | | log.info("[管理器] WS已连接, 已注册 3 个频道处理器"); |
| | | log.info("[管理器] WS已连接, 已注册 4 个频道处理器"); |
| | | |
| | | // 3. 激活策略,等待首根 K 线触发基底双开 |
| | | gridTradeService.startGrid(); |
| | |
| | | log.info("[管理器] 销毁完成"); |
| | | } |
| | | |
| | | /** |
| | | * @return WebSocket 连接管理器实例 |
| | | */ |
| | | public GateKlineWebSocketClient getKlineWebSocketClient() { return wsClient; } |
| | | /** |
| | | * @return 网格交易策略服务实例 |
| | | */ |
| | | public GateGridTradeService getGridTradeService() { return gridTradeService; } |
| | | } |