Gold Break EA
- Experts
- Versione: 1.4
- Attivazioni: 10
Gold Break EA is a breakout robot written for XAUUSD. It trades a bar that closes beyond the range of the previous bars, but only when the EMA trend on the working timeframe points the same way. IDEA BEHIND THE ROBOT Gold produces large intrabar noise, so a fixed stop distance either gets hit by noise or makes the position too small to matter. This robot sizes the stop from the current ATR instead. The stop is proportional to volatility in quiet and in fast markets alike, and the position size is reduced automatically when the stop is wide, so the money at risk stays constant. ENTRY LOGIC The trend is defined by two exponential moving averages on the working timeframe, 50 and 200 by default. A long is taken when the last closed bar closes above the highest high of the previous 20 bars and the fast EMA is above the slow EMA. A short is the mirror condition. Entries are market orders, and the stop loss and take profit are attached to the order at creation, so a position can never be left without a stop. EXIT LOGIC The stop is placed at the ATR multiplied by a factor, 2.0 by default. The target is a multiple of that stop distance, 2R by default. Two optional tools manage the trade afterwards: the stop moves to breakeven when the position is one R in profit, and an ATR trailing stop follows price when it is enabled. When a new break appears in the opposite direction, the open position is closed. POSITION SIZING Volume is calculated from a percentage of the account balance and the actual stop distance, using the symbol tick value, with a contract size fallback when a broker does not publish a tick value. The result is rounded to the symbol volume step and limited by the symbol minimum and maximum volume. RISK CONTROLS Maximum number of own positions on the symbol. Cap on margin as a fraction of free margin. Optional maximum spread filter. Optional trading session with a Friday cut-off. Optional daily loss stop. A protective check closes any position of this robot that is found without a stop loss. There is no martingale, no grid, no averaging and no recovery mode. RECOMMENDED SETUP Symbol: XAUUSD, or the gold symbol of your broker. Timeframe: H1. The robot works on the symbol it is attached to and does not open trades on other symbols. Deposits from 1000 USD are workable with the default risk of 0.5 percent per trade. INPUTS Identity: magic number, order comment, enable trading, verbose logging. Signal: working timeframe, breakout lookback in bars, fast and slow EMA periods, trend filter on or off. Exits: ATR period, stop distance in ATR, target as R multiple, breakeven on or off with its trigger and offset, ATR trailing on or off with its distance, close on opposite break. Risk guards: risk per trade in percent, margin cap, maximum spread in points, maximum positions, stop enforcement, daily loss stop in percent. Session: session restriction on or off, start and end hour in server time, Friday trading and Friday cut-off hour. Every distance is expressed in ATR or in R, so the defaults do not need to be recalculated for a broker with different digits or point size. BACKTEST SUMMARY The figures below are backtest results from the MetaTrader 5 Strategy Tester. They are not live trading results and they describe one broker's gold history only. XAUUSD, H1, modelling 1 minute OHLC, deposit 10000, risk 0.5 percent per trade, default inputs, no optimization. 2025.01.05 to 2026.05.31: 246 trades, profit +1979.04, profit factor 1.43, maximum drawdown 7.03 percent. 2026.06.01 to 2026.11.27: 82 trades, profit +497.64, profit factor 1.39, maximum drawdown 2.16 percent. Past performance and backtest results do not guarantee future results. A forward test on a demo account is recommended before using the robot on a live account. NOTES On a three digit gold symbol a spread of 0.20 is 200 points, so the maximum spread filter is disabled by default. If you enable it, set a value that matches your broker. On accounts where the configured risk percentage results in less than the minimum lot, the robot trades the minimum lot and writes a warning to the journal. In that case the real risk per trade is higher than the configured percentage. The robot does not use DLL, does not read files, does not send data outside the terminal, and does not depend on the account number, the broker name or the server name. RISK WARNING Trading leveraged instruments involves substantial risk of loss. This robot implements a trading logic; it does not promise profit and it cannot guarantee profit. Test it on a demo account and use a risk per trade you can afford.
