AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.4k stars 2.29k forks source link

ValueError timezone #1006

Open johanbech opened 1 year ago

johanbech commented 1 year ago

Hi guys!

Need Help here: I try run Alpaca paper Trading. Code here: data = DP.clean_data(data) data = DP.add_technical_indicator(data, INDICATORS) data = DP.add_vix(data)

I Got error says: Something about UTC Im leaving in Denmark is something i must changes?

ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 data = DP.clean_data(data) 2 data = DP.add_technical_indicator(data, INDICATORS) 3 data = DP.add_vix(data)

6 frames /usr/local/lib/python3.10/dist-packages/exchange_calendars/calendar_helpers.py in parse_date(date, param_name, calendar, raise_oob) 376 377 if ts.tz is not None: --> 378 raise ValueError( 379 f"Parameter {param_name} received with timezone defined as '{ts.tz.zone}'" 380 f" although a Date must be timezone naive."

ValueError: Parameter start received with timezone defined as 'UTC' although a Date must be timezone naive.

YangletLiu commented 1 year ago

Hi guys!

Need Help here: I try run Alpaca paper Trading. Code here: data = DP.clean_data(data) data = DP.add_technical_indicator(data, INDICATORS) data = DP.add_vix(data)

I Got error says: Something about UTC Im leaving in Denmark is something i must changes?

ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 data = DP.clean_data(data) 2 data = DP.add_technical_indicator(data, INDICATORS) 3 data = DP.add_vix(data)

6 frames /usr/local/lib/python3.10/dist-packages/exchange_calendars/calendar_helpers.py in parse_date(date, param_name, calendar, raise_oob) 376 377 if ts.tz is not None: --> 378 raise ValueError( 379 f"Parameter {param_name} received with timezone defined as '{ts.tz.zone}'" 380 f" although a Date must be timezone naive."

ValueError: Parameter start received with timezone defined as 'UTC' although a Date must be timezone naive.

Previously, we have fixed the time-zone issue. Is it still there?

johanbech commented 1 year ago

data = DP.download_data(start_date = '2021-10-04', end_date = '2021-10-08', ticker_list = ticker_list, time_interval= '15Min')

GET ERROR WITH: I run it in colab


AttributeError Traceback (most recent call last) 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= '15Min')

1 frames /usr/local/lib/python3.10/site-packages/finrl/meta/data_processors/processor_alpaca.py in download_data(self, ticker_list, start_date, end_date, time_interval) 55 # filter opening time of the New York Stock Exchange (NYSE) (from 9:30 am to 4:00 pm) if time_interval < 1D 56 day_delta = 86400000000000 # pd.Timedelta('1D').delta == 86400000000000 ---> 57 if pd.Timedelta(time_interval).delta < day_delta: 58 NYSE_open_hour = "09:30" # in NY 59 NYSE_close_hour = "15:59" # in NY

AttributeError: 'Timedelta' object has no attribute 'delta'