Libraries: MultiTester - page 33

 
Hello, very useful thing, you also have a portfolio tester, where you can add reports into one, also very useful thing, but I have this idea - are you not planning to combine these two tools, and make an automatic portfolio optimiser? So that the results of optimisation would be evaluated immediately as part of the portfolio with the same results - so that there would be no correlation on drawdowns and so on, with the target function of the whole portfolio by Sharpe or recovery factor, and additional filters, by the number of trades, for example. It would reduce a lot of manual work and time, now the results of optimisation need to be combined into a portfolio manually, and when there are hundreds of them....
 
How to get the input parameters of a specific run from this library? TESTERCACHE Cache; Cache[i] inputs
 

Hello!

Last December I ran your library and ran optimisation on 100+ custom characters.

Today I tried to run it again, but the only error in the tester log is "optimisation cannot be started". I updated the library.

I tried running on different symbols, tried running your MultiTester_example, tried different builds of Metatrader 5, different optimisation settings, tried running on a regular Moving Average Expert Advisor, still this error occurs, I have not found any more detailed logs. Could you please tell me if someone has had something like this? How can it be fixed?

 
Jekamajor #:

the only error in the tester's log is "optimisation cannot be started".

What is the response to starting optimisation manually?
 
fxsaber #:
What is the response to running the optimisation manually?


Manual optimisation is started, executed, terminated without errors. Screenshot of logs. At the top is the launch of optimisation by simple Moving Average, below is the launch with the same parameters but through the library.

 
Jekamajor #:

below is the launch with the same parameters but through the library.

Why does this Expert Advisor run in the Tester itself? It is thrown to the Terminal chart, not to the Tester.

 
fxsaber #:

Why does this Expert Advisor run in the Tester itself? It is thrown to the Terminal chart, not to the Tester.

Yes, indeed! I've forgotten how to launch it for a year. By dragging it to the chart it starts and works. Thank you very much for your help!
 
Please post an example of how to write code for multiple sequential optimisations that take different input parameters.
 
Soroush Kheradmand #:
Please post an example of how to write code for multiple sequential optimisations that take different input parameters.

#include <fxsaber\MultiTester\MTTester.mqh>    // https://www.mql5.com/ru/code/26132

#define _CS(A) ((!IsStopped()) && (A))
#define  PAUSE 200

void Run( const string Settings )
{
  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);

  MTTESTER::CloseNotChart();
    
  if (_CS(MTTESTER::SetSettings2(Settings)))
    MTTESTER::ClickStart(false);

  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);
}

void OnStart()
{
  string Settings[] = {"[Tester]\n" +
                       "Expert=Input_String_Example_Alternative.ex5\n" +
                       "Symbol=EURUSD\n" +
                       "Period=M1\n" +
                       "Optimization=2\n" +
                       "Model=4\n" +
                       "FromDate=2023.01.01\n" +
                       "ToDate=2024.01.01\n" +
                       "ForwardMode=0\n" +
                       "Deposit=1000000000\n" +
                       "Currency=USD\n" +
                       "ProfitInPips=1\n" +
                       "Leverage=100\n" +
                       "ExecutionMode=0\n" +
                       "OptimizationCriterion=6\n" +
                       "[TesterInputs]\n" +
                       "inAmount=1||1||1||10||N\n" +
                       "inCount=2||2||1||20||N\n" +
                       "inPeriod=3||3||1||30||N\n" +
                       "inKoef=4.56||4.56||0.456000||45.600000||N\n" +
                       "inLog=7.89||7.89||0.789000||78.900000||N\n" +
                       "inFlag=true||false||0||true||N"
                      };

  for (uint i = ArraySize(Settings); (bool)i--;)
    Run(Settings[i]);
}

Tester settings are saved via CTRL+C/V. You can save them to separate files, and then fill the Settings[] array in the source above with data from them.

 

Is there any easy way to make the data into an array? I need to add 20 set files, each of 108 lines so 2160 lines to add " " + manually to make them an array?

Loading set files personally would be my preferred option, "D:/\MT5Tester2\MQL5\Profiles\Tester\MTester\MT5 v1.14 bat XU BB+ENV+RSI.set" etc etc etc but I am a mere mortal and don't know how to code any of this stuff. Your EA is very cool but crikey :D

#include <fxsaber\MultiTester\MTTester.mqh>    // https://www.mql5.com/ru/code/26132

#define _CS(A) ((!IsStopped()) && (A))
#define  PAUSE 200

void Run( const string Settings )
{
  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);

  MTTESTER::CloseNotChart();
    
  if (_CS(MTTESTER::SetSettings2(Settings)))
    MTTESTER::ClickStart(false);

  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);
}

void OnStart()
{
  string Settings[] = {[Tester]
                        Expert=MT5 White Rabbit v1.14.ex5
                        Symbol=XAUUSD
                        Period=M5
                        Optimization=2
                        Model=4
                        FromDate=2023.02.01
                        ToDate=2024.10.01
                        ForwardMode=0
                        Deposit=20000
                        Currency=USD
                        ProfitInPips=0
                        Leverage=100
                        ExecutionMode=200
                        OptimizationCriterion=6
                        [TesterInputs]
                        OnTester=------------ On Tester ------------
                        MinTrades=60||120||1||1200||N
                        MaxEquityDrawdown=3.0||20.0||2.000000||200.000000||N
                        CustomMax=------------ Custom Max ------------
                        EA_Expires=2024.12.25
                        Enable_Buy=true||false||0||true||N
                        Enable_Sell=true||false||0||true||N
                        TRADE_TIMES=------------ TIME SETTINGS ------------
                        StartTime_1=1||1||3||10||N
                        Stop_Time_1=9||9||4||21||Y
                        Monday=true||false||0||true||N
                        Tuesday=true||false||0||true||N
                        Wednesday=true||false||0||true||N
                        Thursday=true||false||0||true||N
                        Friday=false||false||0||true||Y
                        Weekend=false||false||0||true||N

                        // next set
                        [Tester]
                        Expert=MT5 White Rabbit v1.14.ex5
                        Symbol=XAUUSD
                        Period=M5
                        Optimization=2
                        Model=4
                        FromDate=2023.02.01
                        ToDate=2024.10.01
                        ForwardMode=0
                        Deposit=20000
                        Currency=USD
                        ProfitInPips=0
                        Leverage=100
                        ExecutionMode=200
                        OptimizationCriterion=6
                        [TesterInputs]
                        OnTester=------------ On Tester ------------
                        MinTrades=60||120||1||1200||N
                        MaxEquityDrawdown=3||20.0||2.000000||200.000000||N
                        CustomMax=------------ Custom Max ------------
MultiTester
MultiTester
  • www.mql5.com
Множественные прогоны/оптимизации в Тестере.