Gold Trend Breakout — user guide: settings, risk and gold contract sizes
Gold Trend Breakout trades one idea on one market: trend breakouts on gold, XAUUSD, on the H1 chart. This guide explains how it works, how to set it up, and why account size and gold contract size matter more here than on most EAs.
How it works
- Entry. When an H1 bar closes above the highest high of the previous 110 bars, the EA buys. When it closes below the lowest low of the previous 110 bars, it sells.
- Initial stop. Every trade has a stop loss at 3.5 × ATR(20) from the entry price.
- Exit. There is no take profit. The stop follows the opposite 20-bar channel and is never moved further away. The trade ends when price hits the trailing stop.
- Position size. The lot is calculated so that a stop-out loses about 0.75% of equity (default).
One position at a time. No grid, no martingale, no averaging, no hedging. The EA works on closed bars only.
Setup
- Symbol: XAUUSD. Brokers use other names: GOLD, XAUUSD.m, XAUUSDpro and so on. Attach the EA to the chart of your broker's gold symbol. It uses the symbol of the chart.
- Timeframe: H1. The defaults were developed on XAUUSD H1 only.
- One chart only. Allow algo trading and make sure the symbol is in Market Watch.
- If you run other EAs on the same account, give each a different Magic_Number .
Inputs that matter
- Risk_Percent (default 0.75): risk per trade as % of equity. Lower it (for example 0.5) if you want smaller drawdowns. Keep it low: gold stops are wide.
- Max_Min_Lot_Risk (default 3.0): only used when the calculated lot is below the broker's minimum. See the next section.
- Max_Lots (default 5.0): upper limit for one trade. Lower it if you want a hard cap.
- Max_Spread_Pts (default 0 = off): spread filter in points. Set it only if your broker's spread is often very high. A blocked signal is skipped, not delayed.
- 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 units.
- ATR_Period (20): ATR period.
- Trend_EMA (0 = off): optional EMA trend filter.
- Allow_Long / Allow_Short (true / true): switch off one direction if you want.
I recommend leaving the strategy inputs ( Entry_Period , Exit_Period , SL_ATR_Mult , ATR_Period ) at their defaults. They were not tuned for other settings on your account.
Stress_Cost_Per_Lot is for the Strategy Tester only. It does not change live trading.
Two set files are attached to this post: GoldTrendBreakout_XAUUSD_H1_default.set (0.75% risk) and GoldTrendBreakout_XAUUSD_H1_conservative.set (0.5% risk). Load one from the EA's Inputs tab.
Gold contract sizes and the minimum lot
This is the most important section for small accounts.
At the broker I tested (Admirals, symbol GOLD), the contract is 100 oz. A 0.01 lot then gains or loses 1 USD for every 1.0 USD move in the gold price.
The initial stop is wide, 3.5 × ATR(20) on H1. At 0.01 lot, the stop was usually 35–90 USD (median about 52 USD) over 2025–2026 data. That is the loss if the stop is hit at the minimum lot.
What this means for the account size:
- Below about 3,000 USD: 0.01 lot can already lose more than the Max_Min_Lot_Risk limit (3% of equity). The EA then skips the trade. Many signals will be skipped.
- Between 3,000 and about 7,000 USD: the calculated lot is below 0.01. The EA trades 0.01 lot, so the real risk is above the 0.75% you set, up to the 3% limit.
- From about 7,000–10,000 USD: the calculated lot is at least 0.01 and the risk setting works as intended.
How the EA handles lot size:
- It calculates the lot from the stop distance and the broker's own contract data.
- It rounds the lot down to the broker's lot step. So rounding does not raise your risk.
- If the result is below the minimum lot, it uses the minimum lot only if its real risk is within Max_Min_Lot_Risk . Otherwise it skips the trade.
- If free margin is not enough, it reduces the lot until the margin fits.
If you want the 0.75% setting to be real, use an account in the range above. On a smaller account, accept that the real risk per trade is higher than the setting. Do not raise Max_Min_Lot_Risk just to get more trades on a small account. That is the same as accepting a larger loss per trade.
Broker checks
Before you run it live, check these on your broker's gold symbol:
- Contract size. Look at the symbol specification. 100 oz is what I tested. If your broker uses a different contract size, the stop in USD at 0.01 lot changes in proportion, so the account size guidance above changes too. When the EA starts, it prints contract size, minimum lot, lot step, spread and digits in the Experts log. Read that line.
- Minimum lot and lot step. Some brokers have a minimum above 0.01.
- Spread. The EA trades rarely, so a low spread helps but is not critical. Check the spread at the time of your signals.
- Stops level and freeze level. The EA keeps the stop at least that far from the price.
- Swap. Trades often stay open for days. Check the swap for long and short on gold and Wednesday triple swap, if applicable.
- Weekend gaps. Trades can be held over the weekend. A gap can go past the stop.
What to expect
These are backtest results, not live results and not a promise of future performance. Real-ticks test, 2018–2026, Admirals, symbol GOLD, 10,000 USD deposit, 0.75% risk, 99% real ticks:
- Net result +51%, profit factor 1.28, maximum equity drawdown 18.4%.
- 560 trades (about 60 per year). The EA does not trade often.
- 38.57% winning trades. It wins fewer than half of its trades. Most losses are small, and the profit comes from a minority of long trends.
- Longest losing streak: 10 trades.
- Average holding time about 34 hours, longest about 258 hours.
- 2018 and 2022 were losing years, when gold moved sideways.
Unchanged forward period 2025–2026: profit factor 1.78, 112 trades. Walk-forward by year: 5 of 6 years positive. With the main inputs changed by ±20%, 6 of 6 variants were positive.
Expect losing streaks and long periods without new equity highs. Judge the EA over many months, not days. I have tested only one broker.
FAQ
It doesn't trade for weeks. Is it broken?
Probably not. It enters only when a closed H1 bar breaks the 110-bar channel, so some weeks and months have no signal. A signal is also skipped if the spread filter blocks it (off by default), or if the minimum lot would risk more than Max_Min_Lot_Risk . Check the Experts log for the "trade skipped" message.
The lot is larger than I expected.
On a small account the calculated lot may be below the minimum. The EA then trades the minimum lot if the risk is within Max_Min_Lot_Risk . Compare the risk in money (stop distance × lot), not the lot number. Brokers have different gold contract sizes.
My broker uses a different symbol name.
Open the H1 chart of your broker's gold symbol and attach the EA. It works with the symbol of the chart. It was tested on XAUUSD / GOLD only.
Which timeframe?
H1. The defaults were developed on H1. Other timeframes are not tested.
Do I need a VPS?
A VPS or a computer that stays online is recommended, because trades stay open for days. The EA works on closed bars, so fast execution is not needed.
Before you buy
Download the free demo and run it in the Strategy Tester on your broker's gold symbol, H1, model "Every tick based on real ticks" if available. Then run it on a demo account. Leveraged gold CFDs carry a high risk of loss. Choose a risk level you can afford to lose. If something doesn't work as described, message me.
Product page: https://www.mql5.com/en/market/product/208295


