Gold trending miner
- Uzmanlar
- Quoc Huy Do
- Sürüm: 5.0
- Güncellendi: 11 Mart 2026
Short Description
Expert Advisor for XAUUSD using zone breakout and trend state detection
OverviewGoldTrendingMiner is an Expert Advisor designed for trading XAUUSD (Gold).
The system combines zone breakout detection with a multi-layer trend filtering model based on higher-timeframe indicators.
The EA analyzes the market using two layers of trend information:
-
Macro trend filter on the Weekly timeframe
-
Micro trend state detection on the Daily timeframe
Based on these conditions, the EA adapts its behavior to different market environments such as uptrend, sideways movement, or downtrend.
The trading logic focuses on breakout opportunities after consolidation zones while maintaining defined risk control through stop loss and position management rules.
Main FeaturesAccumulation Zone Detection
The EA automatically detects consolidation zones on the H1 timeframe and monitors breakout conditions from these ranges.
Volume and candle structure filters are applied to reduce low-quality signals.
Multi-Layer Trend Detection
Daily Trend State System
A three-EMA model using EMA20, EMA50, and EMA100 is used to classify the market state.
The system applies hysteresis logic to avoid frequent switching between states.
Weekly Macro Trend Filter
A Weekly EMA200 filter is used to determine the long-term market direction.
When the macro trend becomes bearish, the EA can reduce trading activity or pause certain strategies.
Partial Position Management
The EA includes staged profit management.
Example configuration:
-
First target closes part of the position
-
Second target closes an additional portion
-
Remaining position can be managed by trailing stop
This approach allows gradual profit realization while leaving part of the trade active.
Adaptive Trailing Stop
The trailing stop activates only after price reaches a predefined profit level relative to stop loss distance.
Once activated, the trailing mechanism protects a percentage of accumulated gains.
Risk-Reward Based Trade Structure
Stop loss and take profit levels are calculated using multiples of the stop distance.
This keeps risk management consistent across trades.
Pattern Confirmation in Downtrend
During bearish market states, additional confirmation conditions may be required before entries are allowed.
For example, the system may check for Daily engulfing patterns and confirmation candles before opening certain trades.
Counter-Trend Entry Filters
Additional filters can be applied when the system attempts counter-trend entries.
These filters evaluate selling pressure behavior and attempt to avoid entries during strong bearish momentum.
Long-Term Swing Holding
The EA can maintain longer-duration positions aligned with the Weekly trend.
Parameters for this module can be configured separately for:
-
Uptrend
-
Sideways market
-
Downtrend
Automatic Lot Scaling
The EA includes an optional equity-based lot scaling function.
Lot size can increase gradually as account equity grows if the feature is enabled.
Broker Compatibility
The EA is designed to work with most MetaTrader 5 brokers.
It has been tested on:
-
Standard accounts
-
Micro accounts
-
Cent accounts
The system operates without external libraries.
Risk ManagementThe EA includes several built-in risk control mechanisms.
Features include:
-
Stop loss on every trade
-
Optional lot reduction in bearish conditions
-
Maximum position limits
-
Strategy suspension when macro conditions change
The system does not use:
-
Martingale
-
Grid trading
-
Position averaging
The EA contains multiple trading modules that may activate depending on market conditions.
Examples include:
Uptrend breakout
Breakout entries during bullish market conditions.
Downtrend trading
Reduced-risk entries when the market is bearish.
Counter-trend entries
Limited position size entries when specific exhaustion conditions are detected.
Swing hold positions
Longer-term trades aligned with the broader trend.
RSI extreme condition entries
Optional entries during strong market imbalance periods.
Symbol
XAUUSD
Chart timeframe
H1
Broker type
ECN or low spread environment recommended
Account type
Hedging account
Leverage
High leverage accounts allow greater flexibility for gold trading.
Minimum balance depends on lot size and broker margin requirements.
Market ConditionsBreakout strategies tend to perform more consistently when the market shows clear directional movement and sufficient volatility.
Examples of suitable environments may include:
-
Gold trading above the Weekly EMA200
-
Daily moving averages aligned in a consistent direction
-
Stable market conditions without unusual spreads
Some traders may prefer to reduce automated trading during major economic announcements or periods of abnormal volatility.
Monitoring an economic calendar may help identify such periods.
Input ParametersParameters are grouped for easier configuration.
General
Magic number, lot size, equity scaling options
Zone detection
Consolidation range size and candle requirements
Trend system
Weekly macro filter and Daily trend state detection
Breakout module
Stop loss, take profit and trailing parameters
Downtrend module
Pattern confirmation settings and risk parameters
Swing holding
Long-term position parameters per market state
RSI module
Threshold levels and trade conditions
Exhaustion filter
Pressure decay conditions for counter-trend entries
Product support is provided through the MQL5 messaging system and product comment section.
DisclaimerPast performance does not guarantee future results.
Trading financial markets involves risk and may result in losses.
Users should test the Expert Advisor using historical data or demo accounts before trading on a live account.
gold, xauusd, breakout, trend, ema, rsi, trailing stop, partial close, swing trading, risk management
