Gold Regime Shift EA
- Experts
- Andreas Smigadis
- Versione: 1.0
- Attivazioni: 5
Overview
Gold Regime Shift EA is an automated Expert Advisor for MetaTrader 4 designed for XAUUSD (Gold) on the M30 timeframe.
It detects volatility expansion and potential “regime shift” conditions using two Bollinger Band frameworks.
When the rules confirm directional alignment, the EA places stop orders to participate in the move.
The EA is designed without martingale and without grid-style averaging.
What the EA Does
The EA monitors XAUUSD M30 and evaluates price behavior against two Bollinger Bands: a faster band and a slower confirmation band.
A long setup is considered when the rules indicate price migration above the selected band structure with confirmation from the higher-period band.
A short setup is considered using symmetrical conditions to the downside.
When a setup is valid, the EA places a pending stop order aligned with the detected direction.
Trades are managed with fixed Stop Loss and Take Profit, and an optional time-based exit can close positions after a defined number of bars.
Key Features
-
Designed for XAUUSD (Gold) on M30 (MT4)
-
Dual Bollinger Band regime detection (volatility expansion and band migration rules)
-
Stop-order entries aligned with the detected direction
-
Fixed SL/TP applied at entry
-
Time-based safeguard: optional exit after a set number of bars
-
Duplicate protection using MagicNumber
-
No martingale and no grid-style averaging
Risk Management & Safety Notes
Trading involves risk, and losses are possible.
This EA does not guarantee results and is not financial advice.
Gold can be volatile and may experience spread widening, slippage, and gaps, especially during major events.
Pending orders can be rejected if broker stop levels/freeze levels or trading conditions do not allow the requested placement.
StopLoss/TakeProfit and ExitAfterBars should be evaluated for your broker’s XAUUSD contract specifications (digits, tick value, margin).
Always test in Strategy Tester (historical simulation) and then on a demo account before any live use.
Inputs
Trading
-
MagicNumber: unique identifier for EA orders
-
RiskPercent or FixedLot: position sizing mode (depending on build)
Orders & Exits
-
StopLoss (points)
-
TakeProfit (points)
-
ExitAfterBars: time-based exit limit for open positions
-
Pending order rules and validity behavior (as implemented)
Setup
-
Install the EA in MT4 (MQL4/Experts) and restart the terminal (or refresh the Navigator).
-
Open an XAUUSD chart (broker suffixes may apply) and set timeframe to M30.
-
Attach the EA to the chart and enable AutoTrading.
-
Set MagicNumber (recommended if running multiple EAs).
-
Configure RiskPercent/FixedLot and set StopLoss/TakeProfit conservatively for initial testing.
-
If using ExitAfterBars, set a value that matches your intended holding window.
-
Check the Experts/Journal tabs for any broker restriction messages (stop level, trading hours, margin).
Recommended Evaluation
Run Strategy Tester as a historical simulation on your broker’s XAUUSD symbol and data.
Confirm pending order placement, SL/TP application, and the ExitAfterBars behavior.
Forward-test on a demo account to observe real-time execution effects (spread changes, slippage, order acceptance).
Evaluate across different volatility regimes rather than a short date window.
Adjust one group of inputs at a time (sizing, then exits, then time safeguard).
Compatibility
Platform: MetaTrader 4 (MT4).
Symbol: XAUUSD (Gold). Broker symbol names may include suffixes (e.g., XAUUSDm).
Timeframe: intended for M30.
Broker conditions (spread, execution, stop levels) can affect behavior.
FAQ
Q: Does it use martingale or a grid?
A: No. It is designed without martingale and without grid-style averaging.
Q: Why didn’t it place any orders?
A: Check AutoTrading, symbol trading permissions, and whether the regime conditions were met. Broker stop-level rules can also prevent certain pending order placements.
Q: What does ExitAfterBars do?
A: It can close an open position after a defined number of bars to limit prolonged exposure.
Q: Can I use it on other timeframes or symbols?
A: It is intended for XAUUSD on M30. Other setups require your own testing and parameter review.
Q: Does it need a VPS?
A: A VPS is optional, but uninterrupted operation can help maintain consistent order management.
Q: Where can I get support?
A: Support is provided via MQL5 comments or MQL5 messages only.
Changelog
-
Please refer to the Market “Versions” tab for the full version history.
