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
IS_BACKTEST = False
IS_LIVE = True
symbol = "AAPL"
$ python live_v3.py
2021-06-28 03:04:49,918 started trading stream
Traceback (most recent call last):
File "/Users/jonathanrhone1/Src/quant/live_v3.py", line 127, in <module>
cerebro.run()
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/backtrader/cerebro.py", line 1127, in run
runstrat = self.runstrategies(iterstrat)
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/backtrader/cerebro.py", line 1187, in runstrategies
self._broker.start()
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/alpaca_backtrader_api/alpacabroker.py", line 103, in start
self.positions = self.update_positions()
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/alpaca_backtrader_api/alpacabroker.py", line 83, in update_positions
broker_positions_symbols = [p.symbol for p in broker_positions]
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/alpaca_backtrader_api/alpacabroker.py", line 83, in <listcomp>
broker_positions_symbols = [p.symbol for p in broker_positions]
File "/Users/jonathanrhone1/miniconda3/envs/quant39/lib/python3.9/site-packages/alpaca_trade_api/entity.py", line 29, in __getattr__
return super().__getattribute__(key)
AttributeError: 'Position' object has no attribute 'symbol'
Make sure you are properly authenticated @jrhone. After some investigation, it seems that I was getting a 404 and the backtrader was trying to wrap the 404 response in a Position object. Obviously, this was user error but perhaps there could be better error reporting around this @camelpac.
The multiple indicators example throws an error with the following config and real API keys
I also had to comment the
Starting Portfolio Value
line.The text was updated successfully, but these errors were encountered: