RobinhoodShell icon indicating copy to clipboard operation
RobinhoodShell copied to clipboard

list portfolio fails

Open cfredericksen opened this issue 4 years ago • 3 comments

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

cfredericksen avatar Jul 22 '20 21:07 cfredericksen

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)

anilshanbhag avatar Jul 23 '20 03:07 anilshanbhag

┌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.

cfredericksen avatar Jul 23 '20 13:07 cfredericksen

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.

h0lybyte avatar Sep 08 '20 03:09 h0lybyte