DI Trend – Trend-Following EA for XAUUSD , Using ADX, EMA, ATR & Ichimoku

26 June 2025, 16:00
Van Minh Nguyen
0
120

🚀 DI Trend – My First Smart Trend EA Powered by ADX, EMA, ATR & Ichimoku

A Multi-Timeframe, Multi-Filter Trend Strategy Powered by ADX, EMA, ATR, Ichimoku & HTF Confirmation

Hello MQL5 Community!

I’m a trader who just started contributing to the MQL5 platform. DI Trend is the first Expert Advisor I’ve developed — built upon a disciplined trend-following philosophy. It integrates multiple layers of signal filters to minimize noise and optimize trade entries.

I sincerely welcome your feedback and suggestions to help improve this EA further.

🧠 Core Strategy – ADX as the Foundation of Trend Detection

DI Trend uses the ADX indicator to detect real trend momentum, combined with robust confirmation filters to reduce false signals.

Core ADX Conditions:

  • ADX ≥ 25 → Indicates a strong trending market

  • +DI crosses above -DI → Buy signal; the reverse for Sell

Once both conditions are met, the EA will validate the signal with multiple filters to ensure high-confluence entries.


🔍 Multi-Filter Confluence – Trade Only When Signals Align

Filter Purpose Default Setting
EMA Slope Avoids weak momentum by checking EMA angle EMASlopeThreshold = 0.05
HTF Trend Filter Confirms trend using EMA200 from higher timeframe HTF_EMA_Period = 200
DI Distance Ensures enough separation between +DI and -DI MinDIDistance = 2.0
Ichimoku Cloud Verifies price location relative to Kumo Cloud SenkouSpanBPeriod = 52
ATR Filter Filters out entries in low or overly volatile markets ATRFilterThreshold = 1.0

📌 All these parameters can be fully customized to fit your own trading strategy.


⏱️ Recommended Symbols & Timeframes

DI Trend is optimized for XAUUSD (Gold), especially on lower timeframes such as M1 and M5, where it demonstrates strong trend exploitation and fast signal responsiveness.


⚙️ Example Input Settings

```mq5
//==== TREND SETTINGS ====
input bool   EnableBuy      = true;       // Cho phép lệnh Buy  
input bool   EnableSell     = true;       // Cho phép lệnh Sell  
input int    MaxTrendOrders = 5;          // Số lệnh tối đa  

//==== ADX SETTINGS ====
input int    ADX_Period     = 14;         // Chu kỳ ADX  
input int    ADX_Threshold  = 25;         // Ngưỡng ADX  

//==== MONEY MANAGEMENT ====
input bool   UseAntiMartingale   = true;
input double AntiMartingaleStep  = 0.01;
```


📊 Backtest Results – XAUUSD M1

Test Period: Jan 1, 2025 – Jun 26, 2025
(Backtested with high-quality historical data. Note: past performance is not indicative of future results.)

Metric Value
Total Net Profit $1,336.00
Total Trades 188
Win Rate 96.81% (182 wins)
Profit Factor 3.48
Recovery Factor 3.40

📸 (See attached screenshots for visual details)

Figure 1 – Backtest Performance Summary

Backtest Summary Report


Figure 2 – Balance and Equity Growth Curve

Balance/Equity Growth Curve


📺 [Watch EA Backtest on YouTube] (https://youtu.be/waqspHmYcJs?si=WK_9w0BxJ2Oc9r2O)



🔐 Smart Risk Management Features

  • 🎯 Dynamic Lot Sizing – Calculates position size based on % risk per trade (e.g., 2%)

  • 🔁 Anti-Martingale System – Increases lot size after winning trades, resets on a loss

  • 🧠 R-Based Trailing Stop

    • Activates when floating profit reaches 3R

    • Adjusts stop-loss to trail at +1R to lock in gains

  • 💰 Flexible Take-Profit Options

    • Fixed profit in USD ( SumTargetProfitUSD = 100 )

    • Or by account percentage ( TP_Percent = 5.0 )


💬 Final Words & Feedback Invitation

DI Trend is not a magic tool, but it is built with the spirit of discipline – clarity – transparency. I originally developed it to improve my own trading consistency, and I hope it can be useful for other traders as well.

🛠️ This EA will soon be available on MQL5 Market, along with a free demo version. Your feedback and suggestions are extremely valuable — please feel free to share your thoughts!

“When you trust your system, emotions no longer control your trades. That’s why I built DI Trend.”

👉 Follow me on MQL5 to get notified as soon as the EA goes live! 

Follow my MQL5 profile for updates:
https://www.mql5.com/en/users/VanMinhNguyen

📌 DITrend , ForexEA ,TrendFollowing ,XAUUSD , MQL5 ,ExpertAdvisor ,TradingBot ,ADXStrategy ,GoldTrading