News Day Blocker
- 实用工具
-
Augusto Martin D'anna
你好,欢迎访问我的个人资料。我是 Augusto Danna,拥有7年经验的交易员。我擅长结合市场经验与编程技能来实现交易策略的自动化。如有任何疑问,欢迎随时联系我!
自动交易系统: 开发 MT4 和 MT5 的智能交易系统 (Expert Advisors)。
自定义指标: 开发和修改技术指标。
高级风险管理: 实施移动止损 (Trailing Stop)、保本 (Breakeven) 和动态手数计算。
策略转换: 将 TradingView (Pine Script) 策略转换为 MQL4/MQL5。
策略优化: 策略回测与参数调整。 - 版本: 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.
