FinRL
FinRL copied to clipboard
only download the first ticker's data
`
Download and save the data in a pandas DataFrame
start_date = pd.Timestamp(start_date)
end_date = pd.Timestamp(end_date)
delta = timedelta(days=1)
data_df = pd.DataFrame()
for tic in ticker_list:
while (
start_date <= end_date
): # downloading daily to workaround yfinance only allowing max 7 calendar (not trading) days of 1 min data per single download
temp_df = yf.download(
tic,
start=start_date,
end=start_date + delta,
interval=self.time_interval,
)
temp_df["tic"] = tic
data_df = pd.concat([data_df, temp_df])
start_date += delta`
when data of first tic
of ticker_list
was downloaded, then start_date
> end_date
,so the rest of ticker_list
could never be downloaded.
Correct me if i am wrong.
use str like '2023-01-01' instead of pd.Timestamp