| | |
| | | private static final String FUTURES_PING = "futures.ping"; |
| | | private static final String FUTURES_PONG = "futures.pong"; |
| | | private static final String GATE_INTERVAL = "1m"; |
| | | private static final String GATE_CONTRACT = "XAU_USDT"; |
| | | private static final String GATE_CONTRACT = "XAUT_USDT"; |
| | | |
| | | private GateGridTradeService gridTradeService; |
| | | |
| | |
| | | |
| | | public GateKlineWebSocketClient(CaoZuoService caoZuoService, |
| | | GateWebSocketClientManager clientManager, |
| | | WangGeListService wangGeListService |
| | | WangGeListService wangGeListService, |
| | | GateGridTradeService gridTradeService |
| | | ) { |
| | | this.caoZuoService = caoZuoService; |
| | | this.clientManager = clientManager; |
| | | this.wangGeListService = wangGeListService; |
| | | } |
| | | |
| | | public void setGridTradeService(GateGridTradeService gridTradeService) { |
| | | this.gridTradeService = gridTradeService; |
| | | } |
| | | |
| | |
| | | boolean windowClosed = data.getBooleanValue("w"); |
| | | String time = DateUtil.TimeStampToDateTime(t); |
| | | |
| | | System.out.println("========== Gate K线数据 =========="); |
| | | System.out.println("名称(n): " + name); |
| | | System.out.println("时间 : " + time); |
| | | System.out.println("开盘(o): " + openPx); |
| | | System.out.println("最高(h): " + highPx); |
| | | System.out.println("最低(l): " + lowPx); |
| | | System.out.println("收盘(c): " + closePx); |
| | | System.out.println("成交量(v): " + vol); |
| | | System.out.println("成交额(a): " + baseVol); |
| | | System.out.println("K线完结(w): " + windowClosed); |
| | | System.out.println("=================================="); |
| | | log.info("========== Gate K线数据 =========="); |
| | | log.info("名称(n): " + name); |
| | | log.info("时间 : " + time); |
| | | log.info("开盘(o): " + openPx); |
| | | log.info("最高(h): " + highPx); |
| | | log.info("最低(l): " + lowPx); |
| | | log.info("收盘(c): " + closePx); |
| | | log.info("成交量(v): " + vol); |
| | | log.info("成交额(a): " + baseVol); |
| | | log.info("K线完结(w): " + windowClosed); |
| | | log.info("=================================="); |
| | | |
| | | if (gridTradeService != null) { |
| | | gridTradeService.onKline(closePx, windowClosed); |
| | | gridTradeService.onKline(closePx); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("处理 K线频道推送数据失败", e); |