Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 5 Expert Advisor | SessionReopenEA | MetaTrader Tool

Discover expert developed MetaTrader tools that can complement professional solutions.

Image for SessionReopenEA


Gold has a daily maintenance break on the CME. The first hour of trading after it rises more than chance explains, and it does so on every calendar year of an eleven-year sample — whileevery other hour of the day measures flat.

Experience adaptive trading with the Fluid Expert Advisor for MT4/MT5. Dynamic money management and trend detection. Click for info.

This Expert Advisor buys at that reopen, holds for a fixed time with a volatility-scaled server-side stop, and does nothing else. One trade per session. No averaging, no grid, no martingale, no recovery.

The number, and then the number after I found my cost model was wrong

Measured over 11 years of hourly data, entering at the reopen and holding two hours:

as the research charged cost at the cost the tester measured
per trade +3.34 bps +1.60 bps
t statistic 7.40 3.42
win rate 59.3% 50.8%
profit factor 1.63 1.30
positive years 11 of 11 10 of 11

The left column is what I would have published if I had stopped where most people stop. Then a real-tick backtest in MetaTrader's own Strategy Tester showed the true round-trip cost at the reopen is about60 points, not the 19 my research had chargedspread

The edge survives that correction, at less than half its original strength, and the win rate becomes a coin flip carried by a favourable payoff rather than by frequency. The right column is the real one, and it is the one this EA is built on.

What it is not

It is not a living, and the header of the source file says so before any parameter is described. On capital sized for a 20% drawdown it measures about+3.3% a year with 4.6% maximum drawdown, Sharpe 1.23, roughly 200 trades a year — which also means roughlyone year in nine is negative. At 0.01 lots that is about 130 currency units a year, and that figure measures theposition size, not the strategy.

A 2.5-year window of it, taken alone, givest = +1.12

What the result survived before I trusted it

Each of these could have killed it, and the reason they are listed is that a result nobody tried to break is not a result:

  • It is not a gap.open.
  • It is not a bar-construction artifact.
  • It is not outliers.
  • It is not the spread normalisation
  • It does not need the exact reopen tick.
  • The weekly reopen is NOT part of it.InpSkipMonday

Inputs, and why they are what they are

Input Meaning
InpEntryHour The server hour of the reopen. Working in server time is deliberate: this broker's clock follows US daylight saving, so the reopen sits at a fixed server hour all year, while a UTC trigger would drift by an hour twice a year.
InpEntryWindowMin Only enter within this many minutes of the hour.
InpHoldHours Hours to hold before closing on time.
InpSkipMonday Skip the weekly reopen. See the Sunday figures above.
InpLots Fixed lot. No scaling, ever.
InpStopAtrMult Stop = this × the mean hourly range. Default 2.0, not the 1.5 the first version used — see below.
InpRangeBars H1 bars in the mean-range unit. 480 is about 20 sessions.
InpMaxSpreadPts Refuse to enter if the spread is worse than this.

On the stop multiplier.

Test it before believing any of the above

And test it withevery tick based on real ticks. On other code of mine, the same rules over the same period produced −15,627 with 1-minute bar modelling and +79,000 with real ticks. A backtest that does not state its modelling mode is not telling you what it measured.

Complement community code with advanced automation from RobotFX.

77060

Best MetaTrader Indicators + Profitable Expert Advisors