Loading…

Time Of Day EA

Many published intraday edges boil down to "this instrument tends to move a certain way once a particular session opens" - a London or New York open effect, a fixing-time effect, or simply a liquidity change at a consistent clock time. This EA is the minimal, honest version of that idea: it does not claim to know which hour is special for your symbol, it gives you one configurable entry time and reads whichever way price has already been moving into it. The signal itself is deliberately simple - the sign of the price change over InpMomentumLookbackBars bars, read at the entry window. The value of an EA like this is the discipline it enforces (one trade, one fixed time, no exceptions) rather than a sophisticated signal, which is also why it is a good starting template for testing your own time-of-day observation by swapping the momentum read for a different rule. An optional InpFlattenHour forces the position closed at a second fixed hour, useful for keeping the trade inside a single session rather than holding it into a different one with different volatility characteristics. Notes and limitations - Signals are evaluated once per closed bar, so the entry actually fires on the first bar whose open time is at or after InpEntryHour: InpEntryMinute. On an H1 chart that rounds InpEntryMinute down to the hour; run on M1 or M5 for an exact-minute entry. - One trade per calendar day at most, and one position at a time, tracked by InpMagicNumber. - The momentum read is a simple sign check, not a filtered signal - it will trade on noise as readily as on a genuine directional move. Test the chosen hour and lookback on your own symbol before relying on it. - Requires AutoTrading enabled and the platform's trade-permission checks true; if trading is disabled the EA logs it and skips the entry. - MQL5, netting accounts only: refuses to open if a foreign-magic position already sits on the chart symbol, to avoid a silent merge.

Expert advisor · MT5 · v1.0 · Free

About Time Of Day EA

Time Of Day EA is an expert advisor (trading robot) for MetaTrader 5. It can size trades from your balance and risk percent. It has 13 settings, such as Entry hour, Entry minute and Momentum lookback bars. MQL source code included.

Files in the download: TimeOfDayEa.ex5, TimeOfDayEa.mq5, TimeOfDayEa.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Entry hour8Server hour to look for the entry signal (0-23)
Entry minute0Server minute to look for the entry signal (0-59)
Momentum lookback bars4Bars back used to read the momentum direction at entry time
Stop loss pips30Stop loss distance, in pips
Take profit pips60Take profit distance, in pips (0 = none)
Flatten hour-1Server hour to force-close any open position (-1 = never)
Use risk sizingfalseSize by percent risk instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260814Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Momentum · Trading Sessions · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria