SLab Gold Breakout Trend
- Uzmanlar
- Sürüm: 1.4
- Etkinleştirmeler: 10
SLab Gold Breakout Trend
Gold breakout Expert Advisor with a 20-day channel and a daily trend module. Stop loss on every trade, no grid, one risk-level setting.
Overview
SLab Gold Breakout Trend is an Expert Advisor for Gold (XAUUSD, GOLD and similar) on MetaTrader 5. It runs two independent strategies from one chart. Every trade has a stop loss from the start. The EA does not use grid, martingale or averaging.
- 20-day breakout (main strategy). Each day the EA places a buy stop order at the highest price of the last 20 days and a sell stop order at the lowest price, with at most one entry per direction per day. The stop loss is half of the average daily range (average true range, 14 days). A trailing stop follows the best price at the same distance. Positions are closed on the 5th trading day if still open. Long and short trades are handled independently.
- Keltner channel, daily. Enters when the daily close crosses a channel around the 27-day exponential moving average (1.08 times the average daily range). Stop loss 1.44 times the average daily range, target 3 times the initial risk, trailing stop, maximum 12 days. This strategy can be switched off.
The 20-day breakout rules were written down before testing and are fixed in the code. In a comparison test this EA produced the same trades as the EA used during development (447 of 447 trades, 2019–2026). Updates only fix errors or broker compatibility.
Risk level setting
The main input is Risk level. It sets the risk per trade, and the protection limits are applied automatically with the values that were tested. The default is low on purpose.
| Risk level | Starting balance | Maximum equity drawdown (backtest) | Lowest year (backtest) |
|---|---|---|---|
| 0.25% (default) | $50,000 | 4.0% | −0.7% |
| 0.5% | $50,000 | 7.8% | −1.4% |
| 1.0% | $50,000 | 15.2% | −3.0% |
| 1.0% | $15,000 | 15.5% | −3.1% |
Custom mode lets you set your own values; the panel then shows "DIFFERS from tested". The Strategy Tester and live charts use the same lot calculation.
Account protection
- Daily loss limit 3%: no new entries for the rest of the day
- Drawdown from the equity peak 20%: new entries stop until you press RESUME
- Hard drawdown limit 30%: the EA stops; closing all positions is optional
- Limit on the total risk of open positions and pending orders in the same direction (1%, 2% or 4% by risk level)
- Pending orders are removed when protection blocks new entries
- A trade is skipped if the minimum lot would exceed twice the intended risk
- Requests are not sent when the broker would reject them (market closed, margin, stop level, freeze level); the EA tries again later
Backtest results and limitations
Backtest on XM price data, 2019-01 to 2026-11, $50,000, default 0.25% risk, "1 minute OHLC" model: the balance went from $50,000 to $67,939, profit factor 1.74 (gross profit divided by gross loss), 537 trades, one small losing year (2022: −0.7%).
These are backtest results, not live trading results. The strategies were selected on the 2019–2026 period. Backtest results before this period (price data from another broker, same rules):
- 20-day breakout, 2006–2016: positive in 9 of 11 years, total profit 75.8 times the risk per trade. In the 2008 gold decline (March–November 2008) the result was positive (profit factor 3.34). In the 2011–2015 gold decline it was also positive (profit factor 1.34), mostly from short trades.
- Keltner channel: negative in 2015–2018 (profit factor 0.44, 27 trades) and about break-even in 2011–2015 (profit factor 1.03). It is included because it was positive in 2019–2026 and trades differently from the breakout. Most of the long-term result is expected to come from the 20-day breakout, which can be run alone.
Future results are expected to be lower than this backtest. Losing months and losing years are possible.
Broker time
Daily highs and lows, the average daily range, the trading-day count and the time exit use daily bars built from 1-hour bars at 17:00 New York time, so they do not depend on the broker's server time. Running the same price data with two different server time settings produced the same trades for both strategies.
Forward test
The 20-day breakout has been running on a separate demo account. The forward test of the complete product is in progress.
Requirements
- Hedging account (the breakout can hold a long and a short position at the same time). On a netting account only the Keltner channel strategy runs.
- Intended symbol: Gold. Attach to one chart; any timeframe. Close-only gold symbols are detected and the EA waits. The EA also runs on other symbols, but they were not tested and the panel shows "UNTESTED SYMBOL".
- Balance: recommended $50,000 at 0.25% risk, or about $15,000 at 1.0%. The minimum lot for gold is large for small accounts; the EA skips trades that would exceed the intended risk.
How to start
- Test the free demo in the Strategy Tester: a Gold symbol, 1-hour chart, "1 minute OHLC" or "Every tick based on real ticks", from 2019, Risk level 0.25%.
- Attach the EA to one Gold chart on a hedging account. Choose the Risk level and keep Server time zone at Auto.
- Check the panel: symbol, "hedging account", Risk level and Limits.
- Start on a demo account. For installation or broker questions, contact me through MQL5 messages.
Risk notice
Trading leveraged products involves a high risk of loss. Losses, drawdowns and periods without trades are normal; a breakout system can wait several weeks between trades. Live results depend on spread, swap, slippage and broker execution. All figures on this page are backtest results and do not guarantee future returns. Use only money you can afford to lose.
