from turtle import up from kiteconnect import KiteConnect from kiteconnect import KiteTicker import pandas as pd import mysql.connector from datetime import datetime,timedelta import numpy as np import os import time import requests import json
now = datetime.now() c_date= now.strftime("%Y-%m-%d") f_date="" with open('access_token.txt','r') as ak: f_date=ak.readline()[0:10]
if f_date==c_date: with open('access_token.txt') as ak: access_token=ak.readline()[10:42] print(access_token) else: print(kite.login_url()) request_toke=input("Enter request token") data = kite.generate_session(request_toke, api_secret=api_secret) with open('access_token.txt','w') as ak: ak.write(c_date) ak.write(data['access_token']) access_token=data['access_token']
update_ch="update ob set ch="+str(ch) update_cl="update ob set cl="+str(cl) update_ph="update ob set ph="+str(ph) update_pl="update ob set pl="+str(pl)
Can anyone help me i am constantly getting kite readtimeout error at fetching ltp. I tried adding sleep(0.1) but still sometimes i am facing this issue
You might be getting blocked by CDN thinking you are trying to DDOS, since you are exceeding rate limits. You can know more about rate limits on the FAQ thread.
If you need ltp every second then I would suggest using websocket API.
You can know more about rate limits on the FAQ thread.
If you need ltp every second then I would suggest using websocket API.