Gold Breakout Sentinel MT4
- Эксперты
-
Allan Aparece Ninal
Я разрабатываю индикаторы и советники (Expert Advisors) для MetaTrader 5.
Как я работаю:
- Каждый индикатор проверяется на перерисовку: сигналы определяются только на закрытых барах, а тест на каждом тике подтверждает, что они потом не меняются. - Версия: 1.20
Gold Breakout Sentinel MT4 is an Expert Advisor for MetaTrader 4 that trades XAUUSD on the H1 chart. It places pending stop orders at yesterday's high or low when a stochastic turn and a Bollinger Band filter agree. Every order has a fixed 0.01 lot and a fixed stop loss and take profit.
The EA trades gold only. It is a rules-based daily breakout system, not a profit promise. My own tests found no proven edge.
Built for gold. Gold is what this EA was designed and tested on,, and the tests cover only that setting. The tested setting is XAUUSD H1 with the default inputs. It will also trade other symbols, but in my tests the rules were not profitable on 36 others.
MetaTrader 4 edition: the same rule, panel and inputs as the MetaTrader 5 version. The rule passed the same criteria again in the MetaTrader 4 Strategy Tester; the numbers are below.
Quick start
- Enable AutoTrading and attach the EA to an XAUUSD H1 chart (XAUUSDm and XAUUSD.pro work).
- Keep the default inputs. They are the settings used for every check below.
- Read the panel. It shows what the EA is waiting for, and the Risk row shows what the next 0.01-lot trade risks at its stop.
- Try it first in the Strategy Tester or on a demo account.
Standalone: everything is built in. You do not need to buy or install any other product named on this page.
What you see on the chart
- An info panel: what the EA is waiting for, pending orders, the open trade and closed-trade results.
- Yesterday's high and low drawn across today, and an arrow at each signal with its outcome in the tooltip.
- A Risk row that shows what the next 0.01-lot trade risks at its stop, as a percent of your balance.
How the trade is built
- Once per H1 bar, the EA checks the stochastic signal line (closing prices). If it peaked on the previous bar and the Bollinger Band filter agrees, it places a buy stop at yesterday's high. If the line troughed, it places a sell stop at yesterday's low.
- The order is placed only while price has not passed that level. A new signal on the same side replaces it.
- Stop loss and take profit are each 1.9% of the entry price. No grid, no martingale, no averaging.
- An unfilled order is deleted after 9 bars. No new order is placed while a position is open.
- Yesterday is the New York-close day on any broker. The EA detects the broker clock itself.
Lot size and safety checks
Every trade uses 0.01 lot, or the broker's minimum where that is larger. Before each order it checks margin, stop and freeze levels and the stop-out level. If the account cannot carry the order, it skips it and shows the reason on the panel. At a gold price near 4,200 the stop on 0.01 lot loses about 80 USD. A balance of about 8,000 USD keeps the risk near 1% per trade. Smaller balances risk more, and the Risk row says so.
Who it is for / not for
For traders who want a transparent, rule-based gold breakout EA to run on a demo or small live account and watch. Not for anyone looking for a proven or promised result, other symbols, or lot sizing by risk.
Inputs
| Input | Default |
|---|---|
| Magic number | 260931 - ID of this EA's orders |
| Bollinger Bands period | 9 - band used by the filter |
| Stochastic %K / signal / slowing | 23 / 3 / 7 - the stochastic turn |
| Stop loss / take profit, % of entry price | 1.9 / 1.9 - distance of stop and target |
| Pending order expiry, bars | 9 - how long a stop order waits |
| Broker server clock / offset from UTC | Auto / 0 - the offset is used only with Fixed offset |
| Show info panel / show levels and signals | true / true |
| Dry run: alert each signal, open no trades | false – when on, no trade is opened; each signal is sent as an alert |
| Dry run: pop-up alert with sound | true – pop-up with sound; used only when dry run is on |
| Dry run: push to phone | true – needs your MetaQuotes ID; used only when dry run is on |
| Debug log for bug reports | false |
The defaults are the settings used for every check below. There is no set file. Attach the EA to an XAUUSD H1 chart and keep the defaults.
Use and limits
Enable AutoTrading and attach to an XAUUSD chart (XAUUSDm and XAUUSD.pro work). It also trades other symbols by default. In the Strategy Tester any symbol can be tested. It has no indicator buffers and sends no trade alerts. In dry run it sends signal alerts.
Automatic trading or signals only
By default the EA trades by itself: it opens each trade when its rule fires and manages the stop. If you prefer to decide each entry yourself, set "Dry run: alert each signal, open no trades" to true.
- With dry run on, the EA opens no trade and changes no stop. Each signal arrives as one alert with the direction, symbol, timeframe, price, stop-loss, take-profit (where the rule has one) and lot size the EA would have used.
- The alert is a pop-up with sound in the terminal and/or a push notification to your phone. Both are on when dry run is on; switch either one off in the inputs. Each signal is also written to the Experts log.
- You review the signal on your side and decide whether to enter by hand.
- For push on your phone: install the MetaTrader mobile app, find your MetaQuotes ID in its settings, and enter it in the terminal under Tools > Options > Notifications.
- In dry run the EA does not manage trades, including trades you open by hand.
- Dry run is off by default. In the Strategy Tester it only writes to the log.
How it was checked
- Code checks (MetaTrader 4 build 1.00): no error lines in validation-style runs. They covered EURUSD H1, XAUUSD D1, GBPJPY H1 and XAUUSD H1 with small and large accounts.
- MetaTrader 4 Strategy Tester: entries July 2023 to September 2026, every tick from 1-minute broker prices. The tester takes one fixed spread per run. So the period ran in two parts: 170 points to September 2025 and 20 points after, the typical gold spread in each part. 1700 of 1703 signals matched the Python model. 142 trades against its 139. A stop order fills on the first tick past its level, and that tick depends on the spread. So 82% of fills came within an hour of the model's, and the rest differ. Fills in MetaTrader 5 can differ in the same way. Average +0.22 R per trade (t 2.65), profit factor 1.56 in R, positive in both halves. A backtest, not live trading.
- Backtest (a Python reproduction of the rules, not a Strategy Tester run). Data: XAUUSD H1 broker history, January 2021 to October 2026, 0.01 lot, with spread, commission and swap. Result: 234 trades, profit factor 1.44. This was the most favourable period for these settings. Over 2009 to 2020 the same settings lost money (profit factor 0.94).
- On 36 other symbols, 2023 to 2026, the rules were not profitable. This is why the EA is built for gold.
How to test in the Strategy Tester
- Open the Strategy Tester (Ctrl+R, or View > Strategy Tester).
- Choose Expert Advisor, then Gold Breakout Sentinel MT4.
- Set Symbol and Period to those of the preset you want to test.
- Set Model to "Every tick", the model my tests used. It needs 1-minute history for the period.
- Tick Use date and choose a range, for example 2023.07.01 to 2026.10.01.
- Set Spread. My test used 170 points to September 2025 and 20 points from October 2025 on XAUUSD, as two separate runs.
- Click Expert properties. On the Testing tab, use a deposit close to your own account. On the Inputs tab, make the changes below.
- Click Start.
| Preset | Inputs to change from the defaults |
|---|---|
| XAUUSD H1 | None |
The default inputs already are the XAUUSD H1 preset, so that one needs no changes.
You can try other settings the same way. The tester ignores any live-only option, and a test of other settings is not a validated preset. A backtest describes the past only.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
Do not run this EA under a tool that closes trades at prop-firm limits. The EA does not read such a lock. After the tool closes its trades, the EA can open new ones and the tool closes them again. Rely on the EA's own stop loss and fixed lot instead.
| Product | How to use them together | Why |
|---|---|---|
| Prop Rules Monitor MT4 | Attach it to one chart of the account while the EA runs. | It shows your distance to a prop firm's limits. It only watches and never closes anything. |
| EA Health Monitor MT4 | Give the EA its own magic number in its inputs. Attach the monitor to one chart of the account. | It shows one row per magic number, so you can read this EA's trades on their own. |
Several gold Expert Advisors follow the same market. Running them together adds to one exposure; this is not a tested diversification.
Related products
- Gold Breakout Sentinel: the same Expert Advisor for MetaTrader 5.
- Gold Trend Sentinel MT4: a gold H4 trend-following EA with a trailing stop.
- Prior Day Breakout MT4: an EA that trades the break of the previous-day high or low on XAUEUR. It computes the levels itself.
- All my products on MQL5
Questions
Does it repaint? No. It acts on closed H1 bars.
Can I try it first? Yes, in the Strategy Tester and on a demo account.
Why did it not trade today? Most days have no signal, or price has passed yesterday's level. The panel shows why.
Can two trades be open at once? On a hedging account both stop orders can fill on a day that breaks both levels. No new order is added while a position is open.
How do I report a problem? Set Debug log for bug reports to true, repeat the problem, and send me the DBG lines from the Experts tab with the symbol, timeframe and inputs.
Reporting a bug or error
- In the inputs, set "Debug log for bug reports" to true.
- Leave the EA running until the problem happens.
- Open the Experts tab in the Terminal window (Ctrl+T), right-click in the log and choose Copy (or open the log folder from the same menu).
- Send it as a comment on this product page or as a LinkedIn message, with the symbol, timeframe, EA version and what you expected to happen.
The debug log never contains your login, name, server, balance or equity. Set it back to false afterwards.
If it helps your trading, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
Trading gold with leveraged products carries a high risk of loss, and past results do not predict future ones.
