I'm getting a couple of exceptions almost everyday:
1.requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /quote/ohlc?i=NFO%3ABANKNIFTY22MAY34600PE (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) - THIS IS OCCURRING WHEN SCRIPT IS EXECUTED BUT AFTER FEW MINUTES/HOURS, THIS EXECPTION IS GETTING TRIGGERED. THERE IS NO CLARITY ON HOW AND AT WHAT POINT TIME IT GETS TRIGGERED 2.kiteconnect.exceptions.NetworkException: Too many requests - THIS OCCURS WHEN THERE ARE MULTIPLE SCRIPTS RUNNING AT THE SAME TIME. AGAIN, THIS DOESN'T OCCUR EVERYTIME. SOMETIMES ALL OF THE SCRIPTS GET EXECUTED. SOMETIMES ONLY FEW GET EXECUTED AND SOMETIMES ALL OF THEM FAIL.
Please help me as the whole point of trading using coding is completely failing
Code intelligently, exceptions are Business As Usual, not just with KiteConnect, but will each and every Indian broker. Always keep in mind while writing every line involving any API call that it will hit an Exception sooner or later, so design fail safes in such cases.
Predicting and handling exceptions is the real test of ability for a trading algo developer, not just writing lines after lines of API calls..
2. This means you are crossing the rate limits.
https://kite.trade/docs/connect/v3/exceptions/#api-rate-limit
https://kite.trade/docs/connect/v3/exceptions/#common-http-error-codes
Predicting and handling exceptions is the real test of ability for a trading algo developer, not just writing lines after lines of API calls..