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
| Setting | Default | What it does |
|---|---|---|
| Entry hour | 8 | Server hour to look for the entry signal (0-23) |
| Entry minute | 0 | Server minute to look for the entry signal (0-59) |
| Momentum lookback bars | 4 | Bars back used to read the momentum direction at entry time |
| Stop loss pips | 30 | Stop loss distance, in pips |
| Take profit pips | 60 | Take profit distance, in pips (0 = none) |
| Flatten hour | -1 | Server hour to force-close any open position (-1 = never) |
| Use risk sizing | false | Size by percent risk instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Magic number | 20260814 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Momentum · Trading Sessions · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code