Skip to content

Commit

Permalink
Added Snapshot Gainers and Losers
Browse files Browse the repository at this point in the history
  • Loading branch information
alexonab committed Jul 16, 2019
1 parent 1909f0e commit d338377
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions alpaca_trade_api/polygon/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def news(self, symbol):
path = '/meta/symbols/{}/news'.format(symbol)
return NewsList(self.get(path))

def gainers_losers(self, direction="gainers"):
path = '/snapshot/locale/us/markets/stocks/{}'.format(direction)
return [
Ticker(ticker) for ticker in
self.get(path, version='v2')['tickers']
]

def all_tickers(self):
path = '/snapshot/locale/us/markets/stocks/tickers'
return [
Expand Down

0 comments on commit d338377

Please sign in to comment.