[API] How to Terminate websocket conditionally

Hi @Dhan , @Dhan_Help, @Hardik ,

  1. Just like I start the wss using feed.run_forever(), what is the syntax to end dhan wss?
    I tried feed.close(), but doesn’t seems to work

  2. Also once feed.run_forever() is started, can we subscribe or unsubscribe instruments?

Hello @TraderX

  1. We are working on few updates on DhanHQ Python Library, this should be fixed post that.
  2. Yes, you can, using subscribe_symbols function.
1 Like

How to disconnect the sockets?

Hi @Hardik,

is there an update on way to terminating the feed condition basis?

Hi @Tradex,

Were you able to find an alternative way to terminate the feed