jugaad-py / jugaad-trader

Unofficial python client for Zerodha
https://marketsetup.in/documentation/jugaad-trader/
157 stars 112 forks source link

Error placing multiple orders Zerodha #16

Closed iamknownstranger closed 3 years ago

iamknownstranger commented 3 years ago

HTTPSConnectionPool(host='kite.zerodha.com', port=443): Max retries exceeded with url: /oms/quote/ltp?i=9957378 (Caused by SSLError(SSLError("read error: Error([('SSL routines', 'ssl3_get_record', 'decryption failed or bad record mac')])")))

I'm using multithreading to place errors this error is being raised despite multiple exceptions handling.

iamknownstranger commented 3 years ago

Error raised with kite.ltp()

priyalorha commented 3 years ago

More than an error, it could be because of the service being not available.

On Wed, Jun 30, 2021 at 6:24 AM Chandra Sekhar Mullu < @.***> wrote:

Error raised with kite.ltp()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jugaad-py/jugaad-trader/issues/16#issuecomment-871017850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6R4KMRUP5TZTMTXODMTGLTVJTNNANCNFSM47RI4Q4A .

sevakram commented 3 years ago

I read through the stack overflow answers, i think it is related to network issue or service availablity as @priyalorha mentioned.

Even though the error says SSLError, it might have caused because it could not decrypt completely as connectivity terminated.

Next steps-

  1. To eliminate network issue try running it in a VM in cloud such as GCP/aws/digital ocean. There connectivity will not be an issue
  2. If it still persists, then one possibility is that Zerodha is throttling your requests, the api we use for jugaad is meant for browser, and browsers do not fetch data in multiple threads at high rates. So solution might be to reduce the rate at which you are sending requests or if you have mastered your algorithm and earning a good amount, consider switching to official API

Do let us know whqt was the issue

sevakram commented 3 years ago

Refer this discussion on official Kite API

/instruments (market quote call) - max 60 requests per minute /instruments/historical - max 120 requests per minute (2 requests/sec)

sevakram commented 3 years ago

Closing the issue for now, please reopen in case you face same issue