This error appears while training: ( ValueError: Parameter start
received with timezone defined as 'UTC' although a Date must be timezone naive.)
#296
Labels
bug
Something isn't working
Alpaca successfully connected
/usr/local/lib/python3.10/dist-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:
ValueError Traceback (most recent call last)
in <cell line: 1>()
----> 1 train(start_date = '2022-08-30',
2 end_date = '2022-09-08',
3 ticker_list = ticker_list,
4 data_source = 'alpaca',
5 time_interval= '1Min',
7 frames
in train(start_date, end_date, ticker_list, data_source, time_interval, technical_indicator_list, drl_lib, env, model_name, if_vix, **kwargs)
29 dp = DataProcessor(data_source, **kwargs)
30 data = dp.download_data(ticker_list, start_date, end_date, time_interval)
---> 31 data = dp.clean_data(data)
32 data = dp.add_technical_indicator(data, technical_indicator_list)
33 if if_vix:
/usr/local/lib/python3.10/dist-packages/finrl/meta/data_processor.py in clean_data(self, df)
44
45 def clean_data(self, df) -> pd.DataFrame:
---> 46 df = self.processor.clean_data(df)
47
48 return df
/usr/local/lib/python3.10/dist-packages/finrl/meta/data_processors/processor_alpaca.py in clean_data(self, df)
73 df = df[df.timestamp != time]
74
---> 75 trading_days = self.get_trading_days(start=self.start, end=self.end)
76 # produce full timestamp index
77 times = []
/usr/local/lib/python3.10/dist-packages/finrl/meta/data_processors/processor_alpaca.py in get_trading_days(self, start, end)
296 def get_trading_days(self, start, end):
297 nyse = tc.get_calendar("NYSE")
--> 298 df = nyse.sessions_in_range(
299 pd.Timestamp(start, tz=pytz.UTC), pd.Timestamp(end, tz=pytz.UTC)
300 )
/usr/local/lib/python3.10/dist-packages/exchange_calendars/exchange_calendar.py in sessions_in_range(self, start, end, _parse)
2197 Sessions from
start
throughend
.2198 """
-> 2199 slc = self._get_sessions_slice(start, end, _parse)
2200 return self.sessions[slc]
2201
/usr/local/lib/python3.10/dist-packages/exchange_calendars/exchange_calendar.py in _get_sessions_slice(self, start, end, _parse)
2174 def _get_sessions_slice(self, start: Date, end: Date, _parse=True) -> slice:
2175 """Slice representing a range of sessions."""
-> 2176 start, end = self._parse_start_end_dates(start, end, _parse)
2177 slice_start = self.sessions_nanos.searchsorted(start.value, side="left")
2178 slice_end = self.sessions_nanos.searchsorted(end.value, side="right")
/usr/local/lib/python3.10/dist-packages/exchange_calendars/exchange_calendar.py in _parse_start_end_dates(self, start, end, _parse)
2170 if not _parse:
2171 return start, end
-> 2172 return parse_date(start, "start", self), parse_date(end, "end", self)
2173
2174 def _get_sessions_slice(self, start: Date, end: Date, _parse=True) -> slice:
/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.The text was updated successfully, but these errors were encountered: