How to use NSE mins date and resample to 5 mins

when i chjange below to 5mins, it is throwing error

 

A function to define the strategy logic and place orders
'''
def strategy(context, data):
 
try:
# Get the data for past 20 days
security_data = data.history(assets=context.security_list,
fields='price',
bar_count=20,
frequency='1d')
except HistoryWindowStartsBeforeData:
return

Using data.history method you can only fetch the data at 1 minute and 1 day frequency. To convert to different frequency such as 5 minutes you need to use resample method. Thanks