Session RangeBreakout
- Experts
-
Sandip R Pawar
Professional software developer since 2007 turned full-time algorithmic trader. Specializing in custom automated infrastructure, data-driven market strategies, and precision execution across derivatives, XAUUSD, and crypto. - Versione: 1.0
- Attivazioni: 5
RB Gold is a quantitative, rule-based Session Range Breakout Expert Advisor engineered specifically for XAUUSD (Gold) and major volatility pairs.
Unlike 90% of Gold EAs that rely on risky grids, martingale, or averaging schemes that eventually blow accounts, RB Gold utilizes a 100% pure, single-shot price action approach. It identifies institutional liquidity consolidation during a customizable session window (default 00:00 to 05:00 GMT) and captures the high-momentum breakout that follows.
Every single trade is strictly protected by a physical Hard Stop Loss and a dynamic R-Multiple Take Profit target. The algorithm uses 100% Pure Single-Shot Execution — strictly No Grid, No Martingale, No Recovery, No Hedging, and No Overnight Swap.
Core Advantages & Features
-
Pure Price Action Breakout: Places precision Buy Stop and Sell Stop pending orders at a customizable percentage offset (default +5% of range width) outside the session high and low to filter out false tick pokes.
-
Smart Daily ATR(14) Volatility Filter: Measures yesterday's Daily ATR and automatically skips trading on days when the session range is abnormally flat/choppy (below 0.1x ATR) or already exhausted by news/pre-session spikes (above 0.8x ATR).
-
True OCO (One-Cancels-Other) Execution: As soon as one breakout direction triggers into an active position, the opposite pending order is immediately deleted to avoid dual-side exposure.
-
Dynamic R-Multiple Risk/Reward Engine: Calculates Stop Loss at the opposite range boundary and sets Take Profit dynamically in multiples of Risk (default 2.0 R = 1:2 Risk-to-Reward ratio).
-
Prop-Firm Friendly Risk Management: Choose between a Fixed Lot size or automatic % Balance Risk per Trade with built-in Free Margin and Broker Volume Limit protections.
-
Intraday Auto-Cancellation & Time Exit: Unfilled pending orders are automatically cancelled at your chosen GMT hour (default 15:00 GMT), and any remaining open trade is closed before the daily rollover (default 16:00 GMT) to avoid overnight swap fees, weekend risk, and widening spreads.
-
Visual On-Chart Blueprint & Status Dashboard: Draws the shaded Session Range Box, Buy/Sell Stop lines, and real-time broker/GMT timing status directly on your MT5 chart.
How the Strategy Works (The 4-Phase Daily Cycle)
-
Phase 1 — Session Range Mapping (00:00 – 05:00 GMT): The EA tracks the exact Highest High and Lowest Low of the session using M5 precision data, regardless of the timeframe you attach the chart to.
-
Phase 2 — ATR Volatility Validation (05:00 GMT): At the end of the session range, the EA compares the range width against the Daily ATR(14) filter. If the range is within 0.1x – 0.8x Daily ATR, the day is approved for trading.
-
Phase 3 — Pending Order Placement & OCO Management: Buy Stop and Sell Stop orders are placed with calculated lot sizes, SL, and TP. Once price breaks out and triggers one order, the opposite order is immediately cancelled.
-
Phase 4 — Intraday Cleanup (15:00 – 16:00 GMT): Unfilled orders are removed at 15:00 GMT, and open positions are closed cleanly at 16:00 GMT so your account starts fresh every trading day.
Input Parameters Guide
=== General Settings ===
-
InpMagicNumber (111111): Unique identifier for RB Gold orders so it never interferes with manual trades or other EAs.
-
InpMaxDeviation (30): Maximum allowed slippage in points during market order execution.
-
InpOrderComment (RB): Custom trade comment displayed in your MT5 trade history.
=== Session Times (GMT) ===
-
InpRangeStartGMT (0): Start hour of the consolidation range in GMT (0 to 23).
-
InpRangeEndGMT (5): End hour of the range and exact hour when breakout pending orders are placed (GMT).
-
InpCancelGMT (15): GMT hour to delete any unfilled pending orders if no breakout occurred.
-
InpCloseGMT (16): GMT hour to close any open trade intraday before market rollover.
-
InpBrokerOffset (2): Your broker's winter server time offset from GMT (usually +2 for most ECN brokers).
-
InpUSDaylight (true): Enable +1 hour adjustment during US/European Daylight Saving Time (DST) when your broker shifts to GMT+3.
=== Entry / Exit ===
-
InpStopDistPct (5.0): Buffer distance added above Range High and below Range Low (as a % of total range width) to filter out false tick pokes.
-
InpTakeProfitR (2.0): Take Profit distance measured as a multiple of the Stop Loss distance (e.g., 2.0 = 1:2 Risk-to-Reward).
=== Range Filter (Daily ATR) ===
-
InpUseATRFilter (true): Enables or disables the Daily ATR volatility filter.
-
InpATRPeriod (14): Averaging period for the Daily ATR indicator.
-
InpMinATRPct (0.1): Minimum required session range width as a fraction of Daily ATR (skips dead/flat markets).
-
InpMaxATRPct (0.8): Maximum allowed session range width as a fraction of Daily ATR (skips already-extended markets).
=== Money Management ===
-
InpRiskPct (1.0): Percentage of account balance risked per trade (active when Fixed Lot is set to 0).
-
InpFixedLot (0.01): Fixed lot size per trade. Set to 0.0 to activate automatic % Risk lot sizing.
-
InpMaxLot (5.0): Maximum safety cap on lot size per order.
=== Display & Alerts ===
-
InpShowDashboard (true): Displays the real-time status panel on the chart.
-
InpDrawRange (true): Draws the Session Range rectangle and Buy/Sell breakout levels.
-
InpPopupAlerts / InpPushNotify (false): Enables MT5 terminal pop-up alerts and mobile push notifications when orders are placed or closed.
Recommended Trading Conditions
-
Primary Symbol: XAUUSD / Gold (compatible with any broker suffix such as XAUUSDm, XAUUSD.raw, GOLD, etc.).
-
Timeframe: Attach to M1 or M5 chart (internal range calculation uses M5 bars automatically).
-
Account Type: ECN / Raw Spread account with low commission and fast execution.
-
Minimum Deposit: $100+ (with 0.01 fixed lot) or $500+ for dynamic percentage risk sizing (ideal for Prop Firm challenges).
-
VPS: A low-latency VPS is highly recommended for uninterrupted 24/5 execution.
Disclaimer: Algorithmic trading on financial markets carries risk. Always backtest and run on a demo account first to understand the broker server offset behavior and spread performance before going live.

