Gold Brackets
- Experts
- Versione: 1.0
- Attivazioni: 20
Gold Brackets is built on one idea about gold: price that comes back to a swing high or low which has stood unbroken often goes through it with force, and a stop order waiting at the level catches that move without chasing it. The EA places the pending order ahead of time, with the stop loss and the take profit already attached, and cancels it when the level stops being valid.
The Swing Level
Every rule set looks at hourly bars for the nearest swing high and swing low: a bar whose high (or low) stands above (or below) a set number of bars before it, and which no later bar has broken. The swing must also be old enough and not too old; a rule set ignores the freshest hours and the oldest ones, so it works with a level the market has already had time to test.
The order is placed a little in front of the level, at a distance that grows with the price, so it fills as price arrives rather than after price has gone through. A buy stop belongs to a swing high above the market, a sell stop to a swing low below it. If a swing is used by a trade, the rule set moves on to the next standing swing and does not place a second order on the same level.
Five Rule Sets
Five rule sets run on one chart, labelled A to E in the order comments. Each has its own magic number built from the base number, its own timing for how often it looks at the market, how long an order stays alive and how deep it reads the history. Each rule set keeps at most one pending order per side and places nothing on a side where its own position is open. Rule set E re-arms its level after a stopped trade and leaves it spent after a trade closed in plus. Every rule set has its own switch.
Managing A Position
The stop loss is 20 gold pips (2.00 in price). The take profit is 140 gold pips (14.00 in price) for rule set B and 150 (15.00) for the others. Both reach the broker together with the order.
A peak lock follows the position after the fill. Once the open result of the position has reached 1.00 of account currency per 0.01 lot, the EA remembers the peak and closes the whole position at market when the open result falls back to half of it. The lock lives in the EA and needs a running terminal. Four profiles are available: a plain share of the peak or a share that grows from 35 to 50 percent, each with or without a spike filter that holds the exit for a moment when the spread widens sharply. Three protection modes decide whether the broker stop is kept fixed, moved, or the broker trailing is used alone, and a manual break-even and trailing set can replace the lock.
News, Weekend And Spread
NFP, CPI and FOMC have their own windows and the EA does not trade through them: NFP and CPI from 30 minutes before to 60 minutes after, FOMC from 60 minutes before to 150 minutes after. Pending orders are deleted when a window opens. The dates come from the official calendars built into the EA through the end of 2026, and from the terminal's economic calendar as well, and they are converted to the broker's server time in the tester and on a live account. A separate general news filter by impact is available and switched off.
The weekend guard is on: no new entries and no pending orders from four hours before the Friday close until four hours after the weekly open, taken from the symbol's trading sessions. A pending order never outlives the Friday cut-off. An optional filter pauses entries and clears pending orders when the spread is wide, and an optional daily entry-hours window is available.
Position Size
The lot mode is a setting: fixed lot, risk of 1 percent or 2 percent of the balance per order, a custom percent, or a fixed lot that is raised in steps you choose as the balance rises. The default is the fixed lot 0.01. A cap for the largest lot in the risk modes is available. An optional daily loss limit and a challenge mode with a target level, a daily loss limit and a total drawdown limit for prop-firm style accounts are included and switched off. Slippage of every fill is measured and rated on the panel.
Strategy Tester Figures
Strategy Tester, XAUUSD, 100% real ticks, the period 2026.05.04 - 2026.11.04, starting deposit 1000, leverage 1:500, every input at the value the EA ships with: fixed lot 0.01, all five rule sets on, news and weekend guards on. 434 trades, 76.27% of them positive.
The tester fills a stop order at its price. To show what a broker adds, the same period was run with the tester delaying the EA's actions by 300 ms and by 1000 ms, and slippage taken from the forward execution log of another expert on a demo account at the same broker (21 days, 149 entries, 93 stop exits) was added on top of the report: to the entries in the two delay rows, to the entries and the stop exits in the last row. With a delay the tester reports a higher result before any slippage is added, so the two delay rows show the result after slippage and are not the price of the delay. All amounts are in USD and in percent of the 1000 deposit.
- tester, no delay, no slippage added: net result 625.16 (62.5%), ratio of gross positive to gross negative 3.68, largest balance drawdown 20.39 (2.0%)
- 300 ms delay, slippage added to entries: net result 595.20 (59.5%), largest balance drawdown 35.21 (3.5%)
- 1000 ms delay, slippage added to entries: net result 568.61 (56.9%), largest balance drawdown 39.36 (3.9%)
- no delay, slippage added to entries and stop exits at the highest cost among the combinations that were run: net result 388.90 (38.9%), largest balance drawdown 47.04 (4.7%), 63.57 (6.4%) at the 95th percentile
Largest equity drawdown in the tester report: 23.41 (2.3%) with no delay, 28.32 (2.8%) at 300 ms and 31.92 (3.2%) at 1000 ms.
What It Needs
XAUUSD on a hedging account; on a netting account the EA does not start. The chart timeframe does not matter, the rule sets read hourly bars themselves. A tight spread on gold matters, because the stop is only 2.00 in price. The EA uses gold pips of 0.10 in price and is meant for gold quoted with two digits. Keep the terminal running: the peak lock, the pending-order expiry and the news windows are handled by the EA. Algorithmic trading must be allowed. A VPS is recommended.
Settings
The inputs are grouped: position size and risk, stop loss and exit protection, take profit targets, the five rule set switches, the magic number, entry hours, the weekend guard, NFP, CPI and FOMC windows, the general news filter, the spread guard, the daily loss limit, challenge mode, the lot step-up, order comments, slippage measurement and the panel. The panel on the chart shows the status, the open positions and the slippage rating.
Questions
If something does not work as described, send a private message on mql5.com. Please include your broker, the server time shown in the terminal and the set file you use.
