Economic Calendar Edge Fields
An economic_calendar alias tracks official US macro announcement times. It has no prices; it tells your rules how far you are from the next and previous announcement.
This page covers the event selector, the four calendar fields and how their countdown behaves between refreshes, and a recipe that pauses a strategy around each announcement. Custom strategies on Kalshi and Polymarket US read a field as edge.<alias>.<field> once it is listed in the alias's fields. For the alias keys and refresh minimums, see Declaring and Reading Edge Data.
Calendar events
event value | Tracks |
|---|---|
FOMC | Federal Reserve FOMC meetings, from the Fed's calendar page. Each announcement is taken as 14:00 New York time on the meeting's last day. |
CPI | Consumer Price Index releases, from the Bureau of Labor Statistics release schedule, at the scheduled time (normally 08:30 New York time). |
FOMC,CPI | Both, merged: next and previous are taken across both lists. Order does not matter, and a repeated token such as CPI,CPI counts once. |
Write the tokens in capitals with no spaces, directly on the alias. Other events (such as NFP), lowercase and spaces fail with does not match required format. Nesting the event under selector: fails with requires event directly on the edge alias.
The alias fails, and ticks are skipped, if a selected calendar cannot be fetched or lists no announcements, or if the selected announcements together have none before or none after the current time (see When an alias goes missing). With FOMC,CPI, if one calendar has not yet published its next date, seconds_to_next counts to the other calendar's next announcement instead, with no error. Unscheduled meetings, or changes not yet on the official pages, are unknown to the Bot.
Calendar fields
| Field | Unit | Meaning | Backtest |
|---|---|---|---|
seconds_to_next | seconds | Time until the next selected announcement. Never negative. | Yes, exact |
seconds_since_previous | seconds | Time since the most recent selected announcement. Never negative. | Yes, exact |
next_event_type | text | FOMC or CPI. Compare with == or !=; see Text fields. | Yes, exact |
previous_event_type | text | FOMC or CPI. Compare with == or !=. | Yes, exact |
Both seconds are measured when the alias is fetched and do not count down between refreshes. With the default 15m refresh, seconds_to_next can overstate the real time left by up to 900 seconds, plus up to one loop.interval, because a new fetch happens only when your loop runs. While fetches are failing, the last snapshot is reused for up to 3 × refresh (2,700 seconds at 15m); see The refresh cache.
Neither value is ever negative, so a condition such as seconds_to_next < 0 never matches. To act just after a release, use seconds_since_previous.
Blackout recipe
A blackout pauses a strategy around each announcement. Put a cancel_all rule at the top of your rules with an any block:
edge:
macro:
provider: economic_calendar
event: FOMC,CPI
fields: [seconds_to_next, seconds_since_previous]
refresh: 5m # the minimum; a slower refresh makes the blackout start later
rules:
- name: announcement_blackout
when:
any:
- {field: edge.macro.seconds_to_next, op: "<=", value: 2100} # 30 min + one 5-minute refresh
- {field: edge.macro.seconds_since_previous, op: "<=", value: 1800} # 30 min after
action: cancel_allBecause the first matching rule wins, every rule below the blackout, exits included, is skipped while it is active. cancel_all pulls resting orders but does not close positions. If exits must keep working during the window, put your exit rules above the blackout rule; the blackout then fires only on ticks where no exit matches.
Because the countdown is frozen between fetches, add margin to the "before" threshold:
- One refresh covers normal operation: 1,800 + 300 = 2,100 seconds for a 30-minute window at
refresh: 5m. - Three refreshes also cover calendar fetch outages: 1,800 + 900 = 2,700 seconds.
When a CPI blackout actually starts
cancel_all when seconds_to_next is at or below the threshold, or seconds_since_previous ≤ 1800. The countdown is measured at each fetch and frozen until the next one, so the start depends on the refresh. Each new fetch lands one refresh plus up to one loop interval after the last. FOMC works the same way around 14:00 ET. Backtests compute the exact value every tick and never show these delays.The "after" side needs no margin: the pre-release snapshot keeps the "before" condition true until the first fetch after the release. A calendar outage long enough to drop the alias blocks every entry. On Kalshi that also cancels resting entry orders, which acts like a blackout for quotes. On Polymarket US resting orders stay in place.
The 30-minute window is illustrative, not a recommendation. For a complete strategy built around a blackout, see Pausing quotes around FOMC and CPI.