XauUsd Smart Strategy v5
- Эксперты
- Версия: 4.37
- Активации: 5
Advanced Multi-Timeframe Trading System for MetaTrader 5
Automate your XAUUSD trading with a structured strategy combining trend analysis, Multi-TimeFrame confirmations, volatility filters, dynamic trade management, and advanced risk controls.
XAUUSD Smart Strategy EA has been developed specifically for trading Gold (XAUUSD) on MetaTrader 5, combining trend analysis, momentum, volatility, moving-average structure, Fair Value Gap filtering, and automated position management.
The system is designed to avoid indiscriminate entries and search only for market conditions that satisfy the strategy's defined criteria.
Compatible with MT5 / TradFi environments, including execution configurations adapted to brokers such as Bitget MT5, with dynamic detection of the execution mode and filling method supported by the trading server.
⚡ A COMPLETE STRATEGY FOR XAUUSDThe EA does not rely on a single signal.
Before executing a trade, the system analyzes multiple layers of the market:
• Main H1 trend
• Moving-average direction
• MA180 structural trend filter
• ADX trend strength
• DI+ and DI− directional pressure
• Multi-TimeFrame confirmation
• Entry-timeframe moving-average crosses
• ATR volatility filter
• Fair Value Gap (FVG)
• Maximum spread
• Trading hours
• Daily profit/loss limits
• Maximum daily trades
• Current position status
• Symbol execution conditions
The objective is to combine these conditions into a systematic and repeatable decision-making process.
📊 MULTI-TIMEFRAME ANALYSISOne of the core features of the system is its Multi-TimeFrame architecture.
The EA separates the analysis of the main market trend from the actual entry.
Main Trend
The primary reference timeframe is H1.
The system analyzes:
• Fast EMA
• Slow EMA
• MA180
• ADX
• DI+
• DI−
The combination helps determine whether the market structure is bullish, bearish, or insufficiently defined.
Entry Timeframe
The entry can operate on a separate timeframe, allowing the system to separate:
Market Context → Confirmation → Entry
The base configuration uses:
H1 → Main Trend
M5 → Entry
This allows the EA to search for more precise entries while maintaining the higher-timeframe market context.
🧭 MA180 TREND FILTERThe system incorporates a 180-period trend moving average on H1.
Price is compared against this reference to determine the structural position of the market.
The MA180 can therefore act as an additional filter against trades that contradict the main market context.
The HUD panel displays:
MA180: PRICE ABOVE
or
MA180: PRICE BELOW
allowing the current structural condition to be monitored directly from the chart.
📈 ADX + DI STRENGTH FILTERThe EA incorporates ADX to distinguish stronger trending conditions from lower-directional environments.
Base configuration:
ADX Period: 9
ADX Trending: 25
ADX Strong: 40
In addition to the ADX value, the system analyzes:
DI+
DI−
This allows the EA to evaluate not only whether sufficient market movement exists, but also which side has greater directional pressure.
The HUD panel displays the current trend condition as:
STRONG
TRENDING
or
RANGING
depending on the configured ADX conditions.
🔄 BUY & SELL ENTRIESThe EA is designed to operate in both directions:
🟢 BUY
and
🔴 SELL
Trades are triggered according to the H1 trend direction and the conditions detected on the entry timeframe.
For BUY trades, the system looks for bullish conditions together with bullish entry confirmation.
For SELL trades, it looks for bearish conditions together with bearish entry confirmation.
This allows the same strategy architecture to participate in both bullish and bearish XAUUSD movements.
🎯 MOVING-AVERAGE CROSS ENTRYThe main entry logic uses a combination of a fast and slow moving average.
Base configuration:
Fast MA: 9 EMA
Slow MA: 26 EMA
When the trend conditions are aligned, the system identifies:
Bullish Cross → Potential BUY
Bearish Cross → Potential SELL
The entry continues only when the other configured filters are also satisfied.
⚡ OPTIONAL EARLY ENTRYThe EA includes an optional Early Entry mode.
This function can identify a potential moving-average cross before the complete cross occurs.
The system checks:
• Distance between the moving averages
• Convergence of the moving averages
• Direction of the main trend
When the moving averages are converging and the configuration agrees with the main trend, the EA can anticipate the entry.
This feature is optional and can remain disabled when only confirmed crosses are desired.
🧩 FAIR VALUE GAP FILTERThe system includes a Fair Value Gap (FVG) filter.
The EA analyzes a configurable number of candles to identify price imbalances compatible with:
🟢 Bullish FVG for BUY conditions
🔴 Bearish FVG for SELL conditions
Available settings include:
FVG Filter: ON/OFF
FVG Lookback: configurable
When enabled, signals that do not satisfy the configured FVG condition can be rejected.
This provides an additional layer of entry filtering.
🌡️ ATR VOLATILITY FILTERATR is used to evaluate available volatility and to build the dynamic trade-management framework.
The EA includes an ATR strength filter that can block new entries when market volatility is below the configured minimum.
Base configuration:
ATR Period: 9
ATR Minimum Strength: configurable
This allows the system to avoid opening trades during selected low-volatility conditions.
🛡️ DYNAMIC STOP LOSSThe Stop Loss can operate in two modes:
ATR-BASED STOP LOSS
The SL is calculated using the ATR of the entry timeframe multiplied by the configured factor.
Base configuration:
ATR SL Multiplier: 2.5
FIXED STOP LOSS
Alternatively, the EA can use a fixed Stop Loss distance measured in points.
The user can therefore choose between:
ATR-based SL
or
Fixed SL
The EA also checks the minimum stop-distance requirements imposed by the trading symbol before sending the order.
💰 DYNAMIC TAKE PROFITThe Take Profit can also be calculated dynamically using ATR.
Base configuration:
ATR TP Multiplier: 6.0
This allows the target distance to adapt to the current volatility instead of relying exclusively on a fixed distance.
The relationship between Stop Loss and Take Profit can be adjusted through the EA parameters.
🔐 SMART STOP MANAGERThe system includes a dedicated Smart Stop Manager designed to safely handle Stop Loss modifications.
Before modifying a position, the EA checks:
• Minimum stop distance
• Freeze level
• Tick size
• Current Bid/Ask
• Position direction
• New SL validity
• Minimum SL improvement
• Execution conditions
Prices are normalized according to the tick size allowed by the symbol.
This is particularly important for CFD/TradFi instruments where execution conditions may vary.
🔒 AUTOMATIC BREAK-EVENThe EA includes automatic Break-Even management.
Once the position reaches the configured distance relative to the initial risk, the Stop Loss can be moved to the entry area, including a small tick-based offset.
The purpose is to reduce exposure after the trade has moved sufficiently in the desired direction.
📐 SMART TRAILING STOPThe EA includes configurable trailing-stop management.
It can operate using:
ATR TRAILING
The trailing distance is calculated using ATR.
STEP TRAILING
The Stop Loss advances using predefined steps.
The system also includes controls designed to prevent excessive Stop Loss modifications:
• Minimum update interval
• Minimum SL improvement
• Minimum stop-distance validation
• Protection against moving the SL backwards
The trailing mechanism is designed to improve the existing Stop Loss rather than weaken it.
💰 RISK MANAGEMENTThe EA allows two primary position-sizing modes:
FIXED LOT
Example:
0.01 lots
or another volume supported by the trading symbol.
PERCENTAGE RISK
The position size can be calculated using:
• Account balance
• Risk percentage
• Stop Loss distance
• Tick Value
• Tick Size
• Minimum volume
• Maximum volume
• Volume step
This allows position size to adapt to the available account balance when percentage-risk mode is selected.
🛑 DAILY LOSS PROTECTIONThe system includes daily performance protection.
You can define a maximum daily loss limit.
When the configured limit is reached:
The EA stops looking for new trades and can close positions managed by the system.
A configurable daily profit target is also available.
When the target is reached:
The EA can close positions managed by the system and stop opening new trades during that daily cycle.
📊 DAILY TRADE LIMITThe EA also allows a maximum number of trades per day.
This provides additional control over trading frequency and prevents the system from continuously opening trades throughout the same trading day.
The HUD panel displays:
Trades completed / Maximum allowed
📏 SPREAD FILTERBefore opening a trade, the EA checks the current spread of the symbol.
If the spread exceeds the configured maximum:
The entry is blocked.
This provides additional protection during periods when execution costs become elevated.
The current spread condition is displayed directly on the HUD panel.
🕐 TRADING HOURS FILTERThe system allows the user to define a trading window.
You can configure:
Start Hour
End Hour
There is also an option to close EA-managed positions when the system is outside the permitted trading hours.
The time filter can be enabled or disabled according to the desired operating mode.
🔄 CLOSE ON TREND REVERSALThe EA can detect a reversal of the main H1 trend structure.
When enabled, a position that becomes contrary to the newly detected main trend can be closed automatically.
This allows trade management to react to changes in the market structure instead of relying exclusively on Stop Loss or Take Profit.
⚙️ BITGET MT5 EXECUTION ENGINEOne of the important components of this version is its dedicated execution logic.
The EA dynamically detects symbol information including:
• Execution mode
• Filling mode
• FOK
• IOC
• RETURN
• Stops Level
• Freeze Level
• Minimum volume
• Maximum volume
• Volume step
The system selects the filling mode compatible with the conditions provided by the trading server.
Before sending an order, the EA also performs an OrderCheck() validation.
The execution result is then recorded for monitoring and diagnostics.
This allows the EA to adapt its order execution to the actual MT5 symbol configuration instead of assuming that every broker uses the same execution model.
🧮 PROFESSIONAL ORDER NORMALIZATIONThe EA automatically adapts:
Price → Tick Size
Volume → Volume Step
SL → Minimum permitted distance
TP → Minimum permitted distance
This is particularly relevant for instruments where tick size, minimum volume, or stop-distance requirements differ from standard Forex configurations.
🖥️ PROFESSIONAL HORIZONTAL HUD PANELThe EA includes a dedicated horizontal HUD panel designed to provide an instant overview of the strategy.
The panel can operate with a transparent configuration so that it does not unnecessarily obstruct the chart.
The information is organized into several sections:
MARKET
• Current price
• Spread
• Entry timeframe
• Operating status
H1 TREND
• Direction
• ADX
• DI+
• DI−
• MA180 status
ENTRY
• Direction
• ATR
• ATR filter
• FVG
• Early Entry
CONFIRMATION
• MTF status
• H1
• M30
• M15
• M5
POSITION
• LONG / SHORT
• Number of positions
• Floating P&L
• Break-Even
RISK
• Daily P&L
• Equity
• Trades completed
• Lot size or risk percentage
This allows the trader to monitor the complete EA state without constantly opening or checking the internal settings.
🔍 REAL-TIME STRATEGY STATUSThe HUD can display states such as:
READY TO TRADE
WAITING: HIGH SPREAD
TRADE LIMIT REACHED
PAUSED: DAILY LIMIT
MTF: ALIGNED
MTF: NOT ALIGNED
TREND: BULLISH
TREND: BEARISH
TREND: RANGING
This makes it easier to understand why the EA is trading or why it is currently waiting.
🧠 DECISION-MAKING ARCHITECTUREThe system follows a layered filtering process.
Simplified:
1. Detect the H1 market context
↓
2. Check trend using moving averages
↓
3. Check ADX and DI
↓
4. Check MA180
↓
5. Analyze the entry timeframe
↓
6. Detect cross or optional early entry
↓
7. Check Multi-TimeFrame confirmations
↓
8. Check ATR volatility
↓
9. Check FVG
↓
10. Check spread
↓
11. Check daily limits
↓
12. Calculate SL / TP
↓
13. Calculate position size
↓
14. Validate the order according to symbol requirements
↓
15. Send the trade
↓
16. Manage the position using Break-Even and Trailing Stop
This architecture is designed so that each potential trade passes through multiple validation layers before reaching the market.
🔥 DESIGNED FOR GOLDXAUUSD is an instrument capable of experiencing rapid price movements and significant changes in volatility.
For this reason, the EA combines:
Trend + Momentum + Volatility + Confirmation + Risk Management
rather than relying exclusively on a single signal.
The strategy is structured specifically around XAUUSD market dynamics while allowing the parameters to be adjusted to different market conditions and trading profiles.
📌 BASE CONFIGURATIONThe included configuration uses:
Trend Timeframe: H1
Entry Timeframe: M5
Fast MA: 9 EMA
Slow MA: 26 EMA
Trend MA: 180 EMA
ADX: 9
ADX Trending Level: 25
ADX Strong Level: 40
ATR: 9
ATR SL: 2.5×
ATR TP: 6.0×
ATR Trailing: 2.0×
FVG: Enabled
H1 Confirmation: Enabled
M5 Confirmation: Enabled
Break-Even: Enabled
Trailing Stop: Enabled
HUD Panel: Enabled
All major parameters are configurable and can be adapted to the characteristics of the symbol, broker, and trading account.
💎 WHAT MAKES XAUUSD SMART STRATEGY EA DIFFERENT?It is not simply an EA that buys or sells whenever two moving averages cross.
Its architecture combines multiple levels of market analysis:
TREND
Determines the primary market context.
STRENGTH
Uses ADX + DI to evaluate directional strength.
STRUCTURE
Uses MA180 as a structural reference.
MOMENTUM
Looks for directional changes through entry-timeframe moving averages.
VOLATILITY
Uses ATR to filter conditions and dynamically manage SL/TP.
IMBALANCE
Uses Fair Value Gap as an additional filter.
CONFIRMATION
Can use multiple timeframes.
EXECUTION
Adapts order execution to the actual MT5 symbol configuration.
MANAGEMENT
Includes Stop Loss, Take Profit, Break-Even and Trailing Stop.
PROTECTION
Controls spread, daily trades, daily loss and daily profit targets.
VISUALIZATION
Provides the complete strategy state through a single horizontal HUD panel.
🚀 AUTOMATE THE STRATEGY. LET THE EA HANDLE THE PROCESS.Once configured, the system automatically monitors the market and attempts to execute trades only when the defined strategy conditions are present.
You do not need to remain in front of the chart waiting for a moving-average cross.
The EA continuously evaluates:
Trend
Volatility
Momentum
Confirmations
FVG
Spread
Risk
Open Positions
Execution Conditions
and manages trades automatically.
⚠️ IMPORTANT RISK DISCLAIMERThis Expert Advisor is an automated trading tool and does not guarantee profits or eliminate trading risk.
Results may vary depending on the broker, symbol specifications, spread, execution, leverage, market conditions, selected parameters, and capital management.
XAUUSD can experience rapid price movements and elevated volatility.
It is strongly recommended to test the EA on a demo account and/or in the MetaTrader 5 Strategy Tester before using real capital and to verify that the selected lot size, Stop Loss, Take Profit, and risk settings are appropriate for your account.
Past performance and backtest results do not guarantee future results.
🏆 XAUUSD SMART STRATEGY EAMULTI-TIMEFRAME
TREND FILTER
MA180
ADX + DI
ATR DYNAMIC MANAGEMENT
FAIR VALUE GAP
BUY & SELL
EARLY ENTRY
BREAK-EVEN
SMART TRAILING STOP
DAILY RISK CONTROL
SPREAD FILTER
TIME FILTER
BITGET MT5 EXECUTION
PROFESSIONAL HORIZONTAL HUD
A complete architecture for automating a structured XAUUSD trading strategy on MetaTrader 5.
Analyze. Filter. Execute. Manage.
