How to test an Expert Advisor on history in MT4. How to test Expert Advisors in MT4 correctly? Automatic testing of Forex strategies How to backtest an Expert Advisor
The functionality of the MetaTrader4 (MT4) platform, thought out to the smallest detail, allows you to easily test any Forex trading robot, determining even before it is installed on a real account or demo, whether it is worthy of your attention, or whether it belongs in a landfill. The test will show the abilities of almost any robot! And today we will take a detailed look at how to test trading advisors in the MT4 strategy tester.
Preparation of a separate MT4 terminal
And the first thing to start with is to get a separate MT4 platform for testing advisers. It doesn't matter in principle from which forex broker you borrow a platform for these purposes, since most brokers get their quote history from Meta Quotes resources. Immediately after you install a separate “test” terminal on your computer, through the “service” menu on its central console, go to the “Quotes archive” submenu and download the full archive from M1 for the trading instruments whose quotes you are going to use for testing to D1. And it is desirable that there is about 20 GB of free space on the “C” drive of your PC, since these archives take up a lot of space.
And one more important point: the direct test of the adviser is best done when the Internet is disconnected, so that in case your MT4 wishes to update the history, new quotes (which are usually downloaded in the “lite” version) do not “overwrite” the detailed quotes that you previously downloaded for testing.
As mentioned above, any testing of a trading advisor should be carried out on a separate MetaTrader4 terminal installed for these purposes and, of course, on a demo account. Therefore, if you did not have time to register a trading account immediately after installing MT4, use the "Navigator" button to go to the section for opening a trading account and, using the platform's prompts, register a new demo account:
Now that we have finished with the preparation of MT4, let's get down to the testing process. Let's consider in detail how you can effectively test an Expert Advisor.
How to achieve 99% simulation quality
The higher the percentage of simulation, the better the result will correspond to the real capabilities of the tested trading robot. If during the testing of the Expert Advisor you got the modeling quality below 80%, the test results can be considered superficial. They must be taken into account when making a decision to install a trading robot on a real account. You must achieve quality results of at least 90%. Ideally, this is 99%. This is the result you can trust. However, let's not forget that the profitability shown in the past does not at all guarantee that the trading robot will trade in a similar way in the future. However, if the robot shows profitability in the past, this is still at least some guarantee that we are dealing with a profitable trading expert. We encourage you to think the same way!
Important! In order to get the most accurate tick data, at which 99% simulation quality is possible, it is better to use the Dukascopy quotes history, which TickStoryLite will help you download.
1. In order to test the trading robot, open the strategy tester via the MT4 central console button:
2. Select the type of testing "Expert Advisor" and its name in a separate drop-down window of the tester:
3. We select the timeframe of quotes on which we are going to carry out testing and the size of the spread (we leave the "current" one):
4. If necessary, through the button of the tester "expert properties" you can change the parameters of the trading adviser by setting the size of the trading deposit and the direction of trading of the adviser:
as well as trading parameters of the Forex expert (size of transactions, levels of stops and takes, parameters of indicators used, etc.):
5. And, finally, we select the testing period of the Forex expert by setting the time interval in the tester where you want to “run” the trading robot:
6. Click on the "START" button in the right corner of the tester and wait for the platform to test the operation of the trading robot.
Evaluation of results
After the strategy tester runs the Forex expert over the time interval you specified with the specified expert parameters, you will receive the testing result. It is best to consider test results saved as a report. To do this, go through the "Results" tab and by clicking on any of the transactions RMB, save her like a father t. After that, you will see a similar report window:
We will not analyze all the parameters. Let's consider only the most important ones.
Evaluation of the results of the adviser
- Profitability test - demonstrates the ratio of the trading profitability of the Expert Advisor to the resulting losses. The higher the resulting number, the higher the profitability of your Forex Expert Advisor - less losing trades, more correct inputs. Profitability of more than 1.1 is considered normal
- Test "Expectation of winning"– average income per trade on the history of testing.
- If you use a lot size of 0.01 when testing, then the resulting number for the "expectation of winning" parameter will correspond to the average number of profitable points in transactions. Which is quite convenient when evaluating the effectiveness of a Forex Expert Advisor.
- Test "Maximum Drawdown"- this is the percentage of the loss of the deposit during the trading history. The general allowable drawdown is 20%. If the trading expert trades with a larger drawdown, such trading will be considered very risky.
- Test "Percentage of profitable trades"- the resulting number must be compared with the parameter obtained in the history of the average profitability and average unprofitability of transactions. By comparing these parameters, you will analyze the work of your Forex Expert Advisor more effectively.
Important! You must understand that the tester drove the robot through history in the past, but could not look into the future. And this means that the profitability shown by the adviser and the result obtained in the future in real trading may not correspond to each other.
Also, the longer the period of testing history, the more confidence in the results obtained. Like any trading strategy that can show almost brilliant results on one interval, it can drain your trading account on another section of the quotes chart. Therefore, when testing a trading advisor based on a trading strategy, try to test it for a long period of time, and then evaluate in detail how its profitability and drawdown parameters change in different market situations.
As a result of testing the adviser through the strategy tester, with normal simulation quality, you will get a clear picture of what the trading robot is capable of, what profit can be expected and at what risks it can be obtained. And remember the most important thing - after testing trading expert in the strategy tester and until the moment it is installed on a real account, you should definitely try its work on a demo. Only after this the robot can be moved to "real".
Many traders who trade on financial market FOREX, over time, come to the desire to test a trading advisor. This automatic assistant allows trading without constant presence at the terminal. But first you need to test it on the past history to make sure it's up to date.
TOP 3 Forex brokers in the world:
- the level of the desired ”take profit”;
- the number of traded lots;
- required ”trailing stop” data;
- and other initial characteristics of the adviser, under which it functions correctly.
You can use the attached template file by downloading it accordingly. Then you do not need to set the input data manually each time, but simply download and save it to your computer once.
8. After all installations and downloads, click OK. A laughing smiley should appear in the corner of the graph.
If such a smiley does not appear, then you need to select the "general properties of the adviser" and check the boxes in the windows indicated in the screenshot:
Don't forget to set the button in green.
Testing
To check the functionality automatic advisor, you need to test it on past currency charts - historical data. For this purpose, we use a tester advisor installed in the working terminal.
Not all brokers have adequate historical data. For reliability, it is better to download them from the Ducascopy quote provider. You can use the old quotes provided by MetaQuotes in every MT4 trading terminal, but there are gaps, omissions or other errors.
As a result, ceteris paribus, there may be different results on different historical data. Therefore, for maximum reliability, it is better to test three times in order to have an average correct result.
How to test an Expert Advisor in MT4
In order to test the trading robot, you need to perform a number of actions.
Login to Adviser Tester
Before starting all actions, you need to set the required settings, for which select on the terminal panel: Service - Quotes archive:
a window for terminal settings will appear:
In the "Charts" tab, you need to fill in the data for the maximum number of history bars and enter similar numbers in the window of the financial instrument on which test trading will be carried out (1000000000 in the corresponding tabs).
Terminal tester. Main functions
To simulate the work of a trading advisor, you need to open the corresponding position on the MT4 panel:
.
A panel will appear at the bottom of the trading terminal screen:
This part of the terminal has the following functions.
At the top left there are buttons to switch the adviser and indicator:
In versions of MT4 released after 2014, developers have created the ability to study the work of indicators and advisers visually.
Also, a separate button appeared for testing indicators. Select the Expert Advisor testing button:
Number 1 contains a list of available automatic advisors, uploaded by the trader to the terminal on their own.
Number 2 - the list of currency pairs on which the work will take place. It is assumed that for these financial instruments the quotes archive has already been uploaded.
Number 3 - the proposed function allows you to select the desired trading model for automatic testing. To check any financial strategy an adequate option for creating price bars is needed. The terminal offers only three ways:
- at opening prices (a simple variant on formed candles);
- by reference points (based on the available shorter time period);
- all bars (the most accurate model based on possible time periods, but may use more power and cost more).
Number 4 - use calendar data. Opposite the desired numbers for the start and end of automatic testing, put a checkmark
Number 5 is the visualization function.
Right side of tester screen panel:
Period- determination of the testing time interval.
Spread- any value is set or the existing one from the broker for a pair of currencies is applied.
« Change adviser» must be pressed when it is planned to reprogram the adviser if the source code is available.
« Open Chart» – click if the testing work has already been completed.
« Symbol Properties»:
This button does nothing, it just displays background information for the tested financial instrument.
« Expert Properties”: using this button brings up a window with three suggested lines: “Testing”, “Inputs” and “Optimization”.
The "Testing" tab allows you to set the currency and amount of financial capital with which the work will be carried out:
Window "Input parameters":
This panel contains all the key data of the automatic adviser, which are usually loaded along with the robot in the -.set format. You need to set the appropriate settings and run the function - "Download".
Test results
After setting all the settings, you can click "Start". After a while, a beep will sound, indicating that the test has been completed.
It is necessary to pay attention to the lower corner on the left:
The "Result" button will show all trades that the Expert Advisor made during the test.
The "Chart" button will show the EA's profitability curve.
The "Report" button will show the statistics of the work of the advisor for a certain period:
- "Bars in history" - the number of data that show how far back in history the testing took place;
- "Modeled ticks" - the number of bars that participated in the simulation. Each tick represents one bar at a particular moment;
- "Quality of modeling" - the level of the required model;
- "Chart mismatch error" - failures that may appear when ticks appear for different time periods. In case of such errors, you need to reload the historical data;
- "Initial deposit" - financial capital with whom the expert worked;
- "Spread" - the value of the spread during the operation of the automatic adviser;
- "Total profit" - the entire amount of income for the period of work of the Expert Advisor;
- "Total loss" - the amount of losses for the full time of the test work of the financial automatic adviser;
- "Net profit" - all income received minus losses incurred during the experiment;
- "Profitability" - the ratio of profit to loss;
- "Expectation of winning" - statistical expectation of a positive result;
- "Absolute Drawdown" is the difference between initial capital and the lowest value of the deposit for the period of testing;
- “Maximum drawdown” is the maximum difference between the initial capital and the minimum deposit value during the financial simulation.
The maximum drawdowns are indicated in the figure under the numbers 1, 2, 3.
If you hover over the report and right-click, you can get a report file in the html hypertext markup language:
This document contains all the information on the testing - time, currency, model, parameters of the adviser. There are also test statistics and a yield curve. A table of past transactions is also presented.
If the automatic expert did not have any financial transaction, you need to look for the error in the "Journal" application.
Imaging mode
In this mode, it is possible to see how the testing is going in an accelerated version.
This simulation allows you to understand the algorithm of the adviser, since you can set the desired indicator, and the transaction report will be more visual. Also, in this mode, it is proposed to carefully review specific individual areas of testing, which are of additional interest.
An automatic expert in the visualization mode helps to better understand the principles of its operation and predict further actions. As a result, it turned out to be a successful tool for traders.
The article discusses all stages of testing an automatic adviser - from loading the MT4 terminal, the robot itself, historical data, to carrying out the process of the adviser itself.
The presented technology is only the basis of the work, because in order to make money with the help of a trading robot, it is necessary to carry out work on its modernization. There is such a stage of work as the optimization of forex advisors. This is the next stage of modernization, requiring more subtle settings and complex manipulations.
In addition, the process described in the article is suitable for H1 timeframes and higher. Scalpers trading on small time intervals, this method testing may not work. There are also higher levels of simulation that are not available for the regular MT4 terminal.
Today we will share the testing methodology and talk about some very important nuances when testing advisers in MT4.
Terminal preparation
The first thing you need is a separate terminal set up specifically for testing.
You can use Alpari. Open a demo account and download the terminal. It should be installed in a directory where there is at least 30-50 GB free, maybe more. The fact is that tick quotes take up a lot of space.
After installation, log in to a demo account, and then disconnect the terminal from the network. To do this, click Ctrl+O, and then everything is as in the picture:
If we specify this server, login and password, the terminal will not be able to connect to this proxy server, respectively, it will be "offline".
The terminal must be disconnected from the network so that during the testing process it does not accidentally overwrite the high-quality quotes that we uploaded to it.
We've finished with the terminal, it's time to deal with quotes.
Quotes and simulation quality 99%
The higher the quality of the simulation, the more the results of the received tests will be similar to real trading.
The MT4 terminal does not know how to store tick quotes, so the maximum that you can achieve under normal conditions is 90%
To achieve the best quality, we will use tick quotes from the Dukascopy broker. And the TickStory Lite program will help us download them.
What do tick quotes give
They almost completely imitate the real market with the exception of and . The results obtained in the strategy tester will be as close to the real ones as possible.
So, we installed TickStory Lite and checked the program's performance.
Now, regarding the correct testing of Expert Advisors. When exporting quotes from TickStory Lite to MT4, in the export settings you should remove spread and swap:
The spread creates an extra load on the deposit during testing, so even a profitable strategy can gravitate downwards. If you really want to discover the potential of any strategy, you should first test it without spread and swap. This is how we know the net effectiveness of the strategy without too much noise. And only then, when the strategy is fully studied, you can connect the spread and swap. This is the only and correct option for finding profitable ones, because. many of them are not able to cover the spread.
When the quotes are exported, you should run any Expert Advisor and check the quality of the simulation. If it is 99%, then everything is correct, you can move on.
Not all strategies are testable, but if you set a goal, you can test anything.
Those who already have an Expert Advisor can skip this section and go straight to testing.
Those who do not have it can use any free one or download it here.
You don't have to be a programmer to write your Expert Advisor. For example, you can use the Etasoft Forex Generator program, which easily creates frameworks for all Expert Advisors. It's old but still works great.
When developing Expert Advisors, it is important to set the right goals for yourself:
- Wrong target: " I want an Expert Advisor based on this + indicator, so that it can work steadily in plus.”
- Correct target: I want to know if this indicator works, and to understand whether it can be applied in practice”.
The difference is that in the first case, traders usually go in cycles and try to squeeze the desired profitability out of the Expert Advisor. But this doesn't happen.
Let's assume that the adviser is already there, let's move on to testing.
Before starting any tests, you can run this one, which opens deals in a random direction. If its results spin around zero, then the terminal and quotes are set up normally and the spread is disabled.
You can start testing the EA itself.
Step 1. If you have an Expert Advisor that trades on any indicator, install this indicator on an already prepared chart template.
This is necessary in order to further check the correct operation of the adviser.
Step 2 Set up the Expert Advisor, specify the testing period, date range, etc.:
Step 3 Run the first test by pressing the "Start" button. Some trades should appear in the "Chart" tab. If there are no transactions, then there are some problems with the adviser, see the “Journal” tab for more details. If everything is fine in the log, but there are still no deals, then you have set unrealistic criteria for entering a deal.
Step 4 Upon completion of the test, click on the "Open Chart" button. If you have previously prepared a template, then you will see a chart with the indicator that the EA trades on. Be sure to check the correctness of the adviser's inputs.
Step 5 If the adviser works correctly, you can start the selection optimal settings. For example, the size of SL, TP, lot size, criteria for entering a trade, etc. We carry out tests and choose the optimal parameters.
Step 6 We test other timeframes and currency pairs, draw conclusions from the data obtained
Evaluation of the results
The most important point that everyone usually forgets about.
Go to the tab "Results", RMB on any trade → Save as report t.
As a result, you will get the following report:
We will not analyze all the parameters, let's talk about the most important ones.
Profitability shows the ratio of total profit and total loss. The higher the profitability, the less false entries the trading system generates. Profitability of more than 1.10 can be considered normal.
Expectation of winning– average profit per trade.
If the Expert Advisor uses a fixed lot size of 0.1 lots, the expectation of winning will coincide with the average number of points received in each transaction. This is very convenient when comparing whether the EA will be able to cover at least the size of the spread.
In the picture above, the EA brings 4.6 pips per trade, which is clearly more than the spread.
Maximum drawdown- the maximum percentage of deposit loss for the entire testing period. The generally accepted maximum drawdown is 20%, try not to exceed this threshold.
Percentage of profitable trades– be sure to compare this parameter with the average profitable and losing trade. Using these data and , you can calculate the effectiveness of your Expert Advisor.
In general, test results should confirm or disprove your theories. If the Expert Advisor or pattern is not working, move on to the next one, and make a note to yourself, for example, that the RSI is not working. And so on ad infinitum, until you make a profitable trading system.
Today we will consider the issues of testing and optimizing advisers in the MT4 trading terminal.
The strategy tester will open in which we will test our Ilan16c_PipStepExponent_MFI_lock Expert Advisor.
In the top left tab of the strategy tester, select "Expert".
In the tab next to it, in the drop-down list, look for our adviser and double-click on its name.
In the tab below, select the symbol - currency pair, by which we want to test the EA. Let's have USDJPY.
We choose a testing model - we choose the most accurate method "Every tick". "Checkpoints" and "By opening prices" are models that are more suitable only for a cursory analysis of the work of an Expert Advisor.
Put a tick on "Use date" - set the interval. Let us have an interval from the beginning of 2015 to 2015.11.23.
The next item is Visualization.
You can check the visualizations, or you can not check them. A tick on the visualization means that you will see the entire process of testing the Expert Advisor on the selected history interval right on the chart.
We set the testing speed to the maximum - move the slider all the way to the right.
Pause/Play and Skip To buttons are also available.
We shift our gaze in the tester to the right.
We make a choice of the time period - on which we will test the robot. Let's have an M5.
Now let's open the Expert Advisor settings - click "Expert Properties".
Here we see the standard settings of the Ilan16c_PipStepExponent_MFI_lock Expert Advisor - we will test with them. You can change the settings of the Expert Advisor as you like and test it later. Any Expert Advisor can be tested an unlimited number of times and .
On the "Testing" tab, you can select the size of the deposit for testing and its currency, as well as specify which positions to open: buy and sell, buy only or sell only.
Let us have an initial deposit of 10,000 USD, and positions: purchases and sales (Long & Short) - this is how it should always be in the standard in MT4.
Attention: in order to test the EA on a decent history with high simulation quality, we need to load the quotes for the symbol used in the tests. In our case, we need to download USDJPY quotes.
This process is also useful for optimizing a trading Expert Advisor. The archive of quotes for any instrument needs to be downloaded only once.
How to download quotes archive in MT4?
In the uppermost menu of the terminal, click "Service" and then "Quotes archive". Or just press F2.
A window with quotes archives for available instruments will open.
We look for our symbol (our currency pair) USDJPY in the list and double-click on its name, and then double-click on “1 Minute”.
Click the "Download" button. The process of downloading all quotes for USDJPY will begin - for all timeframes.
That's it — all USDJPY quotes have been uploaded — now you can test and optimize expert advisors on all ticks.
We close this window and try to test our Ilan16c_PipStepExponent_MFI_lock Expert Advisor by pressing the Start button.
Quotes are loaded from the quotes archive.
What is the result? Draining the entire deposit.
As you can see, the standard settings are clearly not suitable for us - we will have to optimize this Expert Advisor.
Note: you can save any report to your computer - go to the sub-tab of the strategy tester "Report", where we display all the data about the passed test, and right-click in this window, and then "Save as report" - the report will be saved in HTML format .
Click "Expert Properties" and check the boxes next to the parameters that will take part in the optimization - we will check the boxes that are more significant for us.
Also, we put down opposite the parameters with checkmarks for their “Starts”, “Steps” and “Stops” - in simple terms, limit values from and to in increments.
On the "Testing" tab, you can select the size and currency of the deposit, as well as specify the types of positions to be opened: buy and sell, buy only or sell only.
An optimized parameter is a certain indicator, the value of which determines the quality of the tested set of input parameters. The greater the value of the optimization criterion, the better the test result is estimated with a given set of parameters. The following optimization options are available:
— Balance: optimization indicator is the maximum balance value;
— Profit Factor: the indicator is the maximum value of the profit factor;
— Expected Payoff: the indicator is the maximum value of the expected payoff;
— Maximal Drawdown: the indicator is the minimum drawdown value;
— Drawdown Percent: the indicator is the minimum value of the relative drawdown (in percent);
— Custom: when this parameter is selected as an optimization criterion, the value of the OnTester() function in the Expert Advisor will be taken into account. This option allows the user to use any custom metric for optimization.
A checkmark next to the genetic algorithm - it is recommended to leave it checked. If there is no checkbox, be sure to check it. If the checkbox is left unchecked, you will wait forever for the EA to be optimized, since absolutely all combinations of the EA's input parameters will be tried.
Tab "Optimization". It allows you to manage constraints during optimization. If any of the conditions is reached during a separate run, this EA run will stop. Optimization will continue from the next run.
To enable a limiting condition, you must select the appropriate checkbox to the left of it. By double-clicking the left mouse button in the "Value" field, you can change the existing parameter, after entering a new value, press the "Enter" key.
Limiting parameters include:
— Minimum balance: the minimum value of the balance in the deposit currency;
— Maximum profit: maximum profit in the deposit currency;
— Minimum margin level %: minimum margin level in percent;
— Maximum drawdown %: maximum drawdown in percent;
- Continuous loss: the maximum total loss in one series. A losing series is a series of consecutive losing trades;
— Continuous number of losing trades: the maximum number of losing trades in one series;
- Continuous win: the maximum total profit in one series. A profitable series is a series of consecutive profitable trades;
- Continuous number of profitable trades: the maximum number of profitable trades in one series.
After all the changes, click on the "OK" button.
Put a tick on "Optimization" and press "Start".
The optimization process has begun - as you can see from the screenshot, there will be 10,496 passes, with an optimization time of almost 175 hours . But we won’t wait that long — as soon as we see a great option / options (for example, with a solid profit and an acceptable drawdown), we can stop the optimizer.
Open the tab "Optimization results" and observe the process. Runs will line up vertically in a row. You can sort any cell - left-click on the header of the desired cell and sorting will be done in ascending order of values from top to bottom, click on the header again and there will be sorting in descending order of values from top to bottom.
I think 10 positive optimizer passes will be enough for an example. We stop the optimizer - the "Settings" tab, the "Stop" button.
So what do we see? We have several good passes, but the best one is the top one - the highest profit and the smallest drawdown of all 10 passes. We will take these settings.
Settings can be introduced into the Expert Advisor from the optimizer in two ways: double-click on the desired pass (left button) or right-click on the desired pass and then "Set input parameters".
Remember our adviser lost the entire deposit? Well, now we press the "Start" button and test the adviser with new optimized settings.
It's great, right? The settings turned out great.
We open on home page strategy tester "Expert Properties" and press the save button - we need to save this file with settings for ourselves, so that later it can be used with this Expert Advisor on different terminals at any time.
We choose where we will save the file and come up with a name for it, then click the "Save" button. In this case, the file will be saved to the desktop.
To embed any file with settings into the Expert Advisor in the Strategy Tester, click on the "Expert Properties" button and then "Load" - specify the path to the file, select the desired file with the mouse and click "Open". The settings will be integrated into the Expert Advisor - after that, don't forget to click the "OK" button in the Expert Advisor's properties.
The results of this optimization testing and the settings file are included in the Expert Advisor's archive.
Now you know how to test an Expert Advisor and how to optimize it correctly. Good luck!
Comrade traders, let's slowly move on to trading advisors (robots). Let's start the development of this topic from afar - with such concepts as a strategy tester and a quotes archive.
The MetaTrader 4 Strategy Tester is a familiar thing for the majority of traders, but
yet many do not know what it is, how it is called, and in general why this
strategy tester.
The MetaTrader4 (MT4) trading terminal allows not only writing Expert Advisors,
but also test them before use. This useful feature allows
check the performance and efficiency of the trading robot on
historical data. Testing allows you to start
auto trading, knowing about the behavior of the adviser in various
market situations. For these purposes in trading terminal built in
special window "Strategy Tester".
Recommend article
///////////////
Strategy tester options
How the "Strategy Tester" is called: View Strategy Tester or (CTRL + R).
After that, you will see the following picture in the terminal
Consider the parameters of the strategy tester:
Advisor
In this menu, select an adviser that we will backtest.
The drop-down menu displays advisors that are located in the navigator of the trading terminal.
///////////////
Read the article about Forex trading.
///////////////
2. Expert Advisor properties
After you have chosen an Expert Advisor for testing, you need to
carry out additional testing and input parameters adjustment according to
to your discretion. This can be done by clicking the "Properties" button.
expert." This will open a new window with three tabs:
a) Testing - in this tab general parameters are set
testing. These include the volume and currency of the initial deposit,
which are indicated in the respective fields. This deposit will be
operate the adviser during testing. This tab also selects
types of positions to be opened during testing: Only Long - open only
long positions; Only Short - only short; long and short
open positions in both directions. Whatever the trading algorithm
expert, he will open positions only in the specified directions.
You can also enable the genetic testing algorithm.
///////////////
You may be interested
///////////////
b) Input parameters - in this menu, in the form of a table,
list of all input parameters of the trading robot. Input parameters
are called variables that affect the work of an expert and can be
changed directly from the client terminal. To change these settings
there is no need to change the expert code. Number of input variables
may vary from advisor to advisor. When testing the input
Expert Advisor parameters are set in the "Value" field. Data written to
fields "Start", "Step" and "Stop", do not affect the testing of the adviser and
needed only to optimize its parameters.
c) Optimization
Expert Advisor settings in this tab allow you to manage the restrictions
test passes during optimization. Changes to the settings in this
The tab does not affect the one-time testing of the Expert Advisor.
3. Symbol.
In this menu, select a symbol - a trading instrument for which the adviser will test.
///////////////
I advise the article
///////////////
4. Model.
This menu offers three options, they are also located in
drop down list. Depending on the algorithms of your adviser
can choose
a) By opening prices (fast method on formed bars).
Some mechanical trading systems do not depend on features
intra-bar simulation, they trade on formed bars. O
that the current price bar is fully formed, you can find out by
appearance of the next. It is for such experts that this mode is intended.
modeling.
b) Checkpoints (the nearest smaller timeframe is used).
The checkpoint modeling method is intended to be a rough estimate
experts trading inside the bar. This method requires
historical data of the nearest smaller period (timeframe). I.e,
for example, if you are testing an EA on H1, the EA can take into account M30 prices,
but not M15.
///////////////
Learn how to work with
///////////////
c) All ticks (based on all the smallest periods available). This
mode allows you to most accurately simulate the price movement inside the bar. AT
unlike the "checkpoint" method, the tick method uses to
generating data not only for the nearest smaller timeframe, but for all
available smaller timeframes. At the same time, if for some temporary
range, there are data from more than one timeframe at the same time,
data of the smallest timeframe is used for generation. This method
the most accurate but also the slowest. This testing method is
most popular among Forex traders.
///////////////
Read also the article.
///////////////
5. Use the date.
The date range allows you to test Expert Advisors not on all available
data, but only on a selected time interval. This is convenient when
the need to examine a separate part of historical data
6. Visualization.
If you want to visually check the work of the adviser on history, then
check the box here, while testing is slower, but
detection of errors in the work of the adviser requires this. Playback speed
can be adjusted by moving the special slider to the right of the entry
"Visualization". You can pause playback by pressing the "||" button.
Pressing this button again resumes the flow of simulated
ticks. Pressing the F12 key causes an instant appearance
next tick even when paused. Visualization can be skipped until
certain date. After setting the desired date and pressing the button
"Skip until" rendering stops and resumes after
achievement by the tester of the specified date.
///////////////
Learn the right way
///////////////
7. Period.
Everything is very clear here, this is the timeframe on which you want to test the adviser in the strategy tester.
After clicking on the "Start" button, the adviser will start testing according to the parameters you specified
In the "Journal" menu, you can monitor the execution of trading commands
Expert Advisor, as well as to see errors that occur during testing.
You may be interested in the article "Forex".
///////////////
Features of the strategy tester in MT4
If you download the history of quotes for a long period of time, the test results for the last year or two will be the most accurate. Perhaps some of the data is lost over time, I can’t say why this happens (if someone knows, tell me in the comments, I’m interested). This nuance takes place even when using all ticks in testing. Therefore, more significant importance should be attached to the results for last years, both for trend and counter-trend systems.
You might be interested in the article
///////////////
When should you not trust the results of the strategy tester in the metatrader?
1) When trading strategy carries out entrances and exits "according to the market".
2) When the holding time of trades is very short (several minutes or even seconds)
3) When testing is carried out on the "current spread"
If a trading advisor (robot) falls under paragraphs 1 and 2, this is very dangerous. The fact is that there is a Forex broker factor. The broker can simply "cut off the oxygen" - increasing the time of execution of transactions. In this case, short-term systems will suffer greatly from poor trade execution.
///////////////
By the way, there is a very good article about trading costs (Forex commissions).
///////////////
Artur Bykov (Agudar project) was with you, thank you for your attention!
Watch the most detailed video on how to install and test a Forex advisor!
- Economic security of the Russian Federation Political economic security of the Russian Federation
- Antimonopoly policy, its goals and methods The main direction of the antimonopoly policy of the state is
- What reforms did Witte make briefly
- Okun's law and the theory of "full employment" of the population