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

list portfolio fails #36

Open
cfredericksen opened this issue Jul 22, 2020 · 3 comments
Open

list portfolio fails #36

cfredericksen opened this issue Jul 22, 2020 · 3 comments

Comments

@cfredericksen
Copy link

cfredericksen commented Jul 22, 2020

Welcome to the Robinhood shell. Type help or ? to list commands.

l
┌Account──────────┬─────────────────┬──────────────┐
│ Portfolio Value │ Change │ Buying Power │
├─────────────────┼─────────────────┼──────────────┤
redactedredactedredacted
└─────────────────┴─────────────────┴──────────────┘
Traceback (most recent call last):
File "./shell.py", line 627, in
RobinhoodShell().cmdloop()
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "./shell.py", line 150, in do_l
price = market_data[i]['last_trade_price']
TypeError: 'NoneType' object is not subscriptable

Cannot list my portfolio.

version: Python 3.7.7

@anilshanbhag
Copy link
Owner

That is strange, do you know which stock symbol it is failing on ?
To find out could you go to line 150 and just add

print(symbol)

@cfredericksen
Copy link
Author

┌Account──────────┬───────────────┬──────────────┐
│ Portfolio Value │ Change │ Buying Power │
├─────────────────┼───────────────┼──────────────┤
│ redacted │ 60.64 (0.11%) │ redacted │
└─────────────────┴───────────────┴──────────────┘
VZ
UNISQ
Traceback (most recent call last):
File "./shell.py", line 628, in
RobinhoodShell().cmdloop()
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "./shell.py", line 151, in do_l
price = market_data[i]['last_trade_price']
TypeError: 'NoneType' object is not subscriptable

UNISQ doesnt have any chart data as it was pulled from trading.

@h0lybyte
Copy link

h0lybyte commented Sep 8, 2020

I ran into the same issue!

The reason for the error is because the stock "UNISQ" went bankrupt. So we would need to add a special rule to exclude stock tickers that went bankrupt or about to be de-listed.

Ideally a blockticker.txt ? and have it cross reference any stock that causes issues.
This can also happen during stock splits too or ticker renaming.

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

3 participants