Opening Range Fade System
Fading an opening-range break is a well-known trap on genuinely trending days, where the "false break" is actually the start of the day's real move. This EA reads ADX once, at the moment the opening range window begins, and classifies the whole session as rotational only when that reading is below InpAdxRotationalCeiling. On a session that classifies as trending, the EA does not trade at all that session - it does not flip to breakout-following, because that is a different system with a different risk profile, not a same-system opposite signal. On a rotational session, a close that clears the opening range's high or low by at least InpBreakBufferPips is faded, stopped just beyond the break with an ATR buffer, and targeted at the range's own midpoint - the level the classification itself justifies expecting a reversion toward. Any open trade is force-closed at InpSessionEndHour regardless of price, so a fade that has not resolved by the end of the session it was based on is not carried into the next one. Notes and limitations - The rotational/trending classification is read ONCE per session, at the moment the opening range window starts; it does not adapt if the market's character changes intraday. - At most one trade is taken per session, on the first qualifying break; a break of the opposite edge later the same session is not also traded. - The opening range is built by scanning the chart's own recent bar history for the session window each new bar until it succeeds once; if the terminal has too little history loaded for that window, the range never forms and the session is skipped. - ADX below the ceiling is a mechanical proxy for "rotational", not a guarantee - a low-ADX session can still trend intraday after the classification was already made.
Expert advisor · MT4 · v1.0 · Free
About Opening Range Fade System
Opening Range Fade System is an expert advisor (trading robot) for MetaTrader 4 based on ADX and ATR. It trades only in the hours you set (time filter) and can size trades from your balance and risk percent. It has 14 settings, such as Session start hour, Session start minute and Opening range minutes. MQL source code included.
Files in the download: OpeningRangeFadeSystem.ex4, OpeningRangeFadeSystem.mq4, OpeningRangeFadeSystem.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 |
|---|---|---|
| Session start hour | 8 | Server-time hour the session/opening range begins |
| Session start minute | 0 | Server-time minute the session/opening range begins |
| Opening range minutes | 30 | Length of the opening range window, minutes |
| Session end hour | 16 | Server-time hour the session ends - open trades are closed here |
| Adx period | 14 | ADX period used for the rotational/trend classification |
| Adx rotational ceiling | 22.0 | Session ADX (at session start) must be below this to trade |
| Break buffer pips | 2.0 | Price must clear the range edge by this many pips to count as a break |
| Atr period | 14 | ATR period, used for the stop buffer beyond the range |
| Stop atr multiple | 0.5 | Stop buffer beyond the far side of the break, in ATR multiples |
| Risk percent | 0.75 | Risk per trade, percent of equity |
| Magic number | 20260907 | 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 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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: ADX · Trend · Trading Sessions · Time Filter · Risk & Lot Size · ATR · MT4 Expert Advisor · MQL4 Source Code