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

Functions for monitoring holdings & watchlist #217

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pyrh/robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ def get_tickers_by_tag(self, tag=None):
"""
instrument_list = self.get_url(endpoints.tags(tag))["instruments"]
return [self.get_url(instrument)["symbol"] for instrument in instrument_list]

def security_tick(self,instrument):
"""Returns ticker of given instrument
"""
return self.session.get(instrument).json()['symbol']

def watchlists(self):
"""Returns list of securities' symbols that the user has in watchlist
Returns:
(:object: `dict`): Non-zero positions
"""
return self.session.get(endpoints.watchlists() + 'Default/', timeout=15).json()

###########################################################################
# GET OPTIONS INFO #
Expand Down