Trend Me Leave Me
This professional-grade solution for MetaTrader 5 helps traders achieve greater efficiency in their daily workflow. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.
How to Setup and Use Trend Me Leave Me
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.
Description & Settings
The Expert Advisor works with one position (can be used on netting accounts). The direction of a new open signal is calculated depending on the direction of the last closed position (BUY or SELL) and the way that position was closed (by Stop Loss or Take Profit).
General principle:
If a position was closed by Take Profit, the next position will be opened in the same direction;
If a position was closed by Stop Loss, then the next position should be opened in the opposite direction.
Type of closing is determined in OnTradeTransaction() using : the transaction and its type is accessed in OnTradeTransaction() first:
, and then the DEAL_REASON property is checked.
If the Breakeven parameter is not equal to zero, the position will be moved to breakeven if possible.
After determining the direction in OnTradeTransaction(), check for further conditions:
To open a BUY position, the SAR indicator on bar #0 must be less than the Close of bar #0, and ADX on bar #0 must be less than 20.
To open a SELL position, the SAR indicator on bar #0 must be greater than the Close of bar #0, and ADX on bar #0 must be less than 20; Input Parameters
Stop Loss (in pips)
- Stop Loss value;
Take Profit (in pips)
- Take Profit value;
Risk in percent for a deal
- risk percent per trade;
Breakeven (in pips)
- the breakeven value;
ADX: averaging period
- ADX indicator parameter;
SAR: price increment step - acceleration factor
- SAR indicator parameter;
SAR: maximum value of step
- SAR indicator parameter.
Default parameters, EURUSD,M30 from 2017.01.08 to 2018.02.05