Websoket running giving below Error


  • 2025-08-26 15:20:30,361 [INFO] Starting the live data script.
    2025-08-26 15:20:30,361 [INFO] Starting login...
    [I 250826 15:20:30 smartConnect:124] in pool
    2025-08-26 15:20:31,248 [INFO] Login successful ✅
    2025-08-26 15:20:31,952 [INFO] Websocket connected
    2025-08-26 15:20:31,954 [INFO] WebSocket connected ✅
    2025-08-26 15:20:31,955 [INFO] Subscription request sent for 195 tokens.
    2025-08-26 15:23:31,816 [WARNING] No data collected to save to Excel.
    2025-08-26 15:27:32,197 [ERROR] error from callback <bound method SmartWebSocketV2._on_close of <SmartApi.smartWebSocketV2.SmartWebSocketV2 object at 0x0000021301EC5550>>: SmartWebSocketV2._on_close() takes 2 positional arguments but 4 were


  • User websocketv2 api

    sws = SmartWebSocketV2(
    auth_token=self.auth_token,
    api_key=self.api_key,
    client_code=self.client_id,
    feed_token=self.feed_token,
    )