|
4 | 4 | Trade, Trades, TradesV2, |
5 | 5 | Quote, Quotes, QuotesV2, |
6 | 6 | Exchange, SymbolTypeMap, ConditionMap, |
7 | | - Company, Dividends, Splits, Earnings, Financials, NewsList, Ticker |
| 7 | + Company, Dividends, Splits, Earnings, Financials, NewsList, Ticker, |
| 8 | + DailyOpenClose |
8 | 9 | ) |
9 | 10 | from alpaca_trade_api.common import get_polygon_credentials |
10 | 11 | from deprecated import deprecated |
@@ -134,20 +135,18 @@ def historic_agg_v2(self, symbol, multiplier, timespan, _from, to, |
134 | 135 | raw = self.get(path, params, version='v2') |
135 | 136 | return Aggsv2(raw) |
136 | 137 |
|
137 | | - |
138 | | - def daily_open_close(self, symbol, date): |
139 | | - path = '/open-close/{}/{}'.format(symbol, date) |
140 | | - raw = self.get(path) |
141 | | - return raw |
142 | | - |
143 | | - |
144 | 138 | def grouped_daily(self, date, unadjusted=False): |
145 | 139 | path = '/aggs/grouped/locale/US/market/STOCKS/{}'.format(date) |
146 | 140 | params = {} |
147 | 141 | params['unadjusted'] = unadjusted |
148 | 142 | raw = self.get(path, params, version='v2') |
149 | 143 | return Aggsv2Set(raw) |
150 | 144 |
|
| 145 | + def daily_open_close(self, symbol, date): |
| 146 | + path = '/open-close/{}/{}'.format(symbol, date) |
| 147 | + raw = self.get(path) |
| 148 | + return DailyOpenClose(raw) |
| 149 | + |
151 | 150 | def last_trade(self, symbol): |
152 | 151 | path = '/last/stocks/{}'.format(symbol) |
153 | 152 | raw = self.get(path) |
|
0 commit comments