You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: polygon/rest/aggs.py
+81-3Lines changed: 81 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
+
fromemail.headerregistryimportGroup
1
2
from .baseimportBaseClient
2
3
fromtypingimportOptional, Any, Dict, List, Union
3
-
from .modelsimportAgg, Sort
4
+
from .modelsimportAgg, GroupedDailyAgg, DailyOpenCloseAgg, PreviousCloseAgg, Sort
4
5
fromurllib3importHTTPResponse
5
6
fromdatetimeimportdatetime
6
7
@@ -22,7 +23,6 @@ def get_aggs(
22
23
) ->Union[List[Agg], HTTPResponse]:
23
24
"""
24
25
Get aggregate bars for a ticker over a given date range in custom time window sizes.
25
-
26
26
:param ticker: The ticker symbol.
27
27
:param multiplier: The size of the timespan multiplier.
28
28
:param timespan: The size of the time window.
@@ -34,7 +34,6 @@ def get_aggs(
34
34
:param params: Any additional query params
35
35
:param raw: Return raw object instead of results object
36
36
:return: List of aggregates
37
-
:rtype: List[Agg]
38
37
"""
39
38
ifisinstance(from_, datetime):
40
39
from_=int(from_.timestamp() *1000)
@@ -50,3 +49,82 @@ def get_aggs(
50
49
deserializer=Agg.from_dict,
51
50
raw=raw,
52
51
)
52
+
53
+
defget_grouped_daily_aggs(
54
+
self,
55
+
date: str,
56
+
adjusted: Optional[bool] =None,
57
+
params: Optional[Dict[str, Any]] =None,
58
+
raw: bool=False,
59
+
) ->Union[List[GroupedDailyAgg], HTTPResponse]:
60
+
"""
61
+
Get the daily open, high, low, and close (OHLC) for the entire market.
62
+
63
+
:param date: The beginning date for the aggregate window.
64
+
:param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits.
65
+
:param params: Any additional query params
66
+
:param raw: Return raw object instead of results object
Get the open, close and afterhours prices of a stock symbol on a certain date.
89
+
90
+
:param ticker: The exchange symbol that this item is traded under.
91
+
:param date: The beginning date for the aggregate window.
92
+
:param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits.
93
+
:param params: Any additional query params
94
+
:param raw: Return raw object instead of results object
Get the previous day's open, high, low, and close (OHLC) for the specified stock ticker.
115
+
116
+
:param ticker: The ticker symbol of the stock/equity.
117
+
:param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits.
118
+
:param params: Any additional query params
119
+
:param raw: Return raw object instead of results object
0 commit comments