Calendar Events
Major economic events (FOMC decisions, CPI releases) cause sharp moves in prediction markets. Horizon’s calendar module provides a live event feed, bundled FOMC/CPI dates through 2026, and pipeline functions for time-decay sizing and pre-event risk reduction. The feed maps event data to standard FeedSnapshot fields for seamless pipeline integration.Overview
Event Feed
CalendarFeed tracks the nearest event with seconds-to-event countdown.Time Decay
hz.time_decay() reduces position size as events approach.Event Countdown
hz.event_countdown() exposes event data for downstream use.Pre-Event Strategy
hz.pre_event_strategy() automatically reduces exposure before events.Feed
CalendarFeed
Parses bundled or custom event data and tracks the nearest future event.| Parameter | Type | Default | Description |
|---|---|---|---|
events_json | str | bundled dates | JSON array of event objects |
api_url | str | "" | Optional REST API for event data |
interval | float | 300.0 | Poll interval in seconds |
price= urgency score (0.0 to 1.0, higher as event approaches)bid= seconds to next eventask= event type code (FOMC=1.0, CPI=2.0, NFP=3.0, GDP=4.0, EARNINGS=5.0)volume_24h= days to next eventsource="calendar:EVENT_NAME"
Pipeline Functions
hz.time_decay
Reduce position size as events approach.| Parameter | Type | Default | Description |
|---|---|---|---|
calendar_feed | str | "calendar" | Feed name for calendar data |
max_days | float | 30.0 | Days at which decay factor reaches 1.0 |
decay_type | str | "linear" | Decay curve: linear, exponential, or sqrt |
hz.event_countdown
Expose raw event countdown data for downstream pipeline use.| Parameter | Type | Default | Description |
|---|---|---|---|
calendar_feed | str | "calendar" | Feed name |
hz.pre_event_strategy
Automatically reduce exposure as events approach, with a linear ramp.| Parameter | Type | Default | Description |
|---|---|---|---|
calendar_feed | str | "calendar" | Feed name |
reduce_hours | float | 24.0 | Hours before event to start reducing |
reduce_factor | float | 0.5 | Minimum size multiplier at event time |
Examples
Event-Aware Trading
Custom Event Data
Event Type Codes
| Code | Event Type |
|---|---|
| 1.0 | FOMC |
| 2.0 | CPI |
| 3.0 | NFP (Non-Farm Payrolls) |
| 4.0 | GDP |
| 5.0 | Earnings |
| 6.0 | PPI |
| 7.0 | PCE |
| 99.0 | Other |