Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'int' object is not subscriptable #17

Open
nhabbott opened this issue May 4, 2020 · 1 comment
Open

TypeError: 'int' object is not subscriptable #17

nhabbott opened this issue May 4, 2020 · 1 comment

Comments

@nhabbott
Copy link

nhabbott commented May 4, 2020

I get this error as soon as the script attempts to buy or sell any stock. Not sure why, as the code I added and the code I modified all look fine to me.

Watching 167 symbols.
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<StreamConn._consume_msg() done, defined at C:\Python38\lib\site-packages\alpaca_trade_api\polygon\streamconn.py:99> exception=TypeError("'int' object is not subscriptable")>
Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\alpaca_trade_api\polygon\streamconn.py", line 103, in _consume_msg
    await self._dispatch(data)
  File "C:\Python38\lib\site-packages\alpaca_trade_api\polygon\streamconn.py", line 240, in _dispatch
    await handler(self, channel, ent)
  File "momentum.py", line 251, in handle_second_bar
    if (daily_pct_change > .04 and data.close > high_15m and volume_today[symbol] > 30000):
TypeError: 'int' object is not subscriptable
@nhabbott
Copy link
Author

nhabbott commented May 4, 2020

Added the issue to the main repo as I believe that is where the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant