XAU Break Of Structure
- Experts
- Versione: 2.33
- Aggiornato: 23 novembre 2026
- Attivazioni: 5
Gold BOS Pro is an automated MetaTrader 5 Expert Advisor designed around trend-aligned Break of Structure (BOS) breakouts with multi-timeframe momentum confirmation. It is built primarily for XAUUSD (Gold) and also works on other liquid instruments, offering three distinct trade management modes and a simplified, easy-to-configure parameter layout.
HOW THE STRATEGY WORKS
The Expert Advisor combines trend direction, price-action breakout detection, and multi-timeframe filtering before opening a trade:
1. Signal Algorithms (Selectable)
- Classic 3-Candle BOS: Identifies a structured 3-candle pullback formation aligned with the EMA trend (default 200 EMA) that meets a minimum candle range in pips. Once formed, the EA arms a breakout level at the 3-candle high (for buys) or low (for sells) and enters on a confirmed closed-bar breakout.
- Swing Breakout BOS: Detects recent confirmed swing highs and lows and triggers entries when a candle closes beyond the latest swing pivot.
2. Multi-Timeframe Entry Filters
To filter out low-quality breakouts, initial entries are confirmed using:
- Trend Filter: Exponential Moving Average (EMA) on the selected signal timeframe.
- Momentum Filter (H1 RSI): Prevents buying into overbought conditions and selling into oversold conditions.
- Volatility/Direction Filter (M15 CCI): Confirms directional momentum on the M15 timeframe before entry.
TRADE MANAGEMENT MODES
You can choose the risk and management structure that fits your trading style:
1. Normal (SL and TP)
Trades one position at a time with a broker-side Stop Loss and Take Profit on every order. No grid or martingale logic is used in this mode.
2. Loss Recovery (Next Signal)
Trades one position at a time with individual Stop Loss and Take Profit. If a trade closes at Stop Loss, the EA waits for the next valid BOS signal and adjusts the lot size according to your selected progression (Same Lot, Add Lot Step, or Multiply Lot). Lot sizing resets to the base lot once Take Profit is hit or full cycle recovery is achieved, depending on your setting.
3. Averaging Grid (No SL)
Opens the initial position on a valid BOS signal without an individual Stop Loss. If price moves adversely by the configured Averaging Step (in points), the EA adds positions in the same direction and closes the entire basket when net floating profit (accounting for known entry commissions and fees) reaches the Averaging Profit Target. Note: This mode requires a Hedging account and Fixed Lot mode.
LOT SIZING, STOP LOSS AND TAKE PROFIT
- Lot Sizing: Choose between Fixed Lot (validated strictly against broker volume step and limits) or Risk % of Equity (automatically calculates lot size based on account equity and Stop Loss distance in Normal and Loss Recovery modes).
- Stop Loss Options: ATR-based dynamic Stop Loss, Fixed Points Stop Loss, or Candle High/Low structure Stop Loss.
- Take Profit Options: Risk-Reward Ratio (R-Multiple based on Stop Loss distance) or Fixed Points.
EXECUTION SAFEGUARDS AND CHART TOOLS
- Broker Preflight Validation: Checks margin availability, broker stop levels, filling policy (FOK/IOC/Return), and runs OrderCheck before submitting orders.
- Crash and Restart Safety: Persists active breakout levels, pending order state, and recovery tracking across terminal restarts to prevent duplicate order execution.
- Instance Isolation: Built-in lock per Account, Magic Number, and Symbol prevents accidental duplicate EA runs.
- On-Chart Visibility: Clean info panel showing live account mode, open trades, total lots, floating P/L, spread, active Buy/Sell breakout levels, and status updates, along with horizontal entry lines on the chart.
- CSV Trade Journal: Automatically logs signals, order execution events, and blocked entry reasons in the MQL5 Common Files folder.
INPUT PARAMETERS
1. General Settings
- Magic Number: Unique identifier to separate this EA's trades from other EAs or charts.
- Timeframe: Timeframe used for BOS signal detection (Current chart timeframe or a fixed timeframe).
- Signal Type: Select Classic 3-Candle BOS or Swing Breakout BOS.
2. Signal Settings
- EMA Trend Period: Period for the trend-direction EMA (default: 200).
- Min Candle Range (Pips): Minimum 3-candle height required to arm a Classic BOS level.
- H1 RSI Period: Period for the H1 RSI confirmation filter.
- RSI Max for Buy / RSI Min for Sell: Upper/lower RSI thresholds for buy and sell entries.
- M15 CCI Period: Period for the M15 CCI confirmation filter.
- CCI Buy Level / CCI Sell Level: Minimum/maximum CCI thresholds for buy and sell entries.
3. Lot and Stop Loss Settings
- Lot Size Type: Fixed Lot or Risk % of Equity.
- Starting Lot: Base lot size for Fixed Lot mode and recovery/grid sequences.
- Risk % per Trade: Percentage of account equity risked per trade (when using Risk % mode).
- Stop Loss Type: ATR Stop Loss, Fixed Points SL, or Candle High/Low SL.
- ATR Stop Multiplier: Multiplier applied to 14-period ATR when using ATR Stop Loss.
- Fixed Stop Loss (Points): Stop Loss distance in broker points when using Fixed Points SL.
4. Take Profit and Trade Mode
- Trade Mode: Normal (SL and TP), Loss Recovery (Next Signal), or Averaging Grid (No SL).
- Take Profit Type: Risk-Reward Ratio or Fixed Points.
- Risk-Reward Ratio (TP): Target multiplier relative to Stop Loss distance.
- Fixed Take Profit (Points): Take Profit distance in broker points.
- Recovery / Grid Lot Type: Same Lot, Add Lot Step, or Multiply Lot.
- Add Lot Step: Lot increment per step in Add Lot Step mode.
- Lot Multiplier: Lot multiplier per step in Multiply Lot mode.
- Reset Lot After: Choose whether Loss Recovery resets on Take Profit Hit or Full Profit Recovery.
- Averaging Step (Points): Adverse price distance in points before adding a new grid leg.
- Averaging Profit Target (Money): Net basket profit target in account currency to close all grid positions.
5. Chart Display
- Show Info Panel: Enable or disable the on-chart dashboard.
- Show Entry Lines: Display active Buy and Sell breakout level lines on the chart.
REQUIREMENTS AND RECOMMENDATIONS
- Platform: MetaTrader 5 (MT5).
- Account Type: Hedging or Netting for Normal and Loss Recovery modes; Hedging account required for Averaging Grid mode.
- Symbol: Primarily designed for XAUUSD (Gold); verify broker point size, minimum stop distance, and lot step before live deployment.
- Changing Trade Mode or Lot settings: Always start with no open trades and assign a new Magic Number when switching management modes or lot progression rules.
- VPS: Recommended for uninterrupted 24/5 execution and timely basket/order management.
RISK DISCLAIMER
Trading foreign exchange and metals on margin carries a high level of risk and may not be suitable for all investors. Past performance or Strategy Tester results do not guarantee future performance. Loss Recovery and Averaging Grid modes can significantly increase drawdown during strong trending markets because they do not enforce built-in maximum lot or equity drawdown caps. Always test thoroughly on a Demo account before trading with real funds.
