Errr excel problm

Microsoft Windows [Version 10.0.22631.4751]
(c) Microsoft Corporation. All rights reserved.

E:\masterclass 1 to 9\6. Session6- 1st Live Algo\6. Session6- 1st Live Algo\1st live Algo>py “Dhan_codebase usage.py”
-----Logged into Dhan-----
reading existing file all_instrument 2025-03-08.csv
Got the instrument file
MOTHERSON
intraday_minute_data() missing 2 required positional arguments: ‘from_date’ and ‘to_date’
Traceback (most recent call last):
File “E:\masterclass 1 to 9\6. Session6- 1st Live Algo\6. Session6- 1st Live Algo\1st live Algo\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’
Traceback (most recent call last):
File “Dhan_codebase usage.py”, line 28, in
chart[‘rsi’] = talib.RSI(chart[‘close’], timeperiod=14) #pandas
TypeError: ‘NoneType’ object is not subscriptable

E:\masterclass 1 to 9\6. Session6- 1st Live Algo\6. Session6- 1st Live Algo\1st live Algo>

eror while running file @Tradehull_Imran

Hi @ren .

tsl.get_intraday_data was a old method to get historical data… it gives data only for today, which makes problem if we want to create indicators on it.

Dhanhq was upgraded and now we can use get_historical_data which gives data for last 5 working days.

Retrieve historical or intraday data:

Get Historical Data

  • tsl.get_historical_data(tradingsymbol: str, exchange: str, timeframe: str, debug: str = “NO”)
    • Arguments:
      • tradingsymbol (str): The trading symbol for the instrument you want to fetch data for (e.g., ‘NIFTY’, ‘ACC’).
      • exchange (str): The exchange where the instrument is traded (e.g., ‘NSE’, ‘INDEX’).
      • timeframe (str): The timeframe for the data. It can be:
        • ‘1’ for 1-minute candles
        • ‘5’ for 5-minute candles
        • ‘15’ for 15-minute candles
        • ‘25’ for 25-minute candles
        • ‘60’ for 60-minute candles
        • ‘DAY’ for daily candles
      • debug (optional, str): Set to “YES” to enable detailed API response logging. Default is “NO”.
    • Sample Code:
data = tsl.get_historical_data(tradingsymbol='NIFTY', exchange='INDEX', timeframe="DAY")