Skip to content

Commit f4c59eb

Browse files
authored
Merge pull request #118 from Devination/patch-2
Add previous_day_bar
2 parents 6dee4a4 + 366bdb0 commit f4c59eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

alpaca_trade_api/polygon/rest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ def last_quote(self, symbol):
151151
raw = self.get(path)
152152
# TODO status check
153153
return Quote(raw['last'])
154+
155+
def previous_day_bar(self, symbol):
156+
path = '/aggs/ticker/{}/prev'.format(symbol)
157+
raw = self.get(path, version='v2')
158+
return Aggsv2(raw)
154159

155160
def condition_map(self, ticktype='trades'):
156161
path = '/meta/conditions/{}'.format(ticktype)

0 commit comments

Comments
 (0)