FinRL icon indicating copy to clipboard operation
FinRL copied to clipboard

only download the first ticker's data

Open JesseLT opened this issue 1 year ago • 1 comments

`

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.

JesseLT avatar Apr 08 '23 09:04 JesseLT

use str like '2023-01-01' instead of pd.Timestamp

zhumingpassional avatar May 02 '23 01:05 zhumingpassional