API Documents Info on BANKNIFTY

Team,

I have downloaded the script master file in the below website

Orders - DhanHQ Ver 1.0 / API Document” was looking out for Bank nifty index and found 2 entries. not sure which one is right.

thought to use 2nd one with security ID 25 and happened to extract close prices of intraday and found only 58 entries in APL calls.

plz suggest which one is right.

@Dhan_Help @RahulDeshpande Why dont i see current week expiry of BankNifty list in the below website?

How often the list is updated?

1 Like

Hi,

I am able to get daily historical data for BANKNIFTY ( time frame 1D) .How to fetch 1 minute data and convert it into 5 mins data. I am trying to do some backtesting and want to use for algo trading and stuck here . Can someone please help.

from dhanhq import dhanhq
import pandas as pd
dhan = dhanhq("1000***","**apikey**")
                   
#print(dhan.get_fund_limits())

#Get historical data of 7th June , 8th June and 9th June
histdata = dhan.historical_minute_charts(
    symbol='BANKNIFTY',
    exchange_segment='IDX_I',
    instrument_type='INDEX',
    expiry_code=0,
    from_date='2023-06-06',
    to_date='2023-06-11'
)

intdf = pd.DataFrame(histdata['data'])
print(intdf)

temp_list = []
for i in intdf['start_Time']:
    temp = dhan.convert_to_date_time(i)
    temp_list.append(temp)

intdf['Date'] = temp_list
print(intdf)

Thanks.

Hello @alok.nayak

Currently, we only provide 1D (daily) timeframe data as part of historical data API. Hence, you will be able to get only 1 day OHLC data. In case you face any errors in that, would be happy to assist you in the same.