Skip to content

Commit 366bdb0

Browse files
authored
previous_day_bar: use Aggsv2 instead of Bar
1 parent 1f5ec1d commit 366bdb0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

alpaca_trade_api/polygon/rest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Exchange, SymbolTypeMap, ConditionMap,
77
Company, Dividends, Splits, Earnings, Financials, NewsList, Ticker
88
)
9-
from ..entity import Bar
109
from alpaca_trade_api.common import get_polygon_credentials
1110

1211

@@ -110,8 +109,8 @@ def last_quote(self, symbol):
110109

111110
def previous_day_bar(self, symbol):
112111
path = '/aggs/ticker/{}/prev'.format(symbol)
113-
raw = self.get(path, version='v2')['results'][0]
114-
return Bar(raw)
112+
raw = self.get(path, version='v2')
113+
return Aggsv2(raw)
115114

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

0 commit comments

Comments
 (0)