mirror of
https://github.com/BrentNeale1/fx-quant.git
synced 2026-07-28 10:57:43 +00:00
546d7311ec
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>
21 lines
792 B
SQL
21 lines
792 B
SQL
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);
|