Loading…

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 · MT5 · v1.0 · Free

About Opening Range Fade System

Opening Range Fade System is an expert advisor (trading robot) for MetaTrader 5 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.ex5, OpeningRangeFadeSystem.mq5, OpeningRangeFadeSystem.txt.

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

Settings

SettingDefaultWhat it does
Session start hour8Server-time hour the session/opening range begins
Session start minute0Server-time minute the session/opening range begins
Opening range minutes30Length of the opening range window, minutes
Session end hour16Server-time hour the session ends - open trades are closed here
Adx period14ADX period used for the rotational/trend classification
Adx rotational ceiling22.0Session ADX (at session start) must be below this to trade
Break buffer pips2.0Price must clear the range edge by this many pips to count as a break
Atr period14ATR period, used for the stop buffer beyond the range
Stop atr multiple0.5Stop buffer beyond the far side of the break, in ATR multiples
Risk percent0.75Risk per trade, percent of equity
Magic number20260907Magic 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: ADX · Trend · Trading Sessions · Time Filter · Risk & Lot Size · ATR · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria