DataFrame constructor not properly called!
Traceback (most recent call last):
File “D:\anoop khan trading\dhan files\3. Session3 - Codebase\3. Session3 - Codebase\Dhan codebase\learn session 3\Dhan_Tradehull.py”, line 223, in get_historical_data
df = pd.DataFrame(ohlc[‘data’])
File “C:\Users\Anoop\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\frame.py”, line 817, in init
raise ValueError(“DataFrame constructor not properly called!”)
ValueError: DataFrame constructor not properly called!
Hi @ANOOP_KHAN ,
Do use correct timeframe to get the ohlc data.
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
historical_data = tsl.get_historical_data(Underlying='NIFTY', exchange='INDEX', timeframe='1')