Stochastic Daily Breakout for Gold: Backtested Performance to 2026

Stochastic Daily Breakout for Gold: Backtested Performance to 2026
Download ALL MT5 experts (1731)
YouTube Video Thumbnail



Similar MetaTrader Tools

Stochastic Daily Breakout for Gold: Backtested Performance to 2026

Info

The Stochastic Daily Breakout for Gold: Backtested Performance to 2026 is a Expert Advisor for MetaTrader 5 that stochastic daily breakout combines two simple ideas on gold. A turn in the stochastic signal line marks a possible change in momentum, and yesterday's high and low mark the levels where that change has to be confirmed.

Usage

This tool is typically used for breakout trading when price moves beyond key support/resistance levels.

Platform

This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.


How to Install and Use Stochastic Daily Breakout for Gold: Backtested Performance to 2026

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

What this tool does

Stochastic Daily Breakout combines two simple ideas on gold.

Typical Use Case

This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.

Compatible Platform & Setup

This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.

Description & Settings

Related: Prop Guard Lite: Daily and Max Loss Protection for Prop Firm Accounts - another powerful expert for MetaTrader 5 traders.

Stochastic Daily Breakout combines two simple ideas on gold. A turn in the stochastic signal line marks a possible change in momentum, and yesterday's high and low mark the levels where that change has to be confirmed. The EA never buys or sells at the market: it places a stop order at one of those levels, so the trade opens only if price actually gets there.

Also recommended: Prop Firm Guard: Daily Loss and Max Drawdown Protection - similar expert with strong performance on MetaTrader 5.


The code is short and self-contained. The stochastic is computed inside the EA, because this variant uses the close-to-close range with SMMA smoothing, which differs from the built-in iStochastic. The only built-in indicator is iBands. The EA trades one position at a time.

Trading rules

Buy:
the stochastic signal line turns down (a peak on the previous bar) and the open three bars ago is below the upper Bollinger band. A buy stop goes to yesterday's high.

Sell:
the signal line turns up (a trough on the previous bar) and the open three bars ago is above the lower Bollinger band. A sell stop goes to yesterday's low.

Stop loss and take profit:
1.9% of the entry price each.

Expiry:
an unfilled order is cancelled after 9 bars; a new signal on the same side replaces it.

Indicators:
stochastic 23/3/7, Bollinger bands 9 periods, 2.0 deviations, weighted price.

How the strategy was built and validated

This strategy was not tuned by hand on a chart. It came out of an automated search on five years of XAUUSD history, where six independent genetic builders, each with its own out-of-sample period, generated and tested candidate strategies.

Every candidate needed a healthy trade structure, with results that do not depend on a single trade or a single day. Then it had to pass a chain of robustness tests, including other timeframes, related markets, Monte Carlo simulations with spread stress, parameter stability, walk-forward analysis and more, where a single failure is enough to discard it.

This EA was found among more than two million candidate strategies tested for its family.

Backtest

The test was run on XAUUSD H1 in the "Every tick based on real ticks" mode, from July 2021 to September 2026, with a 1,000 USD deposit, 1:100 leverage and a fixed 0.01 lot. Real ticks cover about a quarter of that period; for the rest, the tester generated ticks from M1 data. The net profit was 2,453 USD (+245%), with a profit factor of 1.54, a recovery factor of 5.56 and a maximum equity drawdown of 23.9%. There were 213 trades: 116 buys, 66.4% of them winners, and 97 sells, 50.5% winners. The results scale with the lot: at a fixed 0.01 lot, a larger deposit shows a smaller percentage.

Inputs

InpLots
— volume per trade (default 0.01).

InpMagic
— magic number of the EA's orders.

InpBandPeriod
— Bollinger band period.

InpKPeriod, InpDPeriod, InpSlowing
— stochastic periods.

InpStopPct, InpTargetPct
— stop and target, in percent of the entry price.

InpExpiryBars
— bars a pending order stays alive.

Attach the EA to an XAUUSD H1 chart. The defaults are the tested values. A backtest is not a promise of future results, so test it on a demo account with your broker's prices before trading real money.

You may also like: Equity Guard: Daily Loss, Max Drawdown, and Profit Target Protection for MT5 - excellent alternative for expert users on MetaTrader 5.

Source Code

#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version   "1.00"
input double InpLots       = 0.01;
input int    InpMagic      = 260931;
input int    InpBandPeriod = 9;
input int    InpKPeriod    = 23;
input int    InpDPeriod    = 3;
input int    InpSlowing    = 7;
input double InpStopPct    = 1.9;

.......

Leave your opinion, ask a question, share some knowledge

⚠ Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.