Insufficient historical data for

@Tradehull_Imran @Dhan

which code 15 or 5 min time frame i use better, please guide to solution my error

df = self.tsl.get_historical_data(symbol, exchange, str(timeframe_min)) or
df = self.tsl.get_intraday_data(symbol, exchange, str(timeframe_min))

Error is below

PS D:\Dhan Practice> & C:/Users/Lenovo1/AppData/Local/Programs/Python/Python313/python.exe “d:/Dhan Practice/Dhan_KBS_V3.py”
Codebase Version 2.8 : Solved - Strike Selection Issue
-----Logged into Dhan-----
reading existing file all_instrument 2025-11-10.csv
Got the instrument file
2025-11-10T23:37:47.927411 | INFO | Auth check: balance result type=<class ‘float’>
2025-11-10T23:37:47.928530 | INFO | — Pre-filtering watchlist by price (₹25 - ₹5000) —
2025-11-10T23:37:55.024726 | INFO | Price filter reduced watchlist from 187 to 171 stocks.
2025-11-10T23:37:55.025172 | INFO | Waiting 129s until next 5m candle at 23:40:05
2025-11-10T23:40:08.698555 | INFO | Current P&L: ₹-63.36 | Available Balance: ₹4688.86 | Paper Trading Threshold: ₹200
Exception in Getting OHLC data as get_historical_data is intended for ‘day’ timeframe only. Use get_intraday_data for minute intervals.
2025-11-10T23:40:09.166842 | WARN | Insufficient historical data for GODREJCP
Exception in Getting OHLC data as get_historical_data is intended for ‘day’ timeframe only. Use get_intraday_data for minute intervals.
2025-11-10T23:40:09.665338 | WARN | Insufficient historical data for ADANIENSOL

Hey @DKS ,

Thanks for bringing this up @Tradehull_Imran might be able to assist here.

Hi @DKS ,

You have been using the old codebase, Do update to our latest codebase version 3.0.6:

  • Open Command Prompt: Press Win, type cmd, and press Enter.
  • Install Dhan-Tradehull: Run pip install Dhan-Tradehull
  • Confirm the installation by running pip show Dhan-Tradehull

Guide to use the updated codebase:
Refer the below pypi link for more details:

Video reference :

1 Like