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

Discover: Metatrader 5 Expert Advisor | Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2…

Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.

Awesome Oscillator Pullback trades EURUSD on H1 in both directions. It joins a moving-average filter, the Awesome Oscillator and a daily level: the oscillator marks the pullback, and the daily low or high from three days back marks where price has to recover before the trade opens. The EA never buys or sells at the market: it places a stop order at that level, so the trade opens only if price actually gets there.

The code is short and self-contained. The ATR is computed inside the EA, with Wilder smoothing. The only built-in indicators are iMA and iAO. Signals are evaluated once per bar, on the first tick of the new bar, and the EA trades one position at a time.

Trading rules

  • Buy: the open two bars ago is below the weighted moving average and the Awesome Oscillator is falling (the last closed bar is below the bar before). A buy stop goes to the low of the daily bar three days back, and only when that level is above the current price.
  • Sell: the open two bars ago is above the weighted moving average and the Awesome Oscillator is rising. A sell stop goes to the high of the daily bar three days back, and only when that level is below the current price.
  • Stop loss and take profit: the stop sits 1.5 ATR from the entry; the target is 0.7% of the entry price.
  • Volume: calculated from the stop distance so that a stop-out costs a fixed amount of money, 20 USD by default.
  • Expiry: an unfilled order is cancelled after 12 bars; a new signal on the same side replaces it.
  • Indicators: linear weighted moving average of 14 periods on the close, ATR of 24 periods, Awesome Oscillator.

How the strategy was built

This strategy was not tuned by hand on a chart. It came out of an automated search on EURUSD history and was kept only after a series of robustness checks.

Grid trading done right – try the robust Grid Expert Advisor for controlled risk. Details here.

It was the only strategy, out of more than 1.2 million candidates tested, to pass every check.

Backtest

The test was run on EURUSD H1 in the "Every tick based on real ticks" mode, from October 2021 to October 2026, with a 1,000 USD deposit, 1:100 leverage and a fixed risk of 20 USD per trade. Real ticks cover the whole period. The net profit was 2,092.81 USD (+209%), with a profit factor of 1.29, a recovery factor of 3.75 and a maximum equity drawdown of 558.07 USD (15.55%). There were 508 trades: 256 buys, 26.2% of them winners, and 252 sells, 27.4% winners. Winning trades averaged 68.72 USD against 19.50 USD for losing trades, and the longest losing streak was 15 trades (291.09 USD). The risk is a fixed amount with no compounding, so the results in money scale with InpRiskMoney.

Image for Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2026 Backtest

Image for Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2026 Backtest

Inputs

  • InpRiskMoney — money risked per trade, in account currency (default 20). If that amount buys less than the minimum volume, the minimum volume is used.
  • InpMaxLots — maximum volume per trade.
  • InpMagic — magic number of the EA's orders.
  • InpMaPeriod — weighted moving average period.
  • InpAtrPeriod, InpStopAtr — ATR period and stop distance in ATRs.
  • InpTargetPct — target, in percent of the entry price.
  • InpBreakEvenPips — profit in pips that moves the stop to the entry.
  • InpTrailPips, InpTrailStart — trailing stop distance and the profit in pips that starts it.
  • InpExpiryBars — bars a pending order stays alive.

Attach the EA to a EURUSD H1 chart. The defaults are the tested values. Set InpRiskMoney to the share of your account you want at risk on each trade: the tested 20 USD is 2% of the 1,000 USD deposit.

Educational content, not financial advice. Trading involves risk of loss.

Complement community code with advanced automation from RobotFX.

78891

Best MetaTrader Indicators + Profitable Expert Advisors