Tester Benchmark
Info
The Tester Benchmark is a Library for MetaTrader 5 that the metatrader 5 provides an excellent function for profiling expert advisors on historical data. But it has some disadvantages: it is slow (in the visual mode), and the final result is presented in relative units, i.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Library works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Libraries folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Tester Benchmark
1. Storage: Place library files in the MQL/Libraries directory to ensure they are accessible to your projects.
2. Implementation: Include the library in your code using the #import directive, ensuring you match the exact function names and parameters.
3. Compilation: Ensure the library is present in the directory before you compile your main EA or script, as the compiler links them during this phase.
4. Management: Keep libraries organized in sub-folders if you manage many custom functions to maintain a clean project structure.
Frequently Asked Questions
Q: What is a library file used for? A: Libraries store reusable code modules, allowing you to centralize common logic used by multiple EAs or indicators.
Q: Is a library executable? A: No, libraries are non-executable files containing functions; they must be imported into an EA, indicator, or script to function.
Q: Can I update a library while the platform is running? A: You should compile your EA or script after updating a library to ensure the latest code changes are integrated.
What this tool does
The MetaTrader 5 provides an excellent function for profiling Expert Advisors on historical data.
Typical Use Case
This Library excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Library works on MetaTrader 5. Place the file in the MQL5/Libraries folder and restart the terminal.
Description & Settings
Related: Making and Saving Graphic Charts from the MT5 Strategy Tester - another powerful library for MetaTrader 5 traders.
Also recommended: Benchmark - similar library with strong performance on MetaTrader 5.
The MetaTrader 5 provides an excellent function for profiling Expert Advisors on historical data. But it has some disadvantages: it is slow (in the visual mode), and the final result is presented in relative units, i.e. it is not possible to compare performance in absolute terms.Also, in MetaTrader 5, the EA is executed on a local Agent even during a single run without visualization. Sometimes a large part of testing time is taken to synchronize the terminal with a corresponding local agent. Therefore, time data from the following lines
are a poor representation of the net EA/tester performance, and can differ much in different runs.
The net operation time of the Strategy Tester is the time from the first Tick event (the first OnTick) till the last tick in the tested interval.
Immediately after this interval, the tester calls OnTester (followed by OnDeinit).
The net time of a testing run in the Strategy Tester
The library allows adding to the EA code one line
and to obtain in logs the data on the tester's net performance.
Moreover, if in the tester you switch from a single run to an optimization mode (there is no need to specify optimization ranges for MetaTrader 5), the library will run the EA for the specified number of times and will generate the tester performance statistics, based on which you can understand the pure performance of the tester.
In this case, it is clear that there were two starts on the same local Agent. The minimum, maximum and average calculation time is shown. The total time of optimization (Interval) is also shown. The percent characteristics (83.89%) shows how much of the total optimizer time is taken on the average by the pure operation of the tester (time required for synchronization with Agents is taken into account).
OnTick profiling
By adding one more line
you can see time spent on the execution of OnTick, not taking into account time taken to simulate trading environment, performance, etc.
Example
The library is provided with an example EA (MQL4/5) with a header, which helps to understand one of the practical applications of the library.
You may also like: Reporting Memory Leaks in Strategy Tester - excellent alternative for library users on MetaTrader 5.
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.