You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
File "../catalyst/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 549, in run_algorithm
stats_output=stats_output
File "../catalyst/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 269, in _run
last_available_session=end
File ".../catalyst/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 250, in init
super(DataPortalExchangeBacktest, self).init(*args, **kwargs)
File ".../catalyst/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 28, in init
super(DataPortalExchangeBase, self).init(*args, **kwargs)
File ".../catalyst/lib/python3.6/site-packages/catalyst/data/data_portal.py", line 301, in init
if self._first_trading_day is not None else (None, None)
File ".../catalyst/lib/python3.6/site-packages/catalyst/utils/calendars/trading_calendar.py", line 647, in open_and_close_for_session
sched.at[session_label, 'market_open'].tz_localize('UTC'),
File ".../catalyst/lib/python3.6/site-packages/pandas/core/indexing.py", line 1665, in getitem
return self.obj.get_value(*key, takeable=self._takeable)
File ".../catalyst/lib/python3.6/site-packages/pandas/core/frame.py", line 1900, in get_value
return engine.get_value(series.get_values(), index)
File "pandas/index.pyx", line 98, in pandas.index.IndexEngine.get_value (pandas/index.c:3557)
File "pandas/index.pyx", line 106, in pandas.index.IndexEngine.get_value (pandas/index.c:3240)
File "pandas/index.pyx", line 583, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11566)
KeyError: Timestamp('2017-12-01 10:00:00+0000', tz='UTC')
The timeframe setting 2017-12-01 00:00:00 to 2017-12-01 23:59:00 for example is working without any problems.
Would be nice to be able to backtest on that smaller frames to test algos on special market situations.
The text was updated successfully, but these errors were encountered:
@avolution we are closing this as this issue is already discussed on another thread, like @AvishaiW mentioned.
Please feel free to add more information to issue #268 or reopen this if you feel otherwise.
Hey guys,
I found a problem by running backtests with small timeframes
For example:
2017-12-01 10:00:00 to 2017-12-01 15:00:00
Here is the run_algorithm call:
run_algorithm(
exchange_name='bitfinex',
capital_base=10000,
data_frequency='minute',
initialize=initialize,
handle_data=handle_data,
analyze=analyze,
algo_namespace=NAMESPACE,
base_currency='usd',
start = pd.to_datetime('2017-12-01 10:00:00', utc=True),
end = pd.to_datetime('2017-12-01 15:00:00', utc=True),
output=out
)
Catalyst version 0.5.3
This error will occur:
File "../catalyst/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 549, in run_algorithm
stats_output=stats_output
File "../catalyst/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 269, in _run
last_available_session=end
File ".../catalyst/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 250, in init
super(DataPortalExchangeBacktest, self).init(*args, **kwargs)
File ".../catalyst/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 28, in init
super(DataPortalExchangeBase, self).init(*args, **kwargs)
File ".../catalyst/lib/python3.6/site-packages/catalyst/data/data_portal.py", line 301, in init
if self._first_trading_day is not None else (None, None)
File ".../catalyst/lib/python3.6/site-packages/catalyst/utils/calendars/trading_calendar.py", line 647, in open_and_close_for_session
sched.at[session_label, 'market_open'].tz_localize('UTC'),
File ".../catalyst/lib/python3.6/site-packages/pandas/core/indexing.py", line 1665, in getitem
return self.obj.get_value(*key, takeable=self._takeable)
File ".../catalyst/lib/python3.6/site-packages/pandas/core/frame.py", line 1900, in get_value
return engine.get_value(series.get_values(), index)
File "pandas/index.pyx", line 98, in pandas.index.IndexEngine.get_value (pandas/index.c:3557)
File "pandas/index.pyx", line 106, in pandas.index.IndexEngine.get_value (pandas/index.c:3240)
File "pandas/index.pyx", line 583, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11566)
KeyError: Timestamp('2017-12-01 10:00:00+0000', tz='UTC')
The timeframe setting 2017-12-01 00:00:00 to 2017-12-01 23:59:00 for example is working without any problems.
Would be nice to be able to backtest on that smaller frames to test algos on special market situations.
The text was updated successfully, but these errors were encountered: