Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion polygon/rest/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ def get_aggs(
raw=raw,
)

# TODO: next breaking change release move "market_type" to be 2nd mandatory
# param
def get_grouped_daily_aggs(
self,
date: str,
adjusted: Optional[bool] = None,
params: Optional[Dict[str, Any]] = None,
raw: bool = False,
market_type: str = "stocks",
) -> Union[GroupedDailyAgg, HTTPResponse]:
"""
Get the daily open, high, low, and close (OHLC) for the entire market.
Expand All @@ -66,7 +69,7 @@ def get_grouped_daily_aggs(
:param raw: Return raw object instead of results object
:return: List of grouped daily aggregates
"""
url = f"/v2/aggs/grouped/locale/us/market/stocks/{date}"
url = f"/v2/aggs/grouped/locale/us/market/{market_type}/{date}"

return self._get(
path=url,
Expand Down