Add economic calendar module to filter trades near high-impact events

Introduces a full Trading Economics API pipeline that fetches, stores, and
queries economic events (NFP, CPI, rate decisions, etc.) so the backtester
can block trade entries within a configurable buffer window of high-impact
releases — reducing slippage and false signals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Brent Neale
2026-02-17 20:00:28 +10:00
co-authored by Claude Opus 4.6
parent b1f3a919bf
commit 546d7311ec
7 changed files with 654 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
CREATE TABLE economic_calendar (
event_datetime TIMESTAMPTZ NOT NULL,
country TEXT NOT NULL,
event_name TEXT NOT NULL,
currency TEXT,
impact TEXT,
impact_numeric INTEGER,
actual DOUBLE PRECISION,
forecast DOUBLE PRECISION,
previous DOUBLE PRECISION,
revised DOUBLE PRECISION,
reference TEXT,
source TEXT,
last_updated TIMESTAMPTZ DEFAULT now(),
PRIMARY KEY (event_datetime, country, event_name)
);
CREATE INDEX idx_ec_datetime ON economic_calendar (event_datetime DESC);
CREATE INDEX idx_ec_currency ON economic_calendar (currency);
CREATE INDEX idx_ec_impact ON economic_calendar (impact_numeric);