From ff746346fcd7ab34a06ed3756bec2a9cefc262e8 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 31 Jul 2017 12:26:37 -0400 Subject: [PATCH] Only get positions with shares you own in securities_owned --- Robinhood/Robinhood.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Robinhood/Robinhood.py b/Robinhood/Robinhood.py index c3eafb19..056e25a9 100644 --- a/Robinhood/Robinhood.py +++ b/Robinhood/Robinhood.py @@ -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