Hi @Tradehull_Imran (Imran Sir) and team,
I am currently following your Algorithmic Trading Series and using the provided Python scripts. However, I am facing a couple of issues while running the code for NIFTY live tick streams and option chains.
Here are the specific errors showing up in my terminal:
1. WebSocket Disconnection Error:
The live tick stream gets interrupted continuously with the following message:
[!] WEBSOCKET ERROR: no close frame received or sent | Retrying in 15 seconds…
2. Option Chain Fetching Error:
I am getting a failure status with empty data when the script tries to fetch the option chain:
Getting Error at Option Chain as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: ‘’}
Could you please guide me on how to resolve this? Is there any update required in the provided session scripts, or is this a temporary API/server-side issue?

Hi @Sahid_Islam ,
For live data, the API is used to receive the tick stream, and the implementation needs to be checked to avoid interruptions during execution.
Regarding the option chain, there is an API rate limit, so the code needs to be reviewed to identify whether the requests are being made within the permitted limits. It would be helpful if you could share which video or session you are referring to, so we can check the corresponding code and guide you accordingly.
1 Like
Hi,
Thanks for pointing that out. Could you please let me know what the exact API rate limit (requests per second/minute) is for fetching the Option Chain?
Once I know the exact limit, I will adjust the delay (using time.sleep()) in my code accordingly to avoid hitting the rate limit.
Thanks!
Hi @Sahid_Islam ,
The Option Chain API has a rate limit of 3 seconds per request. Therefore, maintain at least a 3-second interval between consecutive Option Chain API requests to avoid rate-limit issues.