File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ def news(self, symbol):
150150 return NewsList (self .get (path ))
151151
152152 def gainers_losers (self , direction = "gainers" ):
153- path = '/snapshot/locale/us/markets/stocks/{}' .format (direction )
153+ path = '/snapshot/locale/us/markets/stocks/{}' .format (direction )
154154 return [
155155 Ticker (ticker ) for ticker in
156156 self .get (path , version = 'v2' )['tickers' ]
Original file line number Diff line number Diff line change @@ -234,6 +234,14 @@ def get_position(self, symbol):
234234 resp = self .get ('/positions/{}' .format (symbol ))
235235 return Position (resp )
236236
237+ def close_position (self , symbol ):
238+ '''Liquidates the position for the given symbol at market price'''
239+ self .delete ('/positions/{}' .format (symbol ))
240+
241+ def close_all_positions (self , symbol ):
242+ '''Liquidates all open positions at market price'''
243+ self .delete ('/positions' )
244+
237245 def list_assets (self , status = None , asset_class = None ):
238246 '''Get a list of assets'''
239247 params = {
You can’t perform that action at this time.
0 commit comments