Skip to content

Commit 7918a13

Browse files
authored
Merge pull request #95 from alexonab/Snapshot-Gainers-Losers
Added Snapshot Gainers and Losers
2 parents 1909f0e + d338377 commit 7918a13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

alpaca_trade_api/polygon/rest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ def news(self, symbol):
149149
path = '/meta/symbols/{}/news'.format(symbol)
150150
return NewsList(self.get(path))
151151

152+
def gainers_losers(self, direction="gainers"):
153+
path = '/snapshot/locale/us/markets/stocks/{}'.format(direction)
154+
return [
155+
Ticker(ticker) for ticker in
156+
self.get(path, version='v2')['tickers']
157+
]
158+
152159
def all_tickers(self):
153160
path = '/snapshot/locale/us/markets/stocks/tickers'
154161
return [

0 commit comments

Comments
 (0)