I am using the code provided by you. Just converting the time to CYMDHMS format so that it is easy to read.
start_dt = datetime.datetime(t_dt.year, t_dt.month, t_dt.day)
end_dt = datetime.datetime.now()
data = {“symbol”:full_sym, “resolution”:“D”, “date_format”:“0”, “range_from”:int(start_dt.timestamp()), “range_to”:int(end_dt.timestamp()), “cont_flag”:“1”}
response = fyers.history(data=data)
temp_list = pd.DataFrame(response[‘candles’], columns = [‘timestamp’, ‘open’, ‘high’, ‘low’, ‘close’, ‘volume’])
for index1, row1 in temp_list.iterrows():
eod_ts = datetime.datetime.utcfromtimestamp(row1[‘timestamp’]).strftime(‘%Y-%m-%d %H:%M:%S’)
eod_dt = datetime.datetime.utcfromtimestamp(row1[‘timestamp’]).strftime(‘%Y-%m-%d’)
Above of EOD and below is for 5min, only need to change the 3 lines as below. Just check at your end.
data = {“symbol”:full_sym, “resolution”:“5”, “date_format”:“0”, “range_from”:int(start_dt.timestamp()), “range_to”:int(end_dt.timestamp()), “cont_flag”:“1”}
eod_ts = datetime.datetime.fromtimestamp(row1[‘timestamp’]).strftime(‘%Y-%m-%d %H:%M:%S’)
eod_dt = datetime.datetime.fromtimestamp(row1[‘timestamp’]).strftime(‘%Y-%m-%d’)