UT Gold Bot M15
- Experts
- Versão: 1.0
- Ativações: 5
UT Gold Bot M15 — stop-and-reverse trend follower for XAUUSD
WHAT THIS IS
An MT5 implementation of the ATR trailing-stop logic from "UT Bot Alerts", a well-known
public Pine indicator by Yo_adriiiiaan (based on earlier work by HPotter). The algorithm
itself is public and free.
What you are buying is the validation work: which settings actually hold up on real XAUUSD
data, which timeframe works, and which usage destroys the edge. All claims below come from
Strategy Tester reports on 100% real ticks, and every one is reproducible with the .set file
included.
THE SHORT VERSION
- Timeframe: M15 only. M1 was measured as a losing configuration.
- Symbol: XAUUSD / XAUUSDm (gold). Not validated on anything else.
- Style: always in the market, reverses on the opposite signal. No fixed take profit.
- Median holding time: about 16 hours. This is not a scalper.
- Around 20 signals per month.
VERIFIED BACKTEST
Strategy Tester, XAUUSDm M15, 2026.01.01 - 2026.08.14, 100% real ticks (63,869,624 ticks),
10,000 USD deposit, fixed 0.01 lot, real broker spread:
Total net profit +2,409.41 USD
Profit factor 1.82
Expected payoff +16.06 USD per trade
Sharpe ratio 3.16
Recovery factor 3.02
Total trades 150
Won 47.33%
Balance drawdown max 641.00 USD (5.35%)
Equity drawdown max 797.66 USD (6.58%)
Largest win / loss +451.77 / -137.65 USD
Max consecutive losses 5 (-159.61 USD)
Over the same period gold itself moved only +23.86 USD net, and the report splits the 150
trades evenly: 75 long (48.00% won) and 75 short (46.67% won), with profit divided close to
evenly between the two sides. The result is therefore not disguised directional exposure.
Re-running the identical configuration after the terminal re-synchronised its tick history
produced +2,322.10 USD instead of +2,409.41. Expect roughly 4% variance from the tick stream
alone, and do not read small differences as meaningful.
WHY THE DEFAULT SETTINGS OF THE INDICATOR DO NOT WORK
The indicator ships with Key Value = 1. Measured over 10 months on M15, that setting produces
-396 USD with a profit factor of 0.98 and only 3 profitable months out of 11.
This EA defaults to Key Value 4.5 and ATR Period 10, the centre of a robust plateau: every one
of the 84 combinations in the range Key Value 3.0-6.0 and ATR Period 5-28 was profitable over
the test period, with a median expectancy of +7.34 USD per trade. Performance collapses above
Key Value 7, so this is a genuine optimum and not a grid-edge artefact.
THREE IMPLEMENTATION FACTS THAT CHANGE THE RESULT
1. MT5's built-in iATR() is a simple moving average of True Range. Pine's atr() is Wilder's
RMA. They are not the same: only 45 of 106 buy signals coincide, and expectancy drops from
+13.42 to +8.57 USD per trade. This EA implements Wilder's RMA directly.
2. The trailing stop is a signal evaluated on bar close, not a stop-loss order. Placing a
broker stop at the trailing level destroys 45% of the edge (+2,831 to +1,555 USD). This EA
therefore places no order at that level.
3. Fixed take profit does not work with this logic. Tested with ATR-multiple SL/TP brackets,
only 19 of 154 combinations were profitable and the train-to-test correlation was -0.14.
The edge lives entirely in the trailing stop.
TIMEFRAME EVIDENCE
Each timeframe was re-optimised separately, then the optima compared. Real ticks,
2026.01.01 - 2026.08.14, 0.01 lot:
M1 -448 USD PF 0.97 Sharpe -0.49 2,192 trades
M5 +2,797 USD PF 1.91 Sharpe 3.59 171 trades
M15 +2,409 USD PF 1.82 Sharpe 3.16 150 trades
M30 +1,973 USD PF 1.80 Sharpe 2.60 136 trades
H1 +1,382 USD PF 1.53 Sharpe 1.98 123 trades
M1 loses money: transaction cost is about 50% of the average gross gain per trade.
M5 posts the highest net on this single run, but its parameter surface is chaotic - expectancy
per trade goes +11.93, then -10.22, then +24.85 as Key Value increases. M15's surface is
unimodal and smooth, peaking at Key Value 4-5 and decaying steadily. M15 is the only timeframe
in the top two for robustness across both test windows, with 79% and 81% of grid combinations
profitable. The M5 figure is a lucky draw, not an optimum.
RISK MANAGEMENT
Two sizing modes: fixed lot, or percent of equity. In percent mode the risk unit is the
trailing distance (Key Value x ATR, median 46.63 USD), which is where the strategy actually
exits. Measured over the 81 losing trades of 2026: the loss-to-risk ratio has a median of
0.72 and a maximum of 2.03, and 21% of losses exceed the nominal risk. It is a sound but not
absolute proxy - size accordingly.
Equity drawdown measured at each risk level, 10,000 USD deposit, compounding on:
1% +4,755 USD drawdown 10%
2% +11,450 USD drawdown 19%
3% +21,945 USD drawdown 27%
5% +53,225 USD drawdown 30%
A 20,000-permutation Monte Carlo on trade order gives, at 5% risk, a median drawdown of 34%
and a 90th percentile of 45%. Note that with multiplicative compounding the final result is
order-independent; only the drawdown path depends on sequence.
Important for small accounts: if your equity is low enough that the computed lot rounds down
to the broker minimum, the risk percentage stops having any effect and the real risk per trade
rises as the account falls. On a 1,000 USD account at 0.01 minimum lot, one trade risks about
4.6% regardless of the setting. The EA detects this and warns you in the journal.
A disaster stop at 3x the trailing distance is placed as protection against disconnection.
It was never triggered in testing, so it costs nothing - results are identical to the cent.
WEEKEND HANDLING
The strategy is in the market 100% of the time, so it is exposed to weekend gaps. Flattening
on Friday evening is enabled by default: it costs about 10% of net profit but reduces drawdown
by 29% and slightly improves profit factor. The cut-off hour is configurable and is expressed
in BROKER SERVER TIME - check yours.
WHAT THIS EA DOES NOT DO
- No martingale, no grid, no averaging down, no hidden lot multiplication.
- No fixed take profit. By design, and for the measured reason given above.
- No news filter. Signals are not blocked around economic releases.
- No regime filter. This is where a trend follower suffers, in ranging markets.
- Only one position at a time. No pyramiding.
- Not validated on any symbol other than gold, or any timeframe other than M15.
HONEST LIMITATIONS
The measured edge rests on 10 months of a single market regime - gold was exceptionally
directional over the period, with a maximum excursion of +1,557 USD. Permutation-test p-values
(0.014 to 0.040) do not survive a Bonferroni correction across the 238 combinations tested. The
strong argument is the breadth of the profitable plateau, not statistical significance.
The equity curve is not a straight line. It advances in two steps: a sharp rise in January, then
roughly five months of flat-to-negative movement, then a second rise. Two months carry 66% of
the result. Starting at the wrong moment means months without gains while still absorbing the
drawdown.
Test on demo for at least two to three months before committing capital. Past performance does
not predict future results.
REQUIREMENTS
- MetaTrader 5, build 2470 or later
- XAUUSD or XAUUSDm on an M15 chart
- Hedging or netting account, both supported
- Minimum balance: 3,000 USD at 0.01 lot. The measured maximum drawdown at 0.01 lot was
641 USD, which is already 21% of a 3,000 USD account and would be unsurvivable on 1,000 USD.
Percent-of-equity sizing only becomes meaningful above roughly 2,000 USD, below which the
broker minimum lot overrides the setting
- Raw or low-spread account recommended, though the strategy is cost-insensitive: tripling
spread and slippage costs only 0.54 USD per trade
- VPS recommended, since the EA must be running at each M15 bar open
SUPPORT
Message me through MQL5 with your broker, account type and a screenshot of the journal for any
question. The .set file used for every figure quoted above is included so you can reproduce
each backtest yourself.
