Buddy Ilan with Automated Optimisation process
Ilan is a well known algorithmic trading system with its advantages and inconveniences.
He is reputed to have good results when the prices are in a range but also to blow up the accounts in the case of strong trend.
From a basic Ilan system, I added a trend filter to detect range periods, so that it trades only during these periods.
I have also added a feature allowing it to adapt to economic news, it will not trade from one to several hours before and after a news depending on its importance.
Other filters have been added too based on standard deviation, stochastics, spread...
The result is an EA with a low level of risk and as small DD as possible.
Use an initial volume of 0.01 per 1000 of equity for a safe trading. Do not go beyond this value.
Use M15 as a basic timeframe or M30 for choppy currencies.
- EA Identifier - EA Identifier
- Magic number - Magic Number of the EA
- Fixed or Dynamic volume - If dynamic volume is set, the EA uses a value of 0.01 per 1000 of equity
- Fixed volume size (if set) - Specify the initial fixed volume to use
- Number of "Buddy Ilan" instances on this account - If you use several "Buddy Ilan" on different currencies on the same account and if you use "dynamic volume", specify the number of instances of "Buddy Ilan" that you use, in this way, the EA will keep a global initial volume of 0.01 per 1000 of equity for a safe trading
- LotExponent - Lot multiplier
- DynamicPips - Dynamic mode to calculate the distance between orders
- DefaultPips - Default value for the distance between orders
- Glubina - Number of last bars for calculation of volatility
- DEL - Option to calculate a grid of orders
- Take Profit (Point) - Take Profit
- Stop Loss (Point) - Stop Loss
- Enable Trailing Stop - Use a trailing stop instead of Take Profit
- Trailing Stop distance (Point) - Trailing Stop distance
- MaxTrades - Maximum number of trades in a series
- Max allowed price deviation (Points) - Maximum allowed price deviation
- Dynamic Trend Filter - EnableTrend Filter (during a strong trend, positions will be opened in the direction of the trend)
- Dynamic TimeFrame Filter - EnableTimeFrame Filter (this fonction reduces the DD)
- MaxTimeFrame - TimeFrame Filter: max value (from 15 to 90, Modulo 15)
First, you need to define the most appropriate timeframe for the currency you want to trade. The smaller the timeframe, the riskier your trading will be. For a quiet currency that has changed slightly over the past 3 or 6 months, use M15, for others ones, use M30.Next, select the better Stop Loss and Take Profit for the last 3 months. Try to use a Stop Loss between 500 and 1500, forget the currencies that require a larger SL, the Take Profit can be set between 30 and 70.
The "Dynamic Trend Filter" and "Dynamic TimeFrame Filter" have been written to limit the DD and to secure trading.
It is preferable to use the default values for the other parameters.
I have developed an automatic optimization mechanism that is described in this article: https://www.mql5.com/en/articles/4917/74471, its use is optional.
You can download (for free) the last ready-to-use version from the comments page of this EA.
MetaTrader 5 setup
This EA uses the "Forex Factory" economic calendar.
To enable automatic downloads, you must “Allow WebRequests” for following URL: “http://www.forexfactory.com” (Menu: Options / Expert Advisors / Allow WebRequest for listed URL).
Following values can be used :
- 'x' (> 0): the EA does not open new positions the 'x' last days of the month, it will also not trade the first days of the month until the NFP (Non Farm Payroll),
- '0': the EA will not trade the first days of the month until the NFP,
- '-1': this function is disabled (default value).
This EA detects the strength of the trend and only trades in the direction of the trend when it is strong. However, some users want to force the direction of their trading, so the following 2 parameters have been added:
- Buy Only (for specific strategies),
- Sell Only (for specific strategies)
- The default value of the "lotExponent" parameter has been changed to slow down the increase in volumes and to better control sudden price movements.
- Save the values of the global variables in a file, they are restored when the EA is restarted after a crash (this sometimes happens),
- Adding a new filter on the short-term standard deviation (useful on some volatile pairs),
- Increases the freeze period before and after NFP and FOMC announcements,
- Added display of the news list with ESC key,
- Added display of the breakeven level,
- Added "Order Filling mode" as a parameter,
- Added "Forex Factory" url as a parameter.
The trailing stop cannot work properly in this case.