Knowledgebase: MetaTrader 4 Tutorials
Strategy tester
Posted by on 14 May 2014 04:43 PM

Strategy tester

 

MetaTrader 4 is the most popular trading platform these days which allows a trader to perform trading operations and technical analysis for the Forex markets, CFD, and Futures.

There is integrated MQL languages program (MetaQuotes Language 4) in  MetaTrader 4  which allows traders to create their own indicators, experts and strategy testers through which traders have an opportunity to test their individual strategies on historical data.

Find the “View” menu at the top-left side of your terminal then select “Strategy Tester” option.

 Execution of this command is the same as pressing the  button of the charts toolbar or using the shortcut keys <Ctrl+R>.

To test and optimize experts, a special "Tester" window is used in the terminal. You can set all  parameters in the "Settings" tab of this window.

 - In “ Expert Advisor” part, select the Expert Advisor to be tested in this list.

 - In “Symbol” option, choose the currency pair that you want to test.

 - In “Model” part, select the method of bars modeling:

 ·Every tick (based on all available least timeframes with fractal interpolation of every tick).

·Control points (based on the nearest less timeframe with fractal interpolation of 12 control points).

·Open prices only (fastest method to analyze the bar just completed).

- Spread— the price history stored in the client terminal includes only Bid prices. On default, to model Ask prices, the strategy tester uses the current spread of a symbol at the beginning of testing. However a user can set a custom spread for testing in the "Spread" field.

-Use date — use range of dates when testing. If this option is enabled, the data from the given range will be used during testing. Otherwise, all available data for the given symbol and period are used.

- Visual mode — enable the mode of the visual displaying the test process on a graph. You can adjust the speed of the testing visualization using the lever located to the right. You can also specify a date in the "Skip to" field to skip visualizing the test till that date.

- Optimization — enable the expert parameters optimization mode. More details about expert parameters optimization can be found in the section of the same name.

- Expert properties — open the "Expert Properties" window with tabs - “Testing”  "Inputs" and "Optimization" which allows you to manage the expert parameters while testing and optimizing as the following picture shows.

- Symbol properties — view the symbol parameters. These data are given in the *.FXT file heading and used to emulate the server operation.

- Open chart — create a new chart window for the symbol selected for testing. When being tested, the expert works with a virtual chart. Signs of opening and closing of positions, objects and indicators used by the expert, are imposed in this chart. This chart can be opened only after the expert has been tested. For opening a virtual chart, the TESTER.TPL template is used, and, if it is not available, the default settings are used. You can also give a template the same name as that of an Expert Advisor. In this case, that exact template will be used when opening the chart of the Expert Advisor.

- Modify expert — open the "MetaEditor" and start to edit the selected expert. This is useful if there is a need to introduce small changes and recompile the expert fast.

- Start — start testing or optimization. After this button has been pressed, one can estimate the speed of testing or optimization in progress bar in the lower part of the window. After the testing has been started, the "Start" button will be replaced with the "Stop" button. Having pressed this button during testing/optimization, one can stop the process.

 

As it was mentioned before the "Tester" is a multifunctional window which allows traders to test their strategies and optimize parameters of Expert Advisors.

Click on the “Start” button in order to make Strategy Tester command.

There are several tabs in this window:

 

- Settings — settings of testing and optimization. The parameters of expert advisors, period to be tested, the method of bars modeling, and many other things, can be set up in this tab.

- Optimization Results — information about every pass, including inputs, profitability, drawdowns, and other data.

- Optimization Graph — the results of expert optimization as a graph. Besides each pass profitability, the amount of profit and loss trades is displayed in the graph.

- Results — the results of trade operations performed by the expert, as well as the direction of balance changes.

- Graph — displaying testing results in a graph.

- Report — the detailed testing report. Many indications of testing and effectiveness of experts can be found here: the amount of bars modeled, the total profit, the most profitable and unprofitable positions, the amount of profit and loss trades, etc.

- Journal — a log where all actions and internal messages of the expert are recorded.

 

 

In case you don't find the answer for a question that interests you in this section or in the Knowledgebase, please contact the Client support department via live chat or request for a callback.

(0 vote(s))
Helpful
Not helpful

Comments (0)