Multi-Level Trend Expert Advisor for MT4/MT5
Info
The Multi-Level Trend Expert Advisor for MT4/MT5 is a Expert Advisor for MetaTrader 4 that this expert advisor (ea) operates on the principle that market movements are not always unidirectional. Even during strong trends, temporary pullbacks occur due to significant support/resistance levels or profit-taking by dominant traders.
Usage
This tool is typically used for trend following strategies across multiple currency pairs.
Platform
This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use Multi-Level Trend Expert Advisor for MT4/MT5
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) operates on the principle that market movements are not always unidirectional.
Typical Use Case
This Expert Advisor excels in trend following on MetaTrader 4.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.
Description & Settings
Related: lx eurjpy: an adaptive trend-following expert advisor - another powerful expert for MetaTrader 4 traders.
This Expert Advisor (EA) operates on the principle that market movements are not always unidirectional. Even during strong trends, temporary pullbacks occur due to significant support/resistance levels or profit-taking by dominant traders. This EA is designed to capitalize on these reverse moves, performing optimally when trading in the prevailing trend direction.Also recommended: forces momentum: trend determination tool - similar expert with strong performance on MetaTrader 4.
The EA's core logic is as follows:
It monitors the Moving Average (MA) on the daily chart. If the MA(34) turns upwards, the EA opens a buy trade. Conversely, if it turns downwards, it opens a sell trade.
If the market moves in the trend's direction, the EA closes the position based on the specified Take Profit (TP) parameter. The default TP is 60 for 4-digit brokers and 600 for 5-digit brokers.
In instances where the market moves against the opened trade, the EA opens an additional position in the same direction at a distance of -600 (or -60 pips) with the same lot size. If the market then moves in the trade's favor, both trades are closed at the TP target of the last opened trade.
This averaging process continues for subsequent levels, with lot sizes increasing in a multiplier sequence (e.g., 2, 4, 8). For example, if the initial lot size is 0.1, the lot sizes for subsequent levels will follow this progression.
Key EA Parameters:
TP (Take Profit): The target profit for closing a trade. For 4-digit brokers, this value should be adjusted from the default 600 to 60.
DP (Timeframe): Specifies the timeframe for the MA calculation. The default is the daily timeframe (1440). The EA can be attached to any chart, but it will use the DP value to determine the MA timeframe.
MAP (Moving Average Period): The period for the Moving Average calculation. The default is 34.
MAXTRADE (Maximum Trades): The maximum number of trades the EA will open in the same direction.
TRADETYPE: Controls trade direction. '0' follows the MA direction. '1' forces buy trades. '2' forces sell trades.
Recommendations:
For enhanced performance, consider combining this EA with other indicators like additional moving averages, Bollinger Bands, or by manually identifying support and resistance levels. Adjust the TRADETYPE (0, 1, or 2) based on signals from these supplementary tools.
Always implement a money management strategy that aligns with your risk tolerance and use an appropriate lot size.
The updated MLTrend V2 includes additional parameters:
MAREVERSAL: (true/false). When set to true, the system trades using an EMA(500). If the price crosses below the EMA(500) while moving upwards, any open sell positions are closed, and TRADETYPE is set to 1. If the price crosses above the EMA(500) while moving downwards, any open buy positions are closed, and TRADETYPE is set to 2. This parameter is recommended for use with the H1 timeframe and can be backtested using open prices.
ALLOWSL: (true/false). This parameter can only be used when MAREVERSAL is set to false. When ALLOWSL is true, the system utilizes the original multiple levels system and implements a Stop Loss on the last opened position. If the last opened position hits the SL, all positions across all levels are closed, and the trend is reversed by setting TRADETYPE. When ALLOWSL is true, two additional parameters, SL (Stop Loss) and MAXTRADE, must be set. Backtesting with ALLOWSL enabled should only be performed using the 'Every Tick' mode.
You may also like: starter trend-following expert advisor - excellent alternative for expert users on MetaTrader 4.
Source Code
#define nl "\n"
extern double lots = 1;
extern double l1 = 1;
extern double l2 = 2;
extern double l3 = 4;
extern double l4 = 8;
extern double tp = 21000;
extern bool allowsl = false;
extern bool mareversal = true;
extern double sl = 600;
.......
⚠ 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.