Smart Trend Filtered Grid for XAUUSD

Trend-Filtered Grid Expert Advisor for XAUUSD

Description:

This Expert Advisor (EA) is designed to apply a grid trading strategy on the XAUUSD (Gold) symbol, utilizing a trend-following filter. Because Gold is characterized by high volatility, the EA incorporates specific risk management and position-sizing parameters to manage exposure during sudden market movements.

Trading Logic and Features:

  • Dual EMA Trend Filter: The EA determines the market direction using two Exponential Moving Averages (50 and 200) on the H4 timeframe. It opens positions only in the direction of the current trend based on these indicators.

  • Grid Management: The system opens up to 7 orders per side with a 50-pip step between them.

  • Bias Reversal Mechanism: If the market moves 400 pips against the initial trade, the EA has a function to reverse the trading bias. It will close the previous grid and open a new one, provided the EMA trend also confirms the new direction.

  • Money Management: The EA utilizes a Basket Stop Loss and a Basket Take Profit to manage the total floating profit and loss of the open positions.

  • Partial Close and Trailing Stop: When the basket reaches 75% of the Take Profit target, the EA closes 75% of the total volume. The remaining volume is managed by a trailing stop mechanism that activates after a specified drawdown from the peak profit.

  • Weekend Protection: The EA is configured to automatically close all open positions before the weekend (Friday 20:00 server time) to avoid exposure to weekend market gaps.

  • Cooldown System: The EA includes a waiting period of 120 minutes after any basket closes. Additionally, it can pause trading for 2 days after a specified number of consecutive basket losses to avoid trading in unfavorable market conditions.

Input Parameters:
The EA provides full customization of its parameters, including Lot Size, Maximum Orders per side, Grid Step, Take Profit, Stop Loss, EMA periods, and partial close settings.

Strategy Testing Information:
The following data is derived from a historical backtest and does not represent real trading results.

  • Symbol: XAUUSD (Gold)

  • Timeframe: H4

  • Test Period: July 2023 – October 2026

  • Initial Deposit: $5,000 USD

  • Leverage: 1:100

  • Modeling: Every tick based on real ticks (99% history quality, over 136 million ticks analyzed)

  • Total Trades: 3,357

  • Total Net Profit: $9,297.74

  • Profit Factor: 1.31

  • Expected Payoff: $2.77 per trade

  • Max Balance Drawdown: 14.21%

  • Max Equity Drawdown: 16.01%

  • Recovery Factor: 6.38

  • Sharpe Ratio: 2.19

Recommendation:
It is recommended to use this EA specifically on the XAUUSD symbol on the H4 timeframe. Before using it on a live account, please test the EA thoroughly in the Strategy Tester and on a demo account to understand its behavior.

Disclaimer:
Trading on financial markets involves high risk. Past performance and backtest results do not guarantee future results. Grid trading strategies carry specific risks during strong directional market movements.


筛选:
无评论
回复评论