Range Breakout Gold V2
- Uzmanlar
- AMS Trading
- Sürüm: 1.1
- Etkinleştirmeler: 5
================================================================
RANGE BREAKOUT GOLD V2
Daily Breakout Range Expert Advisor — Optimized for XAUUSD
================================================================
■ SHORT DESCRIPTION
----------------------------------------------------------------
Range Breakout Gold V2 — a fully automated daily breakout EA tuned
for XAUUSD. Defines the morning range, places OCO Buy Stop / Sell
Stop entries, manages risk per trade, and cleans up at end of day.
Multi-EA safe, restart safe, MT5 Market compliant.
■ FULL PRODUCT DESCRIPTION
================================================================
GOLD MOVES IN BURSTS. THIS EA TRADES THE BURST.
Range Breakout Gold V2 is a precision-engineered Expert Advisor
built around one of the most reliable price-action patterns on
XAUUSD: the daily session breakout. Gold consolidates during the
quiet hours, then explodes on London or New York liquidity. This
EA is designed to be in front of that move — automatically, with
strict risk control and zero discretion.
Every parameter is exposed as an input. Every input is optimizable
in the MT5 Strategy Tester. The default profile is tuned for Gold,
but the EA runs cleanly on any symbol you optimize for.
■ HOW IT WORKS
----------------------------------------------------------------
1. RANGE FORMATION
Between two user-defined server-time windows (default 03:00–
06:00), the EA records the highest high and lowest low. This
becomes the day's breakout range.
2. OCO BREAKOUT ENTRY
The instant the range closes, the EA places:
• One Buy Stop at range high + buffer
• One Sell Stop at range low − buffer
Whichever side fires first wins. The opposite order is
instantly deleted.
3. ONE TRADE PER DAY
Once a position opens, no further entries that day. Clean,
disciplined, no overtrading.
4. STOP LOSS & TAKE PROFIT
• SL is the opposite side of the measured range
• TP is a multiple of the range size (configurable)
• Set TP multiplier to 0 to let the trade run until the
end-of-day cleanup
5. END-OF-DAY CLEANUP
At a user-defined time (default 18:00), all pending orders
and open positions belonging to this EA are closed. No
weekend exposure, no overnight surprises.
■ WHY THIS WORKS ON GOLD
----------------------------------------------------------------
• Gold has well-defined session rhythm — Asian consolidation
followed by London/NY expansion
• High intraday range and trend persistence reward breakout
systems
• Daily cleanup avoids the spread-spike traps around rollover
• OCO logic captures direction without forecasting it
The EA is symbol-agnostic by design, but the default time
windows, buffer, and TP multiplier are calibrated for XAUUSD.
■ RISK MANAGEMENT
----------------------------------------------------------------
Two selectable risk modes:
• Fixed monetary risk — risk a constant cash amount per trade
• Percent of account balance — scales with your equity
Lot size is calculated from your stop distance and chosen risk
amount, then normalized to the broker's volume rules (min, max,
step). Free margin is validated before every order. Invalid
volume, distance, or margin = trade is skipped silently. No
runtime errors. No surprises.
■ FILTERS (ALL OPTIMIZER-FRIENDLY)
----------------------------------------------------------------
■ Maximum spread filter — block entries during wide spreads
■ Minimum range filter — skip days where the range is too tight
■ Weekday filter — independent on/off for each day of the week
■ Configurable buffer above/below the range
■ Configurable TP multiplier (0 = no TP, cleanup-only exit)
■ MULTI-EA SAFE
----------------------------------------------------------------
Every input includes a unique Magic Number. The EA only opens,
modifies, closes, or deletes positions and orders that carry
its Magic Number. You can run it alongside any other EAs on the
same account or even the same symbol without interference.
■ RESTART SAFE
----------------------------------------------------------------
If MetaTrader 5 restarts mid-session, the EA automatically:
• Detects whether today's range has already formed
• Re-reads existing pending orders and positions
• Knows whether a trade has already been taken today
• Knows whether cleanup has already run
• Restores chart visualization
No duplicate orders. No duplicate cleanup. No state files.
No external dependencies.
■ CHART VISUALIZATION
----------------------------------------------------------------
Each trading day, the EA draws on the chart:
• A rectangle covering the range window
• A horizontal line at the range high
• A horizontal line at the range low
• Lines extending until the daily cleanup time
Object names are unique per symbol, Magic Number, and date —
zero conflict with other EAs or manual drawings.
■ MT5 MARKET SAFETY (FULL COMPLIANCE)
----------------------------------------------------------------
■ Server time only — no terminal-time bugs
■ Modern MQL5 only — no deprecated MQL4 calls
■ No DLLs, no external EX5 imports, no internet calls
■ Validates SYMBOL_TRADE_STOPS_LEVEL on entry, SL, TP
■ Respects SYMBOL_TRADE_FREEZE_LEVEL on modify and delete
■ Validates Buy Stop above Ask, Sell Stop below Bid
■ Confirms sufficient price history before computing range
■ Confirms stop orders are allowed for the symbol
■ Free margin validated before every trade
■ Volume normalized to broker min / max / step
■ Invalid stops, invalid price, invalid volume — all guarded
■ Efficient on CPU and memory; no per-tick recomputation
■ INPUT PARAMETERS
----------------------------------------------------------------
Identification
• Magic Number
• Order comment
Session times (server time)
• Range start hour / minute
• Range end hour / minute
• Daily cleanup hour / minute
Breakout settings
• Buffer points above / below range
• Take Profit multiplier (0 = disabled)
• Minimum range size in points (0 = disabled)
• Maximum allowed spread in points (0 = disabled)
Risk management
• Risk mode (fixed cash / percent of balance)
• Risk amount in cash
• Risk percent
Weekday filter
• Independent toggle for Mon–Sun
Visualization
• Draw objects on/off
• Range, high-line, and low-line colors
• Line width
Execution
• Slippage tolerance in points
■ RECOMMENDED SETUP
----------------------------------------------------------------
Symbol: XAUUSD (also runs on Forex and indices after
re-optimization)
Timeframe: M15 (the EA computes the range from M1 internally;
the chart timeframe is for visualization only)
Account type: Hedging or netting — both supported
Leverage: 1:30 minimum recommended
Min deposit: $500 (with 1% risk and conservative lot sizing)
VPS: Recommended for consistent server-time execution
■ BEFORE YOU BUY
----------------------------------------------------------------
ALWAYS run the Strategy Tester on your broker's data before
going live. Spreads, stop levels, freeze levels, swap, and
execution speed differ from broker to broker. The EA was built
to handle these differences gracefully — but optimal inputs are
broker-specific.
Past performance does not guarantee future results. Trading
leveraged instruments such as Gold carries substantial risk.
Use risk settings you can sleep with.
■ SUPPORT
----------------------------------------------------------------
Questions, optimization help, or input templates for additional
brokers? Message via the MQL5 product page. Updates are free
for the lifetime of the product.
================================================================
RANGE BREAKOUT GOLD V2
Strategy you can read.
Risk you control.
Code that respects the rules.
================================================================
