RobinhoodShell
RobinhoodShell copied to clipboard
list portfolio fails
Welcome to the Robinhood shell. Type help or ? to list commands.
l ┌Account──────────┬─────────────────┬──────────────┐ │ Portfolio Value │ Change │ Buying Power │ ├─────────────────┼─────────────────┼──────────────┤ │ redacted │ redacted │ redacted │ └─────────────────┴─────────────────┴──────────────┘ 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
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)
┌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
UNISQ doesnt have any chart data as it was pulled from trading.
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.