Error live testing the example mean reversion algorithm


I have set up catalyst on my windows 10 machine and been doing well back testing.
I am fairly new to python and have been getting an error when I run in live and paper trading.
I get the error when I run the example script, mean reversion simple.
Any assistance will be appreciated!

To run it I have changed the currency to eth_btc = symbol(‘eth_btc’)
context.base_price = None
context.current_day = None

context.RSI_OVERSOLD = 60
context.RSI_OVERBOUGHT = 70
context.CANDLE_SIZE = '15T'

context.start_time = time.time()

context.set_commission(maker=0.001, taker=0.002)

I have the following edits in the ‘if live’ section
if live:
# auth_aliases=dict(poloniex=‘auth2’)

I am running this in spyder with the following error trace.

runfile(‘C:/Users/IanHP/AnacondaProjects/IanDevTest/’, wdir=‘C:/Users/IanHP/AnacondaProjects/IanDevTest’)
[2018-05-28 14:38:10.412587] WARNING: run_algo: Catalyst is currently in ALPHA. It is going through rapid development and it is subject to errors. Please use carefully. We encourage you to report any issue on GitHub:
[2018-05-28 14:38:10.413603] INFO: run_algo: Catalyst version 0.5.12
[2018-05-28 14:38:13.414858] INFO: run_algo: running algo in live-trading mode
Traceback (most recent call last):

File “”, line 1, in
runfile(‘C:/Users/IanHP/AnacondaProjects/IanDevTest/’, wdir=‘C:/Users/IanHP/AnacondaProjects/IanDevTest’)

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\spyder\utils\site\”, line 705, in runfile
execfile(filename, namespace)

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\spyder\utils\site\”, line 102, in execfile
exec(compile(, filename, ‘exec’), namespace)

File “C:/Users/IanHP/AnacondaProjects/IanDevTest/”, line 261, in

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\utils\”, line 601, in run_algorithm

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\utils\”, line 258, in _run

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\utils\”, line 70, in create_simulation_parameters

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\finance\”, line 191, in init
self._end_session, direction=“previous”

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\utils\calendars\”, line 742, in minute_to_session_label
Given a minute, get the label of its containing session.

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\catalyst\utils\calendars\”, line 771, in minute_to_session_label
current_or_next_session = self.schedule.index[idx]

File “C:\Users\IanHP\Anaconda3\envs\catalyst\Lib\site-packages\pandas\tseries\”, line 251, in getitem
val = getitem(key)

IndexError: index 1549 is out of bounds for axis 0 with size 1549


I’m not sure if this is the cause of your problem, but you have simulate orders set to false (which would mean live trading instead of paper trading), but have no API key set. If you removed the # from auth_aliases, it would also fail live trading because you would be trying to use a Poloniex API key to trade on Bitfinex.


Hi SOG35,
Thanks for the suggestion. I restarted the kernel in spyder and tried again and it worked! I think there must have been some weird issue going on in spyder.
Appreciate the support - happy trading!


On further investigation I think the problem was with the live and paper trading datasets stored in the hidden folder .catalyst. I had been changing the recorded data without deleting the trading data or changing the namespace. I think the code was looking to log data which wasn’t there or conflicted. New namespace or deleting the data fixed the issue.
Hi dev team,
Suggest some more info on how data is collected and reported during live and paper trading would be appreciated.
Thanks for a fun project!