Hi @Tradehull_Imran
I’m facing issue while running codebase usage file
import pdb
import time
import datetime
import traceback
from Dhan_Tradehull import Tradehull
import pandas as pd
from pprint import pprint
import talib
client_code = "*******"
token_id = "*******"
tsl = Tradehull(client_code,token_id)
available_balance = tsl.get_balance()
print("available_balance", available_balance)
Error
Microsoft Windows [Version 10.0.26200.7309]
(c) Microsoft Corporation. All rights reserved.
C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade>py “How to use updated codebase.py”
Codebase Version 2.8 : Solved - Strike Selection Issue
-----Logged into Dhan-----
This BOT Is Picking New File From Dhan
<urlopen error [Errno 2] No such file or directory>
‘Tradehull’ object has no attribute ‘response’
Traceback (most recent call last):
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 1317, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1004, in _send_output
self.send(msg)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 944, in send
self.connect()
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\http\client.py”, line 1399, in connect
self.sock = self._context.wrap_socket(self.sock,
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\ssl.py”, line 500, in wrap_socket
return self.sslsocket_class._create(
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\ssl.py”, line 1040, in _create
self.do_handshake()
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\ssl.py”, line 1309, in do_handshake
self._sslobj.do_handshake()
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade\Dhan_Tradehull.py”, line 80, in get_login
self.instrument_df = self.get_instrument_file()
File “C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade\Dhan_Tradehull.py”, line 112, in get_instrument_file
instrument_df = pd.read_csv(“https:// images.dhan. co/api-data/api-scrip-master. csv”, low_memory=False)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py”, line 912, in read_csv
return _read(filepath_or_buffer, kwds)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py”, line 577, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py”, line 1407, in init
self._engine = self._make_engine(f, self.engine)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\parsers\readers.py”, line 1661, in _make_engine
self.handles = get_handle(
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\common.py”, line 716, in get_handle
ioargs = _get_filepath_or_buffer(
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\common.py”, line 368, in _get_filepath_or_buffer
with urlopen(req_info) as req:
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\io\common.py”, line 270, in urlopen
return urllib.request.urlopen(*args, **kwargs)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 222, in urlopen
return opener.open(url, data, timeout)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 525, in open
response = self._open(req, data)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 502, in _call_chain
result = func(*args)
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 1360, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File “C:\Users\AppData\Local\Programs\Python\Python38\lib\urllib\request.py”, line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade\Dhan_Tradehull.py”, line 53, in init
self.get_login(ClientCode,token_id)
File “C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade\Dhan_Tradehull.py”, line 85, in get_login
print(self.response)
AttributeError: ‘Tradehull’ object has no attribute ‘response’
available_balance ****
C:\Users\OneDrive\Documents\DHAN\3.1 Codebase Upgrade\3.1 Codebase Upgrade>