I am using the below code to download stock data from yahoo finance and wanted to ask how I can modify it so that it for instance only downloads data from 1pm to 3pm?
I have tried a few things but it did not work out so far. Would appreciate any tips!
TickerSymbol = '^GDAXI'
data = yf.download(tickers=TickerSymbol, period='1d', interval='1m')
data.reset_index(inplace=True)
DataDateStrt = data.loc[0, 'Datetime'].strftime('%d.%m.%y')
DataDateStop = data.loc[len(data['Datetime'])-1, 'Datetime'].strftime('%d.%m.%y')
DataTimeSpan = data.loc[len(data['Datetime'])-1, 'Datetime'] - data.loc[0, 'Datetime']