anilshanbhag / RobinhoodShell

A command line shell for trading stocks using Robinhood
MIT License
411 stars 94 forks source link

Cannot get the quotes of any tick #26

Closed itsmesanju closed 4 years ago

itsmesanju commented 5 years ago

My authentication is successful and l is listing the portfolio value but it doesn't show the individual positions. Moreover when I tried to get the quote using q command, it also errors out.

Please help.

**> l ┌Account───────────────┐ │ Portfolio Value │ Change │ Buying Power │ ├────────┼────────┤ │ 2217.66 │ -8.0 (-2.38%) │ 9.6600 │ └────┴──────────────┘** Traceback (most recent call last): File "shell.py", line 613, in RobinhoodShell().cmdloop() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 138, in cmdloop stop = self.onecmd(line) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd return func(arg) File "shell.py", line 136, in do_l market_data = self.trader.get_stock_marketdata(instruments) File "/Users/skumar/Project/OptionChanakya/RobinhoodShell/Robinhood/Robinhood.py", line 465, in get_stock_marketdata return info['results'] KeyError: 'results'

**> q spy Traceback (most recent call last): File "shell.py", line 613, in ** RobinhoodShell().cmdloop() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 138, in cmdloop stop = self.onecmd(line) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd return func(arg) File "shell.py", line 481, in do_q raw_data = self.trader.get_stock_marketdata(instruments) File "/Users/skumar/Project/OptionChanakya/RobinhoodShell/Robinhood/Robinhood.py", line 465, in get_stock_marketdata return info['results'] KeyError: 'results'

markmark1 commented 5 years ago

yes same here pls fix

q goog Traceback (most recent call last): File "./shell.py", line 613, in RobinhoodShell().cmdloop() File "/usr/local/Cellar/python/3.7.4_1/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.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd return func(arg) File "./shell.py", line 481, in do_q raw_data = self.trader.get_stock_marketdata(instruments) File "/Users/sk/RobinhoodShell/Robinhood/Robinhood.py", line 465, in get_stock_marketdata return info['results'] KeyError: 'results' (RobinhoodShell) mark@marks-Air RobinhoodShell (master)*$ ./shell.py Welcome to the Robinhood shell. Type help or ? to list commands.

anilshanbhag commented 5 years ago

I am unable to replicate the issue. Delete auth.data and instruments.data files and try again.

markmark1 commented 5 years ago

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

q goog Traceback (most recent call last): File "./shell.py", line 613, in RobinhoodShell().cmdloop() File "/usr/local/Cellar/python/3.7.4_1/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.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd return func(arg) File "./shell.py", line 481, in do_q raw_data = self.trader.get_stock_marketdata(instruments) File "/Users/mark/RobinhoodShell/Robinhood/Robinhood.py", line 464, in get_stock_marketdata "quotes/?instruments=" + ','.join(instruments)) File "/Users/mark/RobinhoodShell/Robinhood/Robinhood.py", line 726, in get_url return self.session.get(url, timeout=15).json() File "/Users/mark/RobinhoodShell/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, *kwargs) File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) (RobinhoodShell) mark@marks-Air RobinhoodShell (master)$ ./shell.py Welcome to the Robinhood shell. Type help or ? to list commands.

q 'goog' Traceback (most recent call last): File "./shell.py", line 613, in RobinhoodShell().cmdloop() File "/usr/local/Cellar/python/3.7.4_1/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.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd return func(arg) File "./shell.py", line 480, in do_q instruments = [self.get_instrument(s)['url'] for s in symbols] File "./shell.py", line 480, in instruments = [self.get_instrument(s)['url'] for s in symbols] File "./shell.py", line 566, in get_instrument self.add_instrument(instrument['url'], instrument['symbol']) TypeError: string indices must be integers (RobinhoodShell) mark@marks-Air RobinhoodShell (master)*$

On Mon, Sep 23, 2019 at 12:14 PM Anil Shanbhag notifications@github.com wrote:

I am unable to replicate the issue. Delete auth.data and instruments.data files and try again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anilshanbhag/RobinhoodShell/issues/26?email_source=notifications&email_token=ABQ6RG7KXIMDTJ6KFV2VDZDQLEISNA5CNFSM4IKEPKNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7L6QTY#issuecomment-534243407, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQ6RG4YJ27TPO4IHCINB23QLEISNANCNFSM4IKEPKNA .