Hi all,
After much work, I successfully installed pylivetrader and am storing my IEX API key and Alpaca keys in conda env variables. The script seems to work fine for a minute, then crashes with the following output:
[2020-02-12 18:26:13.283815] INFO: Algorithm: livetrader start running with backend = alpaca data-frequency = minute
4
[2020-02-12 18:26:15.259182] INFO: algo:
Algorithm initialized variables:
context.MaxCandidates 100
LowVar 6
HighVar 40
[2020-02-12 18:26:15.278733] INFO: pipeline_live.data.iex.pricing_loader: chart_range=1m
[2020-02-12 18:26:27.626680] INFO: pipeline_live.data.iex.pricing_loader: chart_range=3m
Traceback (most recent call last):
File "/opt/anaconda3/envs/pylive36/bin/pylivetrader", line 8, in <module>
sys.exit(main())
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/__main__.py", line 161, in run
algorithm.run(retry=ctx.retry)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/algorithm.py", line 271, in run
return self.executor.run(retry=retry)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/executor/executor.py", line 119, in run
algo.before_trading_start(self.current_data)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/algorithm.py", line 244, in before_trading_start
self._before_trading_start(self, data)
File "YouKenDoIt-2.py", line 174, in before_trading_start
context.output = pipeline_output('my_pipeline')
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/misc/api_context.py", line 62, in wrapped
return getattr(algorithm, f.__name__)(*args, **kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pylivetrader/algorithm.py", line 1077, in pipeline_output
output = eng.run_pipeline(self._pipelines[name])
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/engine.py", line 77, in run_pipeline
initial_workspace,
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/engine.py", line 244, in compute_chunk
to_load, mask_dates, symbols, mask,
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/iex/pricing_loader.py", line 52, in load_adjusted_array
prices = iex.get_stockprices(chart_range)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/iex.py", line 62, in get_stockprices
return get_stockprices_cached(all_symbols)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/util.py", line 68, in wrapper
body = func(*args, **kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/iex.py", line 60, in get_stockprices_cached
return _get_stockprices(all_symbols, chart_range)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/iex.py", line 85, in _get_stockprices
return parallelize(fetch, splitlen=99)(symbols)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/util.py", line 30, in wrapper
task_result = task.result()
File "/opt/anaconda3/envs/pylive36/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/opt/anaconda3/envs/pylive36/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/opt/anaconda3/envs/pylive36/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/pipeline_live/data/sources/iex.py", line 72, in fetch
Stock(symbols).get_chart(range=chart_range),
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/stocks/base.py", line 246, in get_chart
return self.get_historical_prices(**kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/stocks/base.py", line 480, in get_historical_prices
return self._get_endpoint("chart", fmt_p=fmt_p, params=kwargs)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/stocks/base.py", line 103, in _get_endpoint
data = self.fetch(fmt_j=fmt_j, fmt_p=no_pandas)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/base.py", line 209, in fetch
data = self._execute_iex_query(url)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/base.py", line 165, in _execute_iex_query
return self._handle_error(response)
File "/opt/anaconda3/envs/pylive36/lib/python3.6/site-packages/iexfinance/base.py", line 178, in _handle_error
raise IEXQueryError("The query could not be completed. "
iexfinance.utils.exceptions.IEXQueryError: An error occurred while making the query.
At first I thought this might be because I was on the free IEX plan. But I'm still getting this error after upgrading to their lowest individual plan. Does anyone here know what the error could mean? I feel like I'm SO close, but I need a little help. Thank you in advance!!!