Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion polygon/websocket/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ def parse_single(data: Dict[str, Any]):
event_type = data["ev"]
if event_type in [EventType.EquityAgg.value, EventType.EquityAggMin.value]:
return EquityAgg.from_dict(data)
elif event_type in [EventType.CryptoAgg.value, EventType.ForexAgg.value]:
elif event_type in [
EventType.CryptoAgg.value,
EventType.CryptoAggSec.value,
EventType.ForexAgg.value,
EventType.ForexAggSec.value,
]:
return CurrencyAgg.from_dict(data)
elif event_type == EventType.EquityTrade.value:
return EquityTrade.from_dict(data)
Expand Down
4 changes: 3 additions & 1 deletion polygon/websocket/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class EventType(Enum):
EquityAgg = "A"
EquityAggMin = "AM"
CryptoAgg = "XA"
CryptoAggSec = "XAS"
ForexAgg = "CA"
ForexAggSec = "CAS"
EquityTrade = "T"
CryptoTrade = "XT"
EquityQuote = "Q"
Expand All @@ -34,7 +36,7 @@ class EventType(Enum):
CryptoL2 = "XL2"
Value = "V"
"""Launchpad* EventTypes are only available to Launchpad users. These values are the same across all asset classes (
stocks, options, forex, crypto).
stocks, options, forex, crypto).
"""
LaunchpadValue = "LV"
LaunchpadAggMin = "AM"