Backtesting of several parameters sets after an optimization?

 

Hello

I am using MT5 for optimizing my own Expert Advisors.

After you get the optimization's result, there may be several parameter sets that match your choosing criteria to select some of them for backtesting check up. I export the optimization report to Excel in order to filter those that are satisfying my selection criteria. At the end of the process, I have several parameter sets for backtesting. One by one, I check up all of them to get more detailed result for both baackward and forward testing. This become in a tedious process for each EA, TF, PAIR, etc.

Is it posible to automate the backtesting of the several parameter sets? I mean. I have n parameter sets for backtesting. I choose them in the optimization report and start a backtesting batch process. After each backtest, it is saved a backtest & forward result report (Excel, HTML) in any folder you choose. So in this way you will have as many backward/forward reports as parameter sets you have chosen.


Thanks


regards


Jose 

 

https://www.mql5.com/en/code/18801

Report
Report
  • votes: 23
  • 2017.11.03
  • fxsaber
  • www.mql5.com
This library is a revised version of an excellent script released in 2006, adjusted with modern MQL possibilities in mind. Some features have been removed, and new features have been added. In both platforms (MetaTrader 4/5), you can run the following script to save a report (in the form of MetaTrader 4): and see a generated HTML report in the...
 
josecort_trader:

Is it posible to automate the backtesting of the several parameter sets?

You can run the tester through command line.

So, you could write automation code to invoke the tester (through command line) for each parameter set. It could be done.

Start here: https://www.mql5.com/en/forum/127577

 
fxsaber:

https://www.mql5.com/en/code/18801


Hi fxsaber


Thanks for your answer.


Please, could you be so kind to explain where I have to add the code into the EA: at the beginning or the end? Because I am using a builder to get the EA. I am not very familiar with the MQL5 programming.

 
Anthony Garot:

You can run the tester through command line.

So, you could write automation code to invoke the tester (through command line) for each parameter set. It could be done.

Start here: https://www.mql5.com/en/forum/127577


Hi Anthony


Thanks to your suggestion I have found XML called as the EA optimized files inside \tester\cache directory (back and forward testing files). Those files contain the individual backtest for each parameter set. It is not specified the number of pass for the backtest but I think that is posible to connect the optimization report with the XML file to have the right info for each back or forward testing.


Thanks for your help.

 
josecort_trader: Because I am using a builder to get the EA. I am not very familiar with the MQL5 programming.
EA builder, fxDreema, EATree, FxPro Quant, MQL5 Wizard, etc. are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
  • Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
    If we tell you what you need, you can't code it.
    If we give you the code, you don't know how to integrate it into yours.
    We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

  • EA builder makes bad code counting up while closing multiple orders.
    EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
    EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
    EA builder makes bad code, not adjusting for ECN brokers. (pre-Build 500)
    EA builder makes bad code, not checking return codes.
    EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
 
josecort_trader:


Hi fxsaber

Thanks for your answer.

Please, could you be so kind to explain where I have to add the code into the EA: at the beginning or the end? Because I am using a builder to get the EA. I am not very familiar with the MQL5 programming.

Automatic saving of reports in the tester at the end of a single test and during optimization.

At the end of a single run in the tester, the library can automatically save a report on testing results of any Expert Advisor. Add to the EA source code the following lines:

#define REPORT_TESTER // Reports will be automatically written in the tester
#include <Report.mqh>

The same lines will enable saving of reports of each optimization run.

It allows you to immediately evaluate results without waiting for the optimization completion. After the end of optimization, you will not need to launch separate tests and wait for results. It allows you to visually evaluate all results calculated by the optimizer. Balance graphs (PNG files) of multiple separate runs can be shown on one chart as thumbnails.

Reason: