Gold Price Box Breakout
- Experts
- Versione: 1.0
- Attivazioni: 5
Gold Price Box Breakout is an Expert Advisor built and tested for GOLD (XAUUSD) only.
It does not use indicators or candlestick patterns. It reads price itself.
HOW IT WORKS
1. Find the price box
The EA looks back from the current price and finds the largest recent area that price stayed inside. The box must be between 0.56% and 1.94% of price wide (for example, about $20 to $70 when gold is at $3,600).
2. Require a respected range
The box only counts if price was rejected at BOTH edges at least 3 times. A touch counts when price comes close to the edge. The next touch only counts after price has moved away again. A box that buyers and sellers have defended several times is a level the market cares about.
3. Trade the breakout
When price breaks out of the box, the EA enters in that direction:
- Stop loss: the far side of the box.
- Break-even: the stop moves to entry once the trade is 1R in profit.
- Take profit: 4R. R is the distance from entry to the stop loss.
4. One trade per box
Each box is traded once. After a stop loss, the opposite direction is blocked for one M15 bar to avoid whipsaws.
All sizes are a percentage of price, so the EA adapts as the gold price changes. The same settings traded in 2023 with gold near $2,000 and in 2026 with gold above $3,500.
BACKTEST RESULTS (GOLD, $1,000 deposit, 1% risk per trade)
Jan 2023 - Nov 2026, 1-minute OHLC data:
- Net profit: +$1,574 (+157%)
- Profit factor: 2.57
- Maximum equity drawdown: 7.6%
- Trades: 189 (about 4 per month)
- Largest loss: -$23.79. Largest win: +$95.82. Most losses in a row: 4.
- Every calendar year was profitable: 2023 +$177 (profit factor 2.77), 2024 +$170 (2.07), 2025 +$468 (2.49), 2026 to Nov 19 +$760 (2.77).
- 11 of 44 trading months closed with a loss.
Oct 2025 - Nov 2026, every real tick:
- Net profit: +$382
- Profit factor: 2.33
- Maximum equity drawdown: 6.8%
- Trades: 85. 31% closed in profit; the rest were mostly small break-even exits (average loss -$4.88).
- Most losses in a row: 11, totalling -$64. Most were break-even exits that the spread turned into small losses.
The settings were chosen by tuning on 2023 - Sep 2025 and checking on Oct 2025 - Nov 2026, using settings from a stable region rather than the single best result.
Past backtest results do not guarantee future results.
WHAT TO EXPECT
- Few trades, around 3 to 6 per month. Expect quiet weeks with no trades.
- Many trades end at break-even. The profit comes from a smaller number of trades that run to 4R.
- Losing months happen. Long series of small losses are normal: in the real-tick test, 11 losses in a row cost about 6% of the account.
RECOMMENDED SETUP
- Symbol: GOLD / XAUUSD, any suffix your broker uses.
- Chart: M15. The EA reads M1 price data internally, so the chart timeframe does not change its trades.
- Risk: 1% per trade (default).
- Account: any account type, hedging or netting. A low-spread account is better.
- Minimum balance: about $3,000 at 1% risk if your broker's minimum lot is 0.01. With a smaller balance, the minimum lot would risk more than twice your chosen %, so the EA skips those trades and tells you why. Brokers that allow lots smaller than 0.01 can run it on smaller balances.
- VPS: recommended, so the EA can manage break-even 24/5.
- One chart only per account. If you run it on more than one chart, give each a different magic number.
SAFETY FEATURES
- Every trade has a stop loss and a take profit from the moment it opens.
- No martingale, no grid, no averaging, and no adding to losing trades.
- Never more than one open trade.
- Before every order it checks free margin, the broker's minimum and maximum lot size, the minimum stop distance, and that trading is allowed and the market is in session.
- If the balance is too small for the chosen risk, it skips the trade and says why. It never increases risk to force a trade.
- After a terminal restart, it picks up its open trade again correctly.
- On the chart it shows the current box and its status.
INPUTS
Price box (% of price)
- Min box width, % of price: 0.556
- Max box width, % of price: 1.944
- Max minutes of price to search back: 720
- Rejections needed at each edge: 3
- Within this % of an edge = touch: 0.0556
- % price must leave an edge before the next touch counts: 0.139
Trade management
- Block the opposite direction for N M15 bars after a stop loss: 1
- Move the stop to entry at this many R in profit (0 = off): 1.0
- Take profit in R: 4.0
Position size
- Lot mode: risk % or fixed lot
- Risk per trade, % of balance: 1.0 (allowed range 0 to 10)
- Fixed lot: 0.01
Other
- Magic number: 240129
- Max slippage, points: 30
- Show box and status on chart: true
GOLD ONLY
This EA is designed, tuned and tested for GOLD (XAUUSD) only. It runs on other symbols without errors, but its settings have not been tested there, and I do not recommend using it on them.
RISK WARNING
Trading gold carries a high level of risk and may not be suitable for everyone. Test the EA on a demo account first, and only trade money you can afford to lose.
