Skip to content

Commit

Permalink
Merge pull request #39 from josh-ua/master
Browse files Browse the repository at this point in the history
Only get positions with shares you own in securities_owned
  • Loading branch information
Jamonek authored Jul 31, 2017
2 parents e2106a1 + ff74634 commit f212ccb
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Robinhood/Robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,7 @@ def securities_owned(self):
Returns a list of symbols of securities of which there are more
than zero shares in user's portfolio.
"""
positions = self.positions()
securities = []
for position in positions['results']:
quantity = float(position['quantity'])
if quantity > 0:
securities.append(self.session.get(position['instrument']).json()['symbol'])
return securities
return self.session.get(self.endpoints['positions']+'?nonzero=true').json()

##############################
#PLACE ORDER
Expand Down

0 comments on commit f212ccb

Please sign in to comment.