XAU Patient Trend
- Experts
- Versione: 1.2
- Aggiornato: 26 settembre 2026
- Attivazioni: 5
XAU Patient Trend is a trend-following Expert Advisor for gold (XAUUSD) on the H1 chart. It enters on a breakout in the direction of the daily trend, places a stop loss with every order, and then follows the move with a volatility-based trailing stop. There is no fixed take-profit: a trade stays open until the trailing stop is hit.
This is a slow, rule-based system. It trades about six times per month on average, and there can be several weeks without any trade when gold has no clear daily trend. Most trades end with a small loss, and the long-term result depends on a small number of long trends. Please read the section on risks and weaknesses before you buy.
How it works
Trend filter (D1). Buy trades are allowed only when EMA 50 is above EMA 200 and the last daily close is above EMA 50. Sell trades need the opposite. In all other cases the EA opens no new trades.
Entry (H1). When a closed H1 bar closes above the highest high of the previous 15 bars, the EA buys at the start of the next bar. When it closes below the lowest low of the previous 15 bars, it sells.
Initial stop loss. 2 x ATR(14) on H1 from the entry price. It is sent together with the order.
Trailing stop. The highest high since entry minus 4 x ATR(14) for buys, the lowest low since entry plus 4 x ATR(14) for sells. The stop only moves in the trade's favour and is updated once per closed H1 bar.
Position size. A fixed percentage of the balance is risked per trade. The lot is calculated from the broker's own contract values and rounded down to the lot step. If even the minimum lot would risk more than a set limit (default 3% of the balance), the signal is skipped and the Experts log shows the balance that would be needed.
Main properties
- One position at a time, and every position has a stop loss from the moment it opens.
- No martingale, no grid, no averaging, no hedging.
- All decisions use closed bars only. Signals do not repaint, and the Strategy Tester uses the same logic as a live chart.
- Built for real trading conditions: retries within the same bar if an order or a stop update fails, spread and slippage limits in price units (works with 2- and 3-digit gold quotes), protection against double entries after a restart, stop level and freeze level checks for the trailing stop, hedging and netting accounts.
Recommended setup
- Symbol and chart: XAUUSD on an H1 chart. The EA was developed and tested only on gold. It does not block other symbols, but other symbols are not recommended. If your broker uses a different name (for example GOLD or XAUUSD.m), attach the EA to that chart.
- Risk per trade: 2% (default). This is an aggressive setting with deep drawdowns: in the MT5 backtest from 2020 to 2026 the maximum balance drawdown was 33.0% and the maximum equity drawdown 35.8%, and in the Python re-simulation on 2005 to 2026 data it was about 47% (see Risks and weaknesses). If you want lower drawdowns, set the risk to 1%: the maximum drawdown was then 13.8% (balance) and 15.9% (equity) in the same MT5 backtest, and about 26% in the Python re-simulation.
- Balance: with recent gold volatility (H1 ATR about 18 to 24 USD in June to September 2026), the initial stop of one 0.01 lot (standard contract of 100 ounces per lot) costs about 36 to 47 USD. For this to be 2% of the balance (the default) you need about 2,000 to 2,500 USD. For 1%, about 4,000 to 5,000 USD. With a smaller balance, the minimum lot risks more than the setting and some signals are skipped by the 3% limit. These amounts rise when gold becomes more volatile. Because lots are rounded down to 0.01 steps, the risk actually taken per trade was on average below the setting in the backtests, and the difference gets smaller as the balance grows well above these amounts (see the backtest summary).
- Leverage: 1:30 or higher. The lot is set by the stop distance, so the margin used is small.
- Keep the terminal running on a VPS or a computer that stays on. Use one XAUUSD chart per account.
Backtest summary (MT5 Strategy Tester backtest, not live trading)
How the settings were chosen: the strategy and its settings were chosen using 2020 to 2024 data only (2020 to 2022 to choose, 2023 to 2024 to check). Data from January 2025 to September 2026 was not used to choose them; it was tested once after the choice. The 2020 to 2024 part of the results below is therefore in-sample.
Test conditions: XAUUSD H1, 1 January 2020 to 25 September 2026, Every tick mode with 99% history quality, initial deposit 1,500 USD, leverage 1:100, swaps included, no commission, MetaQuotes-Demo data, compounding.
1% risk per trade: final balance 5,502 USD, profit factor 1.64, maximum balance drawdown 13.8%, maximum equity drawdown 15.9%, 515 trades, 35.5% winning trades.
2% risk per trade: final balance 23,304 USD, profit factor 1.63, maximum balance drawdown 33.0%, maximum equity drawdown 35.8%, 515 trades, 35.5% winning trades.
Most recent two years (25 September 2024 to 25 September 2026, real ticks where available, 2% risk): balance from 1,500 to 3,590 USD, profit factor 1.64, maximum equity drawdown 21.3%, 160 trades.
Calendar years at 1% risk: 2020 +41%, 2021 -4%, 2022 +15%, 2023 +13%, 2024 +26%, 2025 +41%, 2026 (January to September) +18%.
Risk actually taken: because lots are rounded down to 0.01 steps, the risk actually taken per trade was usually below the setting. Calculated from the entry price, the initial stop loss and the lot of every trade in the test reports, the average was 0.80% of the balance in the 1% test (single trades from 0.50% to 2.63%), 1.88% in the 2020 to 2026 test at 2%, and 1.53% in the two-year test at 2%. The gap becomes smaller when the balance is large compared with the stop of one 0.01 lot: in the 2020 to 2026 test at 2%, the 191 trades opened with a balance above 5,000 USD risked 1.90% on average. Near the recommended minimum balance, a single trade can risk clearly less than the setting, or more (up to the 3% limit) when even the minimum lot is larger than the setting.
These are backtest results. They are not live trading results and they are not a forecast. Prices, spreads, swaps and execution at your broker will lead to different results. You can test the EA yourself with the free demo in the Strategy Tester.
Risks and weaknesses
Low win rate. About 35% of trades are winners. In the backtest there was a series of 12 losing trades in a row, which reduced the balance by about 8% at 1% risk and about 18% at 2% risk.
Long periods without a new high. At 2% risk the balance stayed below a previous peak for 32 months (April 2021 to December 2023). At 1% risk the longest such period was 15 months.
Profit from buy trades in a gold bull market. During the 2020 to 2026 test, gold rose from about 1,520 to about 4,290 USD per ounce, with a peak above 5,400 USD in January 2026. Almost all of the profit came from buy trades: in the 1% test, the 431 buy trades made +3,860 USD, while the 84 sell trades were close to break-even at +142 USD, which is 3.6% of the total net profit of +4,002 USD. In the last two years 96% of the trades were buys, so sell trades have had little testing in recent market conditions.
Dependence on strong trends. All of the net profit of the last two years came from the rally between September 2025 and February 2026: trades closed in that period made +2,155 USD, more than the two-year total of +2,090 USD. The other 18 months together were slightly negative (-65 USD). From March to September 2026 the balance went down, and the two-year test ended 17.6% below its March 2026 peak.
Weaker results in earlier years. A separate Python re-simulation of the same entry and exit rules on July 2005 to September 2026 data (not MT5, costs approximated, results in R, where 1R is the initial stop-loss risk of a trade) gave about +10R per year in 2005 to 2019, or about +6R per year without 2013, compared with about +24R per year in 2020 to 2026. The 2005 to 2019 data was not used to choose the rules. The re-simulation had losing years in 2008, 2010, 2012, 2017 and 2021, and its sell trades were profitable mainly during the 2013 gold decline. Its largest drawdown was about 26% at 1% risk and 47% at 2% risk (fractional lots, so the full risk was taken on every trade), more than in the 2020 to 2026 MT5 tests.
Gaps. After a weekend or a news event the price can open beyond the stop loss. The stop is then filled at a worse price. The largest single loss in the backtest was 4.1% of the balance at 2% risk.
No live track record yet. The EA is new. A demo account was started on 27 September 2026 and has no meaningful history yet.
Input parameters
The names below are exactly as they appear on the Inputs tab. The default values are the settings of the 2% backtest. The 1% backtest used the same settings except the risk.
Entry
- Signal timeframe (independent of the chart) — default H1. Timeframe used for the breakout, the ATR and the trailing stop.
- Breakout lookback (bars) — default 15. The close must break the high or low of this many previous bars.
- Trend filter timeframe — default D1. Timeframe of the EMA trend filter.
- Trend fast EMA period — default 50. Fast EMA of the trend filter.
- Trend slow EMA period — default 200. Slow EMA of the trend filter.
- Allow buy trades — default true. Turns buy trades on or off.
- Allow sell trades — default true. Turns sell trades on or off.
Stop loss / Trailing
- ATR period (signal timeframe) — default 14. ATR period for both stops.
- Initial stop loss (x ATR) — default 2.0. Stop distance at entry.
- Trailing stop distance (x ATR) — default 4.0. Distance of the trailing stop from the best price since entry.
Money management
- Risk per trade (% of balance), 0 = fixed lot — default 2.0. This is an aggressive setting; set 1.0 for lower drawdowns (see Recommended setup). With 0, the fixed lot below is used.
- Compounding: current balance (true) / start balance (false) — default true. Balance used to size the trades.
- Fixed lot (used when risk % is 0) — default 0.01.
- Skip a trade if the minimum lot risks more than this %, 0 = off — default 3.0. The Experts log then shows the balance that would be needed.
- Max spread in price units (e.g. 0.60 = 60 cents on gold), 0 = off — default 0.60. While the spread is wider than this, there is no entry and no trailing-stop exit at market.
- Max slippage in price units (e.g. 0.50 = 50 cents on gold) — default 0.50. Allowed price deviation for market orders.
- Magic number — default 20260927. Identifies the EA's own trades. Change it only if another EA uses the same number.
Installation
1. After buying or renting, the EA appears in the MT5 Navigator under Expert Advisors, Market.
2. Open an XAUUSD chart and set the timeframe to H1.
3. Drag the EA onto the chart. On the Common tab, allow Algo Trading. On the Inputs tab, check Risk per trade (% of balance): the default 2.0 is an aggressive setting; enter 1.0 for lower drawdowns.
4. Turn on the Algo Trading button in the terminal toolbar. When the EA starts, it writes its settings to the Experts log.
5. Keep the terminal running. The EA checks for a signal each time an H1 bar closes.
Frequently asked questions
The EA has not opened a trade for a long time. Is something wrong?
Usually not. The EA trades only when an H1 breakout agrees with the daily trend. When the daily EMAs show no clear trend, there are no trades, sometimes for several weeks. Skipped signals (spread too wide, minimum lot risk too high, Algo Trading turned off) are reported in the Experts log.
Does it use martingale, grid or averaging?
No. There is one position at a time with a stop loss, and a fixed percentage of the balance is risked.
Can I use it on other symbols or timeframes?
It was designed and tested only for XAUUSD with H1 signals. It does not block other symbols, but they are not recommended. The signal timeframe is set by an input, so the chart timeframe does not change the signals; an H1 chart is recommended so that the chart matches what the EA sees.
What balance do I need?
With recent gold volatility, about 2,000 to 2,500 USD or more at the default 2% risk, or about 4,000 to 5,000 USD or more at 1% (see the recommended setup). With a smaller balance, the minimum lot of 0.01 can risk more than your setting, and signals above the 3% limit are skipped.
Will my results be the same as the backtest?
No. Results depend on your broker's prices, spreads, swaps and execution, and on future market conditions. The backtest only shows how the rules behaved in the past.
Can I run it on a prop firm account?
The EA has no daily loss limit. At the default 2% risk the backtest drawdown was above 30%, and at 1% risk about 16%. Check the rules of your account before using it.
Can I run other EAs on the same account?
Yes. The EA manages only positions with its own magic number. On a netting account it does not open a trade while another position on the same symbol is open.
Support is provided through the product comments and MQL5 private messages.
Trading gold with leverage carries a high risk of loss. Past performance, including backtests, does not guarantee future results. Use only money you can afford to lose.
