Gold Trend Breakout
- Experts
- Version: 1.1
- Activations: 5
Gold Trend Breakout is a trend-following Expert Advisor for MetaTrader 5, built for XAUUSD (Gold) on the H1 timeframe.
What it does
The EA waits for gold to break out of its recent range and then follows the trend for as long as it lasts.
- Entry: a closed H1 bar breaks above the highest high (buy) or below the lowest low (sell) of the previous 110 bars.
- Initial stop: 3.5 x ATR(20) from the entry price.
- Exit: the stop trails the opposite 20-bar channel and is never loosened. There is no fixed take profit, so a winning trade stays open while the trend continues.
- One position at a time. No grid, no martingale, no averaging, no hedging, no news trading, no DLL.
Position size
Each trade risks a fixed percentage of equity (default 0.75%) if the initial stop is hit. On small accounts where this would be below the broker's minimum lot, the EA trades the minimum lot only if its real risk stays within a limit you set (default 3%); otherwise it skips the trade.
What to expect
This is a trend-following system. It typically wins fewer than half of its trades. Most trades are small losses when a breakout fails; profit comes from a minority of trades that catch a long trend. Expect losing streaks and periods of several months without new highs. In the Strategy Tester some calendar years were negative (for example 2018 and 2022), when gold moved sideways.
Inputs
- Entry_Period (110): breakout channel length in bars
- Exit_Period (20): trailing exit channel length in bars
- SL_ATR_Mult (3.5): initial stop distance in ATR
- Trend_EMA (0): optional EMA trend filter, 0 = off
- ATR_Period (20)
- Risk_Percent (0.75): risk per trade, % of equity
- Max_Min_Lot_Risk (3.0): maximum risk accepted when the minimum lot is used
- Max_Lots (5.0): maximum lot per trade
- Max_Spread_Pts (0): optional spread filter in points, 0 = off
- Allow_Long / Allow_Short
- Magic_Number, Trade_Comment
- Stress_Cost_Per_Lot (0): Strategy Tester only, subtracts an extra cost per lot from the optimization score; it does not change live trading
Recommended use
- Symbol: XAUUSD / GOLD, timeframe H1. The default settings were developed on this symbol only.
- Any account type; low spread is helpful but the EA trades rarely (about 60 trades per year in tests).
- Run it on a VPS or a computer that stays online. The EA works on closed bars, so it does not need fast execution.
- Test it first in the Strategy Tester with your broker's data and on a demo account.
Risk notice
Trading leveraged products such as gold CFDs carries a high risk of loss. Strategy Tester results are simulations based on historical data. They do not represent live trading and do not guarantee future results. Choose a risk level you can afford to lose.
