FinRL
FinRL copied to clipboard
Error encountered when running practical tutorial
Hi,
I was trying to run the following tutorial notebook, but the following error was encountered:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[<ipython-input-20-092cc71585f7>](https://localhost:8080/#) in <cell line: 1>()
----> 1 data = DP.download_data(start_date = '2021-10-04',
2 end_date = '2021-10-08',
3 ticker_list = ticker_list,
4 time_interval= '5Min')
1 frames
[/usr/local/lib/python3.9/site-packages/finrl/meta/data_processor.py](https://localhost:8080/#) in download_data(self, ticker_list, start_date, end_date, time_interval)
35 self, ticker_list, start_date, end_date, time_interval
36 ) -> pd.DataFrame:
---> 37 df = self.processor.download_data(
38 ticker_list=ticker_list,
39 start_date=start_date,
[/usr/local/lib/python3.9/site-packages/finrl/meta/data_processors/processor_alpaca.py](https://localhost:8080/#) in download_data(self, ticker_list, start_date, end_date, time_interval)
50 # filter opening time of the New York Stock Exchange (NYSE) (from 9:30 am to 4:00 pm) if time_interval < 1D
51 day_delta = 86400000000000 # pd.Timedelta('1D').delta == 86400000000000
---> 52 if pd.Timedelta(time_interval).delta < day_delta:
53 NYSE_open_hour = "14:30" # in UTC
54 NYSE_close_hour = "20:59" # in UTC
AttributeError: 'Timedelta' object has no attribute 'delta'
Is there something wrong with the data query?
Same issue running on colab. Running on local jupyter notebook just gives warning:
data = DP.download_data(start_date = '2021-10-04', end_date = '2021-10-08', ticker_list = ticker_list, time_interval= '1Min')
/home/fin/anaconda3/lib/python3.10/site-packages/finrl/meta/data_processors/processor_alpaca.py:52: FutureWarning: Timedelta.delta is deprecated and will be removed in a future version. if pd.Timedelta(time_interval).delta < day_delta:
Same issue
got the same problem on Colab
Just change pd.Timedelta(time_interval).delta
to pd.Timedelta(time_interval).value
Solution above didn’t work for me can you elaborate more