Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

News Day Blocker - no new trades on US CPI and FOMC days - expert for MetaTrader 5

Augusto Martin D'anna
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.
Views:
33
Published:
cb_newsday.png (79.58 KB)
\MQL5\Experts\
NyTime.mqh (4.3 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

News Day Blocker stops new trades on US inflation (CPI) release days and Federal Reserve decision (FOMC) days. Days are counted by the New York date and the 2015-2027 calendar is built in, so it behaves 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 still open at a New York time you choose, for example 08:25 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: if(GlobalVariableGet("NEWS_DAY_BLOCK") == 1) return;
  • Shows the New York time, today's status and the next CPI/FOMC date on the chart.

Files

  • NewsDayBlocker.mq5 - the utility (Experts folder)
  • NyTime.mqh - server time to New York time with US and EU daylight saving, in the same folder

Inputs

  • Broker server clock: New York + 7, Central Europe, Eastern Europe, UTC or automatic (live only)
  • Close positions opened on a news day, delete pending orders, close open positions at a New York time (-1 = off)
  • Magic numbers to watch (empty = all, 0 = manual), status on the chart

Notes

  • Sources: bls.gov and federalreserve.gov. The calendar ends in December 2027; a warning is printed 60 days before. Release dates can change.
  • Tested in the Strategy Tester, September to November 2026: a test position opened every day was closed only on the five CPI/FOMC days.
No Hedge Guard - close the newer side when a buy and a sell are open on one symbol No Hedge Guard - close the newer side when a buy and a sell are open on one symbol

Closes the newer side when a buy and a sell are open on the same symbol (manual trades or any EA). For prop firm accounts that forbid hedging. Never opens trades.

Chart Pattern Breakout Indicator Chart Pattern Breakout Indicator

Breakout status and measured targets for 13 chart patterns: channels, wedges and triangles found on zigzag swings, each shaded by what price did after its last swing (forming, broke up, broke down, target hit, failed) and rated with a quality score. Larger patterns stay around the smaller ones inside them, and same-size patterns never pile up.

NyTime - broker server time to New York time with US and EU daylight saving NyTime - broker server time to New York time with US and EU daylight saving

Converts broker server time to UTC and New York time with US and EU daylight saving rules. Works the same live and in the Strategy Tester, where TimeGMT() returns server time.

MACD Signals MACD Signals

Indicator edition for new platform.