| | |
| | | args.add(arg); |
| | | msg.put("args", args); |
| | | ws.send(msg.toJSONString()); |
| | | log.info("[{}] 订阅成功, 合约:{}", OkxEnums.CHANNEL_POSITIONS, instId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | args.add(arg); |
| | | msg.put("args", args); |
| | | ws.send(msg.toJSONString()); |
| | | log.info("[{}] 取消订阅成功", OkxEnums.CHANNEL_POSITIONS); |
| | | } |
| | | |
| | | @Override |
| | |
| | | ? new BigDecimal(pos.getString("avgPx")) : BigDecimal.ZERO; |
| | | BigDecimal realizedPnl = pos.containsKey("realizedPnl") && pos.getString("realizedPnl") != null |
| | | ? new BigDecimal(pos.getString("realizedPnl")) : BigDecimal.ZERO; |
| | | |
| | | log.info("[{}] 持仓更新, 方向:{}, 数量:{}, 均价:{}, 未实现盈亏:{}, 已实现盈亏:{}, 保证金:{}", |
| | | OkxEnums.CHANNEL_POSITIONS, posSide, size, avgPx, |
| | | pos.get("upl"), realizedPnl, pos.get("imr")); |
| | | |
| | | if (gridTradeService != null) { |
| | | gridTradeService.onPositionUpdate(posSide, size, avgPx, realizedPnl); |