I am getting Error intraday_minute_data() missing 2 required positional arguments: 'from_date' and 'to_date' . When I am using the code - chart = tsl.get_intraday_data(stock_name, 'NSE', 1)

import pdb
import time
import datetime
import traceback
import talib
from Dhan_Tradehull import Tradehull
import pandas as pd

client_code = “xxxxxxxx”
token_id = “J9.lFD2r6BB5C9CYsNKB7SGGUnKI”
tsl = Tradehull(client_code,token_id) # tradehull_support_library

available_balance = tsl.get_balance()
print(“avaliable balance =”, available_balance)

watchlist = [‘ACC’, ‘CIPLA’, ‘TATACHEM’,‘TATAELXSI’, ‘HONAUT’, ‘CAMS’, ‘TATAPOWER’]

traded_wathclist =

for stock_name in watchlist:

chart = tsl.get_intraday_data(stock_name,'NSE',6)

print(stock_name)

Error when running the code–

D:\Trade\PYTHON DHAN\code and program\6. Session6- 1st Live Algo\narayan 1st live algo\Dhan codebase>py “print balance.py”
-----Logged into Dhan-----
reading existing file all_instrument 2025-01-11.csv
Got the instrument file
avaliable balance = 62.12
intraday_minute_data() missing 2 required positional arguments: ‘from_date’ and ‘to_date’
Traceback (most recent call last):
File “D:\Trade\PYTHON DHAN\code and program\6. Session6- 1st Live Algo\narayan 1st live algo\Dhan codebase\Dhan_Tradehull.py”, line 253, in get_intraday_data
ohlc = self.Dhan.intraday_minute_data(str(security_id),exchangeSegment,instrument_type)
TypeError: intraday_minute_data() missing 2 required positional arguments: ‘from_date’ and ‘to_date’
ACC
intraday_minute_data() missing 2 required positional arguments: ‘from_date’ and ‘to_date’
Traceback (most recent call last):
File “D:\Trade\PYTHON DHAN\code and program\6. Session6- 1st Live Algo\narayan 1st live algo\Dhan codebase\Dhan_Tradehull.py”, line 253, in get_intraday_data
ohlc = self.Dhan.intraday_minute_data(str(security_id),exchangeSegment,instrument_type)
TypeError: intraday_minute_data() missing 2 required positional arguments: ‘from_date’ and ‘to_date’
CIPLA

Hi @narayan2014

we have upgraded the codebase
Implement solution from this link : Learn Algo Trading with Python | Codes | Youtube Series - #631 by Tradehull_Imran

1 Like