Trend Following Expert Advisor with Dynamic Position Management
Info
The Trend Following Expert Advisor with Dynamic Position Management is a Expert Advisor for MetaTrader 5 that this expert advisor (ea) manages trades using a single open position strategy, suitable for netting accounts. The direction of a new trade signal is determined by the outcome of the last closed position.
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 Trend Following Expert Advisor with Dynamic Position Management
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
This expert advisor (EA) manages trades using a single open position strategy, suitable for netting accounts.
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: Supertrend Scalper with Breakeven Win Rate Panel - another powerful expert for MetaTrader 5 traders.
This expert advisor (EA) manages trades using a single open position strategy, suitable for netting accounts.Also recommended: Stormbreaker ADX - Supertrend and DMI Trend EA for MT5 - similar expert with strong performance on MetaTrader 5.
The direction of a new trade signal is determined by the outcome of the last closed position. Specifically, it considers whether the position was closed by Take Profit or Stop Loss.
The core principle is as follows:
- If a position is closed by Take Profit, the next position will be opened in the same direction.
- If a position is closed by Stop Loss, the next position will be opened in the opposite direction.
The EA identifies the closing method within the `OnTradeTransaction()` function. It first accesses the transaction and its type, then checks the `deal_reason` property.
If the `breakeven` parameter is set to a non-zero value, the EA will attempt to move the open position to breakeven.
After determining the trade direction in `OnTradeTransaction()`, the EA evaluates additional conditions before opening a new trade:
- To open a BUY position: The SAR indicator value on bar #0 must be less than the closing price of bar #0, and the ADX indicator value on bar #0 must be less than 20.
- To open a SELL position: The SAR indicator value on bar #0 must be greater than the closing price of bar #0, and the ADX indicator value on bar #0 must be less than 20.
Input Parameters:
- Stop Loss (in pips): Defines the stop loss level.
- Take Profit (in pips): Defines the take profit level.
- Risk in percent for a deal: Specifies the risk percentage per trade.
- Breakeven (in pips): Sets the breakeven level.
- ADX Averaging Period: Parameter for the ADX indicator.
- SAR Price Increment Step (Acceleration Factor): Parameter for the SAR indicator.
- SAR Maximum Step Value: Parameter for the SAR indicator.
Default parameters tested on EURUSD, M30 from 2017.01.08 to 2026.02.05.
You may also like: ATR Trend Guard MT5: Dynamic EMA Crossover Expert Advisor with Integrated Risk Management - excellent alternative for expert users on MetaTrader 5.
Source Code
/
.......
⚠ 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.