Issue this my ltp problem

from Zerodha_Tradehull import Tradehull

api_key    = "dsfsdfdsf"
api_secret = "assddsfsdf"
tsl        = Tradehull(api_key, api_secret, "yes")
kite       = tsl.kite


print()

ltp = tsl.get_data_for_single_script(exchange="NSE", name="ACC", call_type ="ltp")

mera api connect ho rha hai par ltp code run kr rha ho to 
ye error show ho rhi hai

ltp = tsl.get_data_for_single_script(exchange="NSE", name="ACC", call_type ="ltp")

Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'tsl' is not defined

Hi @javed_khan ,

Based on your output it seems it has not logged in properly,


You have firstly get like this. Follow the below steps.

  1. Make sure you have enabled your Zerodha user id in this link: https://developers.kite.trade/
  2. After you run the program copy the generate request token url and paste it in your chrome browser.
  3. Login with your credentials and copy the generated url and paster it in the cmd.
  4. Once login is successful then you can retrive the ltp.

type or paste code here

Hi @javed_khan ,

Now it seems you have logged in successfully, do try to fetch ltp using the below code.

ltp = tsl.get_data_for_single_script(exchange="NSE", name="ACC", call_type ="ltp")