| | |
| | | .leverage("100") |
| | | .marginMode("CROSS") |
| | | .positionMode("dual") |
| | | .gridRate(new BigDecimal("0.002")) |
| | | .expectedProfit(new BigDecimal("0.5")) |
| | | .gridRate(new BigDecimal("0.0025")) |
| | | .expectedProfit(new BigDecimal("0.05")) |
| | | .maxLoss(new BigDecimal("1.5")) |
| | | .baseQuantity("10") |
| | | .baseQuantity("1") |
| | | .quantity("1") |
| | | .maxPositionSize(2) |
| | | .priceScale(2) |
| | | .contractMultiplier(new BigDecimal("0.01")) |
| | | .unrealizedPnlPriceMode(GateConfig.PnLPriceMode.LAST_PRICE) |
| | |
| | | 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 个频道处理器"); |
| | | |