TypeError: 'Entity' object is not subscriptable
See original GitHub issueI’ve often come across this error either right after executing an order or when loading non-historical data.
Here’s an example after execution
May 27 10:11:57 /app/.heroku/python/lib/python3.6/site-packages/alpaca_trade_api/stream2.py:151: UserWarning: Discarding nonzero nanoseconds in conversion
May 27 10:11:57 await handler(self, channel, ent)
May 27 10:12:12 sleep 3 seconds and retrying https://paper-api.alpaca.markets/v2/account 3 more time(s)...
May 27 10:12:15 sleep 3 seconds and retrying https://paper-api.alpaca.markets/v2/account 3 more time(s)...
May 27 10:12:19 sleep 3 seconds and retrying https://paper-api.alpaca.markets/v2/account 3 more time(s)...
May 27 10:12:22 sleep 3 seconds and retrying https://paper-api.alpaca.markets/v2/account 3 more time(s)...
May 27 10:12:25 buy_bracket - limitprice=826.360, price=822.569, stopprice=820.885
May 27 10:12:25 Exception in thread Thread-1:
May 27 10:12:25 Traceback (most recent call last):
May 27 10:12:25 File "/app/.heroku/python/lib/python3.6/threading.py", line 916, in _bootstrap_inner
May 27 10:12:25 self.run()
May 27 10:12:25 File "/app/.heroku/python/lib/python3.6/threading.py", line 864, in run
May 27 10:12:25 self._target(*self._args, **self._kwargs)
May 27 10:12:25 File "/app/.heroku/python/lib/python3.6/site-packages/alpaca_backtrader_api/alpacastore.py", line 328, in _t_streaming_listener
May 27 10:12:25 self._transaction(trans)
May 27 10:12:25 File "/app/.heroku/python/lib/python3.6/site-packages/alpaca_backtrader_api/alpacastore.py", line 650, in _transaction
May 27 10:12:25 oid = trans['id']
May 27 10:12:25 TypeError: 'Entity' object is not subscriptable
This happens both using polygon and not using polygon.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
TypeError: 'int' object is not subscriptable (python)
I'm having problems making a matrix multiplication algorithm in python3. This results in the TypeError: 'int' object is not subscriptable ...
Read more >TypeError: 'int' object is not subscriptable [Solved Python ...
The Python error "TypeError: 'int' object is not subscriptable" occurs when you try to treat an integer like a subscriptable object.
Read more >TypeError: object is not subscriptable in Python
The Python "TypeError: object is not subscriptable" occurs when we access a non-subscriptable object at a specific index. To solve the error, ...
Read more >typeerror: 'function' object is not subscriptable
What Causes the TypeError: function object is not subscriptable? There are two main causes of this error: attempting to call a function with...
Read more >TypeError: 'NoneType' object is not subscriptable" for a ...
The error says , a non-subscriptable data type is being subscripted. Subscription means, referring a value inside a data structure either by index...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just tested it and that did the trick, thanks
a fix for this issue is available in the master branch. install it like this:
pip install -U git+https://github.com/alpacahq/alpaca-backtrader-api
let me know id this still happens