Gold Level Breakout
- Experts
- Versione: 7.1
- Aggiornato: 11 novembre 2026
- Attivazioni: 10
Gold Level Breakout is an expert advisor for XAUUSD on MetaTrader 5. From version 7.00 it runs two parts on one M15 chart and one account: the breakout it has always traded, and a Swing Stop portfolio that trades from pending stop orders with up to 8 strategies at a time. Both parts are on by default.
Every order of both parts carries a stop loss from the start. No web request or allowed-URL setup.
THE BREAKOUT
It follows the structure gold is trading inside and stays flat while that structure holds. When price leaves it, the breakout waits for the market to come back before it commits. Many candidates never qualify. One entry per setup.
Risk is sized from the stop: 2% of balance per trade, half of that against the higher-timeframe trend.
R below is the distance from entry to stop. At +0.25R the stop moves to break-even. It then trails 1R behind the best price, and once a trade has reached +1R at least +0.25R stays locked. A trade closes when a bar of the signal timeframe (M15) closes at +2.5R, with a broker take profit at 5R as a backstop. If the bar that fills the order closes 0.75 ATR back past the entry, the trade closes on the next bar.
No new breakout setups from signal bars in server hours 0 and 1, or while the spread is above 60 cents or 15% of ATR. The breakout's own pause around US news is off.
THE SWING STOP PORTFOLIO
The portfolio holds 9 strategies. Once a day the balance decides how many are on: the first 2, 3, 7 or 8, depending on how many can each trade at least the minimum lot within the 30% sizing target described below. At most 8 are on at a time, so strategy 9 is never switched on and never places an order; no input changes that. The card shows this as, for example, "8 of 9 on".
The strategies that are on place buy stop and sell stop orders at swing levels. Each order carries its stop loss and take profit from the moment it is placed. Several trades can be open at once, also on the same side. Its trades use magic numbers 9201 to 9208 and the comments GLB S1 to GLB S8 (9209 would be strategy 9's).
Lots are sized for a 30% total drawdown target. This is a sizing target, not a stop: it closes nothing. Lots are sized from the highest balance reached, so they do not shrink during a drawdown.
It places no new orders from 19 December to 6 January. Around US NFP releases it closes its trades and deletes its orders 100 minutes before the release, and places none until 60 minutes after it. From each US CPI release it deletes its orders and places none for 30 minutes.
In every test window quoted below (both parts, 10,000 USD), strategies 1 to 8 traded. Strategy 9, never switched on, made no entry in any test.
On a netting account the Swing Stop switches itself off and the breakout runs alone. To run the breakout alone on any account, set "Run the Swing Stop portfolio" to false.
HOW THE TWO PARTS WORK TOGETHER
They share one balance, one equity and one margin. Each part sizes its lots from the balance, so the gains and losses of one change the lot size of the other.
Daily loss limit, 5%: no new breakout setups while equity is 5% or more below the day's start. It reads the account equity, so a floating loss of the Swing Stop counts. It does not stop the Swing Stop.
Account stop, 25%: when equity falls 25% below its peak, the breakout closes its trades and halts, and the Swing Stop closes its trades and orders and stays off. Manual trades and other EAs are not closed. Both parts stay off until you change any input and press OK, also after a restart. This is the only drawdown stop the Swing Stop has. With the breakout switched off there is no account stop and no status card.
CLOSE button: two clicks. The first arms it for 5 seconds. The second closes every trade and order on the account, manual trades and other EAs included, and pauses the Swing Stop until you change any input and press OK. Anything on a closed market or inside the broker's freeze level stays open, and the button stays for another try.
One status card shows both parts: the breakout's state (SCANNING, WAITING RETEST or IN TRADE) with its plan on the chart, and a Swing Stop section with its open trades, its stop orders and the account stop. Standard, Minimal and Expert views. Light theme by default, dark available.
Several charts: in one terminal, a second XAUUSD chart on the same account with the same magic number does not start. A second chart with another magic number runs its breakout only, and the Swing Stop stays on the first chart. Do not run another EA with magic numbers 9201 to 9209 on the account: the Swing Stop would treat its trades as its own.
TESTED RESULTS
All runs: IC Markets XAUUSD history, M15 chart, default inputs, 10,000 USD start. Spread only: commission is 0.00 in every report. Each line is its own run, from its own start. Drawdown is the tester's relative figure. Dates are the tester's From and To settings. To is not included, so the last day tested is the day before it.
Read the labels. The breakout's defaults were chosen on 2023.03.22 to 2026.07.17, and later checks of the breakout used data up to 2026.10.16. The Swing Stop's settings were fitted on December 2024 to October 2026. So every window before 2026.10.17 is in-sample for at least one part. Only the forward window, from 2026.10.17, was not used to choose or fit anything, and it lost money.
1-minute OHLC runs are shown without dollar figures: lots grow with the balance there, so the dollar sums of a long run say little. Profit factor, drawdown and trades are given instead.
Both parts on, the 7.00 defaults:
Forward, real ticks, 2026.10.17 to 2026.11.06, leverage 1:100: -311.58 USD (-3.12%), profit factor 0.67, 41 trades, equity drawdown 12.18%, balance drawdown 7.98%.
In-sample, real ticks, 2026.04.21 to 2026.10.16, leverage 1:500: +6,417.56 USD (+64.18%), profit factor 2.18, 326 trades, equity drawdown 12.04%, balance drawdown 8.13%.
Continuous, real ticks, 2026.04.21 to 2026.11.06, leverage 1:500, the in-sample window and then the forward window in one run: +5,938.44 USD (+59.38%), profit factor 1.83, 367 trades, equity drawdown 21.36%, balance drawdown 14.62%. At 1:100 it made the same trades (*).
In-sample, 1-minute OHLC, 2025.09.01 to 2026.07.17, leverage 1:500 (*): profit factor 5.17, 573 trades, equity drawdown 11.10%, balance drawdown 9.44%.
Before the Swing Stop's fit (inside the breakout's development window), 1-minute OHLC, 2023.03.22 to 2024.12.01, leverage 1:500 (*): profit factor 2.58, 1,401 trades, equity drawdown 17.51%, balance drawdown 13.09%. At 1:100 the same window made the same trades.
Mixed, 1-minute OHLC, 2023.03.22 to 2026.07.17, leverage 1:500, the breakout's development window, before and inside the Swing Stop's fit: profit factor 4.16, 2,622 trades, equity drawdown 24.05%, balance drawdown 21.01%.
(*) From an internal build with the same trading code. On every window where both ran, the 7.00 file made the same trades as that build.
The breakout alone ("Run the Swing Stop portfolio" false), leverage 1:100:
Forward, real ticks, 2026.10.17 to 2026.11.06: -131.77 USD (-1.32%), profit factor 0.02, 9 trades, equity drawdown 2.96%.
In-sample, real ticks, 2026.04.21 to 2026.10.16 (*): +329.56 USD (+3.30%), profit factor 1.17, 84 trades, equity drawdown 14.04%.
Development window, 1-minute OHLC, 2023.03.22 to 2026.07.17: profit factor 2.20, 594 trades, equity drawdown 9.24%.
For an account that charges commission, subtract your round-turn commission per lot times the lots closed: 1.85 lots in the forward run, 16.46 in the in-sample real-tick run, 19.79 in the continuous run (both parts on).
FORWARD TEST
The forward test counts the first 100 closed trades from 2026.10.17. Its lines were frozen on 2026.11.06 from data before 2026.10.17, after 41 of the 100 closes: review if the return is below +2.82% or the closed-balance drawdown above 8.14%; fail if the return is below -1.47% or the closed-balance drawdown above 12.67%. They are judged at 100 closes on the continuous run, with the fresh run beside it.
At 41 closes (2026.10.17 to 2026.11.06, both parts on, real ticks):
Fresh run from 10,000 USD: -3.12%, closed-balance drawdown 7.98%.
Continuous run, started 2026.04.21: -2.90% since 2026.10.17, closed-balance drawdown 8.64% since 2026.10.17.
Both returns are below both return lines. The continuous run's drawdown is already above the review line. These forward figures will be updated at 100 closes.
RISKS
Please read this before you buy, so the behaviour does not surprise you.
Stops can stack on one side in a fast move. On 2026.10.22, 14 Swing Stop sell stops filled within 153 seconds, from 08:44:37 to 08:47:10 server time, and gold then rose. 8 of them closed with small gains, +14.96 USD together. 6 closed at a loss, -715.87 USD together, 7.22% of the balance (fresh forward run). In the continuous run the same 6 lost 1,281.74 USD, 7.87% of the balance, the largest losing run in that report. That morning the daily loss limit also cancelled a waiting breakout order.
Largest equity drawdowns of the defaults: 21.36% on real ticks (continuous run) and 24.05% in 1-minute OHLC (2023.03.22 to 2026.07.17). Both are below the 25% account stop, which did not trigger in any of these runs.
The Swing Stop keeps its lot size through a drawdown, and the 25% account stop is its only drawdown stop.
Results depend on the market regime. The forward window lost money with both parts on and with the breakout alone.
Past test results do not guarantee future performance. Trading gold on margin carries a high risk of loss. Trade only with money you can afford to lose. Run it on a demo account first and satisfy yourself before going live.
SETUP
Symbol XAUUSD, one M15 chart.
A hedging account.
Recommended: at least 1,000 USD and leverage 1:100 or higher. What was measured: in a 2024 test at 500 USD (XAUUSD H1 chart, 1-minute OHLC, 1:100) only Swing Stop strategies 1 to 3 traded, and the breakout skipped 130 signals because 2% risk could not buy the minimum lot. In the same year at 1,000 USD on a D1 chart, strategies 1 to 6 traded and the breakout skipped 36 signals. Below 1:100 the Swing Stop makes fewer entries: in the continuous real-tick window it made 276 entries at 1:500 and at 1:100, 270 at 1:30 and 202 at 1:20 (*).
A broker with real tick volume.
An always-on terminal or a VPS, because the EA moves its stops itself.
INPUTS (23, with their defaults)
Strategies
Run the breakout (off: no dashboard on the chart): true
Run the Swing Stop portfolio (9 strategies, hedging account only): true
Breakout
Breakout: risk per trade, % of balance (all entries together): 2.0
Breakout: size lots from the risk % (false = use the fixed lot): true
Breakout: fixed lot per trade (all entries together): 0.04
Breakout: magic number (ID of its trades): 20260729
Breakout: signal timeframe (tested on M15): 15 Minutes
Breakout: maximum spread, cents: 60 = $0.60 (0 = off): 60
Breakout: maximum spread, share of ATR: 0.15 = 15% (0 = off): 0.15
Breakout: server hours with no new setups (empty = off): 0,1
Account protection
Daily loss limit, %: no new breakout setups while below it (0 = off): 5.0
Equity drawdown limit, %: closes both strategies' trades and halts (0 = off): 25.0
Swing Stop portfolio
Swing Stop: base magic (its 9 strategies use base+1 .. base+9): 9200
Swing Stop: lot sizing target, max total drawdown % (1 to 50): 30.0
Swing Stop: reset its sizing high-water mark to the balance (set back to false after one tick): false
Broker time
Broker GMT offset in winter, hours (tester; live it is detected): 2
Broker GMT offset in summer, hours (tester; live it is detected): 3
Display
Show the dashboard: true
Colour theme (with restyle off, follows the chart): Light: white chart, blue and white candles
Restyle this chart: candles, no grid, theme colours: true
Dashboard corner: Top left
Dashboard font size: 9
Dashboard size at start: Standard, Minimal or Expert: Standard
Every other setting of both parts is fixed at its tested default.
UPDATING FROM 6.50
On its next start after the update, the EA runs both parts on your chart (on a hedging account), so Swing Stop orders with magic numbers 9201 to 9208 appear beside the breakout. For the breakout alone, set "Run the Swing Stop portfolio" to false.
These 6.50 settings keep the value you saved: InpMagicNumber, InpRiskPct, InpUseRiskSizing, InpFixedLot, InpDailyLossPct, InpMaxDDPct, InpBlockedHours, InpMaxSpreadPoints, InpMaxSpreadATR, InpTimeframe, InpShowPanel, InpStyleChart, InpPanelCorner, InpPanelFontSize.
Every other 6.50 setting is no longer an input and returns to its default: ranges and which ranges may enter, tradable patterns, range geometry, the trend-regime and participation gates, the higher-timeframe trend filter, the breakout trigger, the Fibonacci retest entries, all exit settings, the stats log switch, and the chart drawing settings and colours. The selective profile described for version 6.48 is no longer available.
The breakout finds your open 6.50 trades by the same magic number and manages them under the 7.00 rules from the first tick.
A risk above 5% is accepted with a warning. A magic number inside 9200 to 9209 switches the Swing Stop off on that chart, with a warning. A halt that is in force when you update stays in force until you change any input and press OK.
TRY THE DEMO
In the Strategy Tester choose symbol XAUUSD, period M15, and a 10,000 USD deposit. Modelling "Every tick based on real ticks" matches the real-tick figures, where your broker keeps them. Modelling "1 minute OHLC" matches the 1-minute OHLC figures. Use the leverage and the From and To dates shown above. Visual mode shows the status card. Results on your broker's data will differ.
