
NyTime.mqh converts broker server time to UTC and to New York time, with the US and European daylight saving rules. Session filters like "trade 09:30-11:00 New York" usually rely on TimeGMT(), but in the Strategy Tester TimeGMT() returns the server time, so the filter is shifted in backtests. Here you declare the server clock once and every conversion is computed from the calendar, live and in the tester.
#include <NyTime.mqh> if(NyMinuteNow(CLOCK_NY7) >= 9 * 60 + 30) // after 09:30 New York ...
NyTimeDemo.mq5 prints the New York time of the current server time and runs self-checks, including the March week when US summer time has started and European summer time has not (the case that breaks fixed-offset filters). All checks pass live and in the Strategy Tester.
News Day Blocker - no new trades on US CPI and FOMC days
Blocks new trades on US CPI and FOMC days (New York date). Built-in calendar 2015-2027, works in the Strategy Tester. Never opens trades.
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.
Daily Loss Meter for Prop Firm Rules
Shows on the chart how much of today's prop-firm daily loss limit is used. Counts closed P/L (with commission and swap) and floating P/L since the daily reset, and shows the loss so far, the money left and the equity floor. The base can be balance, equity, or the higher of the two at the reset. Colour warnings at 50% and 80%, with alerts. Display only: never trades.
Session Range Boxes with Asia Breakout Alert
Draws Asia, London and New York session boxes with high/low range and an optional Asia breakout alert.