News Day Blocker
- Утилиты
-
Augusto Martin D'anna
MQL5 & Pine Script developer | Trader since 2019 | Strategy validation
As a trader, I know a bot is only as good as the logic behind it. I bridge
trading concepts and clean code: I don't just follow instructions, I make
sure your EA behaves exactly the way your strategy intends. - Версия: 1.0
News Day Blocker stops new trades on US inflation (CPI) release days and Federal Reserve decision (FOMC) days. The days are counted by the New York date, and the calendar for 2015-2027 is built in, so it works the same live and in the Strategy Tester. It never opens trades.
What it does on a news day
- Closes any position opened that day, manual or from any EA (optional magic number filter).
- Deletes pending orders (optional).
- Closes positions that are still open at a New York time you choose, for example 08:25, five minutes before the 08:30 CPI release (optional).
- Sets the terminal global variable NEWS_DAY_BLOCK to 1 (0 on other days), so your own EAs can read it and skip their entries.
- Shows the New York time, whether today is a news day and the next CPI/FOMC date on the chart.
Inputs
- Broker server clock: New York + 7 (most brokers), Central Europe, Eastern Europe, UTC, or automatic (live only). The New York date depends on it.
- Close positions opened on a news day: on/off
- Delete pending orders on a news day: on/off
- Close open positions at (minutes after 00:00 New York, -1 = off)
- Magic numbers to watch, comma separated (empty = all, 0 = manual trades)
- Status on the chart on/off
Notes
- Sources: bls.gov (CPI schedule) and federalreserve.gov (FOMC calendar). The calendar ends in December 2027 and the utility prints a warning 60 days before the end. Release dates can change; check the official calendars.
- Tested in the Strategy Tester from September to November 2026: a test position opened every day was closed only on the five CPI/FOMC days of that period.
- It blocks whole days. If you only want to avoid the release minute, use the "close open positions at" time and keep your own EA's entries away from it.
