I’m currently migrating my trading code from my previous broker to Dhan. While doing so, I noticed that Dhan does not currently provide a socket-based API for live position updates. This feature is quite essential for managing open positions.
Could you please let me know if there are any plans to introduce a WebSocket-based position API in the near future?
Thanks,
Hello @Vishal_Singh
Yes, we do have Positions API and Socket updates for orders. Positions change only post order execution, and this is why mainly API serves as a better solution which can be polled as required or on the event of any order execution.
Can you let us know more about the use case, how socket helps your use case?
I use a position socket API to trail my stop-loss orders in real time. Since my trades typically last less than a minute, relying on a polling-based API means I’d need to hit the endpoint every 2–3 seconds, which feels both inefficient and redundant.
A socket-based position API would be ideal in this scenario—it could push updates instantly, allowing me to respond within seconds and manage exits more effectively. This makes it a strong use case for active traders like me.