• Overview
  • Reviews (3)
  • Comments (56)
  • What's new

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.

Our advice

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.

Automated optimisation

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).

Happy trading.

unix 2018.10.29 04:40 

Recommend EA, it is low risk and has profitability.

Nice work, Thanks!

推薦大家用這隻EA. 你先學好如何optimization! 你會有很好的results.

محمد الرشيدي
محمد الرشيدي 2018.09.06 23:40 


Cristian Caula
Cristian Caula 2018.08.20 11:02 

Buddy Ilan is working with the EURUSD pair at 0.01 lots with spreads starting at 0.

I find it very good idea to implement the news filter to reduce the DD.

This EA works very well.

Version 1.20 2019.01.15
This version fixes a bug on the volumes after a restart of the EA when positions are already open.
Version 1.19 2018.12.08
When losses are generated, they are often at the end or at the begining of the month, I added a parameter that allows you to limit trades during these periods: "Nb of days frozen at the end of each month (up to the NFP)".
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)
Version 1.17 2018.11.10
- Several bugs appeared in version 1.16 are fixed,
- The default value of the "lotExponent" parameter has been changed to slow down the increase in volumes and to better control sudden price movements.
Version 1.16 2018.10.25
Several improvements:
- 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.
Version 1.12 2018.09.22
If you use an account whose minimum SL value is greater than 0, the trailing stop is now automatically disabled, a TP is set instead.

The trailing stop cannot work properly in this case.
Version 1.10 2018.08.25
A button "Start/Stop trading" has been added for easier management, in "Stop" mode, open positions continue to be managed (new positions may be opened), but once the current series is closed, the EA will not open new ones.