Experience the power of MT5 Optimization Booster for free!

Experience the power of MT5 Optimization Booster for free!

3 January 2025, 13:49
Andrey Dik
0
74

Special New Year Offer: 2 Weeks of Free Trial!  (file attached) ⬇️

Get full access to MT5 Optimization Booster for 14 days absolutely free

What you get during the trial period:

✅ Complete unlimited functionality of the Booster
✅ Unlimited number of optimizations


What is MT5 Optimization Booster?

MT5 Optimization Booster is designed to enhance the capabilities of the built-in optimizer.

  • Unlimited number of parameters for optimization.
  • Unlimited step size for optimization parameters.
  • Unlimited number of runs.
  • Unmatched speed and accuracy of convergence.
  • Ease of use.
  • Full utilization of all CPU cores.

Thus, the Booster allows you to leverage a highly accurate trading environment of the built-in tester/optimizer while bypassing all its limitations.

Important to Understand Before Getting Started:

  • The Booster is a tool, not a magic wand.
  • It helps find the best settings, but the quality of the results depends on your trading strategy.
  • The outcome of the optimization directly depends on the criteria you set (fitness function).

About the Fitness Function:

This is your criterion for the strategy's success.
It can include not only profit but also drawdown, number of trades, stability of results, etc.


Technical details for installation:

In order to take advantage of optimizing your advisor using MT5 Optimization Booster, you will need to make a few minor changes to the advisor's code.

At the very top of the advisor's code, you need to insert (marked here and below in green) the call to the imported functions from the Booster. Your code will look something like this:

//+----------------------------------------------------------------------------+
//|                                                  Copyright 2024, Your Name |
//|                                       https://login.mql5.com/en/users/user |
//+----------------------------------------------------------------------------+
#property copyright "Copyright 2024, Your Name"
#property link      "https://login.mql5.com/en/users/user"

//------------------------------------------------------------------------------
#import "..\..\..\Market\MT5 Optimization Booster.ex5"
void AddRange     (double rangeMin, double rangeStep, double rangeMax);
bool AddRangeDone ();
bool GetInputs    (double &inputs []);
void SaveResult   (double ff);
#import
//------------------------------------------------------------------------------

The code above is designed to call the Booster functions (which is by default located in the \MQL5\Experts\Market\ folder) from the advisor. If you have moved the Booster to a different folder, please adjust the path to it in the code above.

Next, insert a line in the code with the counter parameter, which will iterate through the built-in optimizer instead of your parameters:

//------------------------------------------------------------------------------
input int    CNT_P   = 0;
//------------------------------------------------------------------------------
Let's assume that the advisor has the following parameters that need to be optimized:
//------------------------------------------------------------------------------
enum Timeframe
{
  M1, M5, M15, H1, D1
};

input Timeframe ChartTimeframe  = H1;
input int       IndPeriod       = 10;
input double    IndAlpha        = 0.1;
input bool      UseTrailingStop = true;
//------------------------------------------------------------------------------

Make these parameters simple global variables by removing 'input' before their declaration; after this operation, the code will look correct like this:

//------------------------------------------------------------------------------
enum Timeframe
{
  M1, M5, M15, H1, D1
};
/*
input Timeframe ChartTimeframe  = H1;
input int       IndPeriod       = 10;
input double    IndAlpha        = 0.1;
input bool      UseTrailingStop = true;
*/
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
Timeframe ChartTimeframe  = H1;
int       IndPeriod       = 10;
double    IndAlpha        = 0.1;
bool      UseTrailingStop = true;
//------------------------------------------------------------------------------
Next, insert the following code at the very beginning of the OnInit() function:
//——————————————————————————————————————————————————————————————————————————————
int OnInit ()
{
  //For EA in the "Optimization" mode-------------------------------------------
  if (MQLInfoInteger (MQL_OPTIMIZATION))
  {
    AddRange (0, 1, 4);                //Timeframe ChartTimeframe  = H1;
    AddRange (6, 3, 30);               //int       IndPeriod       = 10;
    AddRange (0.0001, 0.0000001, 0.2); //double    IndAlpha        = 0.1;
    AddRange (0, 1, 1);                //bool      UseTrailingStop = true;

    if (!AddRangeDone ())
    {
      return INIT_FAILED;
    }
  }
  //----------------------------------------------------------------------------

In the AddRange() function, pass the optimization parameters for the corresponding optimized parameters (minimum range, step, maximum range). This code will instruct the Booster on the configuration of your optimized parameters. You can set the range and step values within any limits; there are no restrictions.

Next, insert the following lines of code immediately after the previous ones described above:

//——————————————————————————————————————————————————————————————————————————————
int OnInit ()
{
  //For EA in the "Optimization" mode-------------------------------------------
  if (MQLInfoInteger (MQL_OPTIMIZATION))
  {
    AddRange (0, 1, 4);                //Timeframe ChartTimeframe  = H1;
    AddRange (6, 3, 30);               //int       IndPeriod       = 10;
    AddRange (0.0001, 0.0000001, 0.2); //double    IndAlpha        = 0.1;
    AddRange (0, 1, 1);                //bool      UseTrailingStop = true;

    if (!AddRangeDone ())
    {
      return INIT_FAILED;
    }
  }
  //----------------------------------------------------------------------------

  //For EA in all modes---------------------------------------------------------
  double inputs [4];

  if (!GetInputs (inputs))
  {
    return INIT_FAILED;
  }
  else
  {
    ChartTimeframe  = (Timeframe)inputs [0];
    IndPeriod       = (int)inputs       [1];
    IndAlpha        = inputs            [2];
    UseTrailingStop = inputs            [3];
  }
  //----------------------------------------------------------------------------

The code above retrieves the values of the optimized parameters from the file into the array "inputs[4]" (where 4 is the number of optimized parameters).

Assign the value of the "inputs" array to each variable of the optimized parameter in the same order as when you specified their range and step, as shown above.

Check that the code for the OnInit() function should now look like this:

//——————————————————————————————————————————————————————————————————————————————
int OnInit ()
{
  //For EA in the "Optimization" mode-------------------------------------------
  if (MQLInfoInteger (MQL_OPTIMIZATION))
  {
    AddRange (0, 1, 4);                //Timeframe ChartTimeframe  = H1;
    AddRange (6, 3, 30);               //int       IndPeriod       = 10;
    AddRange (0.0001, 0.0000001, 0.2); //double    IndAlpha        = 0.1;
    AddRange (0, 1, 1);                //bool      UseTrailingStop = true;

    if (!AddRangeDone ())
    {
      return INIT_FAILED;
    }
  }
  //----------------------------------------------------------------------------

  //For EA in all modes---------------------------------------------------------
  double inputs [4];

  if (!GetInputs (inputs))
  {
    return INIT_FAILED;
  }
  else
  {
    ChartTimeframe  = (Timeframe)inputs [0];
    IndPeriod       = (int)inputs       [1];
    IndAlpha        = inputs            [2];
    UseTrailingStop = inputs            [3];
  }
  //----------------------------------------------------------------------------

  /*
  Here is the rest of your advisor's code.
  ...
  ...
  ...
  */

  return (INIT_SUCCEEDED);
}
//——————————————————————————————————————————————————————————————————————————————

In the OnTester() function, write the code for your custom optimization criterion or use the built-in function to obtain the value of the composite optimization criterion. The code for the OnTester() function will look like this:

//——————————————————————————————————————————————————————————————————————————————
double OnTester ()
{
  double ret = TesterStatistics (STAT_COMPLEX_CRITERION);
  
  //-----------------------------------------------------------------------------
  SaveResult (ret);
  //-----------------------------------------------------------------------------
  return ret;
}
//——————————————————————————————————————————————————————————————————————————————

The code above calculates the optimization criterion and saves the result to a file so that the Booster can retrieve the result and improve it in search of the best parameter values.

So, no further modifications to the advisor are needed.

Working with Booster

  1. Enter the MT5 optimizer (tester) and set the start and end dates for the optimization on history, as well as all other necessary parameters (symbol and others).
  2. Set the optimization mode (slow, full parameter search), as the optimization will now be managed by the Booster and the optimization criterion (Maximum of the custom criterion).
  3. Go to the advisor's settings and check the box for the CNT_P parameter, setting the values and step in such a way as to ensure the required number of runs.

 

  1. Start the optimization by selecting all local agents. If there are 4 or fewer CPU cores, it is recommended to leave one agent turned off.
  2. Run the Booster on any chart of any symbol and any timeframe. The Booster will display a window prompting you to select the folder of the advisor that needs to be optimized. Select the advisor's folder, and the Booster will begin its work! After that, a Booster window will appear on the chart:


The Booster window displays its activity in red (running counter), the best found result, the number of submitted tasks, and the number of completed tasks, as well as the number of completed tasks on each agent.

  1. If the results are satisfactory, you can stop the optimization at any time: First, stop the MT5 optimizer, and then stop the Booster by clicking the close button.

If you run the advisor prepared according to the above recommendations on the chart, the advisor will read the best settings prepared after the optimization by the Booster and will begin its work.

Now you have access to any number of optimized parameters, ranging from simple advisors to the most complex neural networks. An example of the terminal's appearance when using the Booster is shown below:

Frequently Asked Questions

How long does optimization take?

  • It does not depend on the number of parameters.
  • It depends on the power of your computer.
  • It depends on the execution speed of your advisor's code.
  • Use the maximum number of available CPU cores.

How can I tell if the result is good?

  • Check the stability of the results over different periods.
  • Evaluate all trading metrics, not just profit.

Wishing you success in optimization and achieving the best results in trading!

A time-limited Booster file until 2025.01.20 is attached below: