Learn Algo Trading with Python | Codes | Youtube Series

thank you sir

Thanks @Tradehull_Imran Sorry, why Expiry=0 ? :confused:

Hi @Rajashekhar_Rangappa

  • Expiry (int): The expiry to select.
    • 0 - Current week/month (depending on expiry type)
    • 1 - Next week/month (depending on expiry type)
    • and so on for subsequent weeks/months.

Thus we don’t need to manually hardcode expiry dates, writing 0/1/2/3 … makes expiry selection easier

1 Like

last 3 days i learned all comment on community and try to solve this problem but still same issue happens.

please help me how to solve this.

Step 1: Download the certifi .whl File

  1. Visit the PyPI page for certifi.
  2. Download the .whl file … certifi-2024.8.30-py3-none-any.whl` file under built Distribution
  3. Move the .whl file to Desktop > New Folder.

Step 2: Open Command Prompt as Administrator

  1. Press Win + S and type cmd.
  2. Right-click on Command Prompt and select Run as administrator.

Step 3: Navigate to the New Folder Containing the .whl File and run the .whl file

  1. On cmd write
    cd Desktop
    cd New folder
    cd New folder
    pip install certifi-2024.8.30-py3-none-any.whl

**Step 4: After this run install libraries.bat

this steps also be followd

1 Like

Thanks for the reply Sir,
But I don’t get any error but live_pnl is always displayed as 0.

Also when I run my code I get exception errors like:
“Exception for instrument name ANGEL ONE as Check the Tradingsymbol
Exception for instrument name TATA MOTORS as Check the Tradingsymbol
got exception in pnl as ‘Angel One’”

Please guide


This is python verison.

ssl certificate is also download and run. but also error is the same.

this all procedure all have one in live market.

please help me how to fix this issue.

Hi @Lokesh_Patidar

:+1: for the efforts you are putting

As of now we have upgraded to a simpler method to call for ltp
see : Learn Algo Trading with Python | Codes | Youtube Series - #952 by Tradehull_Imran

Hi @balrajsingh

Okey will check on this one

Sir also now its now working .

error is showing for ssl certificate.

Hi @Lokesh_Patidar

apply point no 3

I have checked, and it is now working properly.
Thanks for your support.

1 Like

Thank you @Tradehull_Imran. Its working now

1 Like

Hi, @Tradehull_Imran

can you please provide me sample for this how to execute it?

def get_quote(self,names):
		try:
			response = self.get_data_for_single_script(names)
			i=0
			result = {}
			if response:
				if type(names)==list:
					for i,data in enumerate(response['result']['listQuotes']):
						data = json.loads(data)
						name = self.instrument_df.loc[self.instrument_df['ExchangeInstrumentID'] == data['ExchangeInstrumentID']].iloc[0]['Description']
						result[name] = data
					return result
				else:
					data    = response['result']['listQuotes'][0]
					data    = json.loads(data)
					return data
			else:
				print('No data returned from XTS')
				return None
		except Exception as e:
			print(e)
			self.logger.exception(f"Exception in get quote function as {e}")
			traceback.print_exc()

Thanks for sharing the files Sir…
VBR Prasad

Hi @virender_singh

we can use this code

bid_ask_data = tsl.get_quote_data(names = [‘NIFTY DEC FUT’])
1 Like

Hi,

I cant find this function in Dhan_Tradehull_V2.py.
i can only see get_quote. but its not working,

may be you can share the latest version

bid_ask_data = tsl.get_quote_data(names = [‘HDFCBANK’])

response = self.get_data_for_single_script(names)

AttributeError: ‘Tradehull’ object has no attribute ‘get_data_for_single_script’
(Pdb++) bid_ask_data = tsl.get_quote(names = [‘HDFCBANK’])

Thank u very much sir ji … U R Great… “We are getting a wonderful opportunity to learn more!”

1 Like

“Thanks, sir. It has been solved now.”

1 Like