ADX Trend Pullback EA: Trend Strength and Volatility-Based Trading
Info
The ADX Trend Pullback EA: Trend Strength and Volatility-Based Trading is a Expert Advisor for MetaTrader 5 that brief descriptionthis expert advisor combines an adx-based trend strength filter with an ema pullback entry technique. It utilizes ATR for dynamic stop loss and take profit sizing and is designed for trading a single symbol with one position open at a time.
Usage
This tool is typically used for trend following strategies across multiple currency pairs.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use ADX Trend Pullback EA: Trend Strength and Volatility-Based Trading
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
Brief DescriptionThis Expert Advisor combines an ADX-based trend strength filter with an EMA pullback entry technique.
Typical Use Case
This Expert Advisor excels in trend following on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: Long-Only Trend Breakout with Dynamic Risk Management - another powerful expert for MetaTrader 5 traders.
Brief DescriptionAlso recommended: Trend Momentum EA - similar expert with strong performance on MetaTrader 5.
This Expert Advisor combines an ADX-based trend strength filter with an EMA pullback entry technique. It utilizes ATR for dynamic stop loss and take profit sizing and is designed for trading a single symbol with one position open at a time.
Core Strategy Concepts
The strategy is built on three established concepts:
1. Trend Strength: The Average Directional Index (ADX) measures trend strength. A rising ADX above a defined threshold indicates a developing or strengthening trend. A flat or falling ADX suggests a weak or ranging market.
2. Pullback Entry: An Exponential Moving Average (EMA) serves as a dynamic reference level. Price moving close to the EMA and then away from it is treated as a pullback within the prevailing trend.
3. Volatility-Based Risk Management: The Average True Range (ATR) expresses stop loss and take profit distances in terms of current market volatility, not fixed pip values. The Plus/Minus Directional Indicators (+DI / -DI) from the ADX indicator determine trade direction.
Signal Interpretation
All calculations are performed on closed bars of the timeframe selected in the input settings, and signals are evaluated once per new bar. The entry logic requires two conditions to be satisfied simultaneously:
1. Trend Filter: The ADX on the previous bar must be above the ADX threshold and higher than the ADX on the bar before that, indicating increasing trend strength.
2. Pullback Event: The distance between price and the EMA, expressed as a multiple of ATR, must have been at or above the pullback ratio on an earlier bar and dropped below it on the previous bar. This signifies price approaching the EMA and then moving away.
When both conditions are met, the trade direction is determined by comparing +DI and -DI on the previous bar. If +DI is greater than -DI, a buy signal is generated. If -DI is greater than +DI, a sell signal is generated. The trade direction input can restrict the EA to buy-only, sell-only, or both directions.
Stop loss distance is calculated as ATR multiplied by the SL multiplier input. Take profit distance is the stop loss distance multiplied by the risk-reward ratio input. Only one position per symbol is allowed at a time, and a new position is only considered when no position is currently open.
Suitable Symbols and Timeframes
The EA is configured by default for the H1 timeframe, but the timeframe used for indicator calculations can be changed independently of the chart timeframe through the input settings. Because the logic relies on ADX, EMA, and ATR values that adapt to current volatility, it can in principle be applied to a range of liquid symbols and timeframes. Testing on the target symbol and timeframe in the Strategy Tester is recommended before live use.
Included Files
This code does not use external #include files. All logic is contained within a single source file.
Main External Variables
Variable
Default
Description
InpTradeDirection
TRADE_BOTH
Restricts trading to both directions, buy only, or sell only.
InpMagicNumber
270601
Magic number used to identify orders placed by this EA.
InpLotSize
0.01
Fixed lot size used for every trade.
InpATR_SL_Multiplier
1.5
Stop loss distance, expressed as a multiple of ATR(14) on the previous bar.
InpRR_Ratio
2.0
Take profit distance, expressed as a multiple of the stop loss distance.
InpIndicatorTF
PERIOD_H1
Timeframe used for ADX, EMA, and ATR calculations.
InpADXPeriod
14
Period used for the ADX indicator.
InpEMAPeriod
20
Period of the EMA applied to the close price.
InpATRPeriod
14
Period used for the ATR indicator.
InpADXThreshold
25.0
Minimum ADX value required, combined with a rising ADX, to allow an entry.
InpPullbackATRRatio
0.5
Distance from the EMA, as a multiple of ATR, used to define a pullback event.
You may also like: Trend Capture - excellent alternative for expert users on MetaTrader 5.
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.