Gold Trend Sentinel
- Experts
- Versione: 1.2
- Aggiornato: 9 ottobre 2026
Gold Trend Sentinel follows gold's trend on the H4 chart. It buys only when three things agree: the last daily close is above its 200-day EMA, the H4 Supertrend points up, and the price closes across the UT Bot trailing line. Sells are the mirror. Every trade has a stop of 3 x ATR that then trails the best price and only ever tightens. There is no fixed target: winners run until the trail is hit.
An on-chart panel shows both trend filters, the UT Bot line, what the EA is allowed to do now, the open trade with its trailing stop, and the real risk of the next trade for your balance.
Key features
- Three-way agreement before any trade: daily trend, H4 Supertrend and a UT Bot cross
- Stop on every order, trailed at 3 x ATR behind the best price; no grid, no martingale, no averaging
- One position at a time; an opposite signal reverses it
- Status panel with the risk of the next trade in percent of balance, named Safe, Medium, High, Very high or Extreme
- Checks margin, the broker's stop and freeze levels, and the stop-out level before every order
- Works with brokers quoting gold with 2 or 3 decimals, on hedging and netting accounts
How it trades
Once per H4 bar the EA reads the last closed bar. A buy needs the close to cross above the UT Bot line (key value 1.5, ATR 10) while the last completed daily close is above its 200-day EMA and Supertrend (10, 3) on H4 is up. It then buys at market with a stop 3 x ATR(14) away. At each new H4 bar the stop moves up to 3 x ATR below the highest price since entry, if that is higher than the current stop. A sell signal closes a buy and opens a sell, and the other way round. ATRs use Wilder's smoothing, as TradingView computes them.
Quick start
- Open an XAUUSD chart (any timeframe; the EA reads H4) and attach the EA.
- Enable Algo Trading in the terminal.
- Keep the default strategy inputs, which are the tested rule.
- Read the Risk row on the panel before the first trade. If it says Very high or Extreme, the balance is small for gold; see Recommended balance below.
Lot size and risk
Every trade uses the minimum lot: 0.01, or the broker's minimum where that is larger. The panel's Risk row shows what that lot risks at the stop as a percentage of your balance, and names it: Safe up to 1%, Medium up to 2%, High up to 3%, Very high up to 5%, Extreme above 5%.
Before sending an order the EA checks that the account can carry its margin and survive its stop loss without reaching the broker's stop-out level. If not, the order is skipped and the reason is shown on the panel.
Recommended balance
The stop is 3 x ATR on H4, so its size follows gold's volatility. In 2026 it was about 115 USD per 0.01 lot (between 105 and 131 in most trades). The balance therefore decides how much each trade risks:
- 12,000 USD or more (recommended): about 1% per trade, Safe
- 6,000 USD: about 2%, Medium
- 4,000 USD: about 3%, High
- 2,300 USD: about 5%, Very high; below this every trade is Extreme
- About 250 USD: the technical minimum; below it no order is placed
Where the broker's minimum lot is 0.10, multiply these figures by ten.
Backtest
The screenshots come from the tested rule in Python on RoboForex-Pro XAUUSD history from October 2021 to October 2026, with spread, commission, slippage and swap included. At 1% risk from 10,000 USD: 85 trades, net profit 2,956 USD, profit factor 2.45, worst drawdown 4.7%. With a fixed 0.01 lot: net profit 1,340 USD, profit factor 2.04. About 17 trades a year, held 5 days on average.
Holding gold over the same years made more money (10,000 USD became about 23,600) but fell 26% at its worst, against 4.7% for the EA. The EA moves almost independently of gold (beta 0.07) and earned about 5% a year above what its small gold exposure explains.
Please read before trading it. The rule was chosen on 2010-2023 research and judged once on 2024-2026; it has not been re-tuned since. Most of the profit came from buys during a rising gold market; sells lost slightly. A forward test on new data started in October 2026. Test it on a demo account first. Past results do not guarantee future results.
Inputs
Strategy (defaults are the tested rule): magic number (770100), signal timeframe (H4), UT Bot key value (1.5) and ATR period (10), Supertrend ATR period (10) and multiplier (3.0), daily trend EMA period (200), stop ATR period (14), stop and trail in ATR (3.0), trail the stop (true).
Display: show the info panel (true), show the UT Bot line and signals (true), light colours for white charts (false), panel position (top left), margins from the side and top (10 and 26 px), font size (9).
Questions
Can I use it on other symbols? It is designed and tested for XAUUSD. A trend rule on another market needs its own testing.
Why did it not trade this week? All three conditions must agree, about 17 times a year. The panel shows which filter is blocking and what is allowed now.
Does it need a VPS? The stop sits on the broker's server, but the terminal must be running for new trades and for the stop to trail. A VPS keeps it running when your computer is off.
Support and custom development
Questions and suggestions are welcome in the comments of this product or by private message on MQL5.
I also build custom Expert Advisors and indicators, and connect trading strategies to other platforms through their APIs. Send me a private message on MQL5, or order through the MQL5 Freelance service.
