<< Click to Display Table of Contents >> Navigation: Using the Advanced Tester > Ready for Testing > Test Settings |
Test parameters let you finesse the way in which the the Metatrader Strategy Tester executes your strategy. You can alter various settings such as the leverage used, commissions and even augment your test with variable spread and slippage simulations. The advanced parameters allow you to test for various scenarios which are not possible in the standard Metatrader. The extra settings will allow you to understand more in-depth about how each parameter may affect your strategy.
Note: While the Advanced Tester gives you full access to all the individual settings of the MT4 Strategy Tester, it is advised that you do not change any setting unless you understand the implications for your back-test. In some cases, it does not make sense to change values (for example, 'Maximum Lot size') and in other cases, the changing a field (such as Digits) could yield unexpected results. In these cases, it is advised to leave the settings at their defaults since they are ultimately determined by your broker and will not assist in optimizing your strategy. |
1.Testing profile toolbar - Allows users to save the current settings as a profile.
2.Base settings - Defines where to take the base parameters from.
3.Custom settings - Allows users to control individual settings such as leverage, commissions, spread and slippage.
As shown in the screen-shot above, to change the parameters of a currently running terminal:
1.Select the MT4 Terminal you wish to test with.
2.To change a particular field from its base setting default, firstly check the corresponding box to enable the custom value and then specify your value in the provided field. For example, if you wish to adjust the leverage of your test to say 300, check the Leverage box and input the value '300' in the Leverage field as shown in the screenshot below.
Your setting change will immediately take effect. When you commence your strategy test in Metatrader, the advanced testing parameters that you have applied across all the tabs will be used by the Metatrader Strategy Tester.
IMPORTANT: Make sure your MT4 back-test is not in-progress when you attempt to modify any settings. This will cause your results to be altered mid-test causing invalid results and could result in other unexpected behavior. |
Each section below describes the groups of settings that are available.
When a test is performed in the Metatrader Strategy Tester, it takes all the settings such as commissions from the broker. These are referred to as the base settings. When you are testing with the Advanced Tester, it gives you two two options of where these base settings can be taken from:
•From the default broker settings - These are the standard settings taken from the broker. In most cases, you will want to use this selection as your base settings. •From the default FXT settings - These are the settings that are embedded within the FXT data file (i.e. the settings you specified when exporting your tick data using Tickstory). Use this option if you want to use the settings that you specified in the Tickstory's Export to Metatrader dialog screen.
The base settings represent the standard settings for your test. On a field-by-field basis, the Advanced Tester allows you to adjust specific options as described in the following sections. |
The following fields are customizable in the General tab:
|
The following fields are customizable in the Commissions tab:
Example: For a broker that charges $5 commission per round-trip, set Base=5, Charge=Per Deal and Type=Money.
See OrderCommission function to have more information about the commission applied to your test strategy. |
The following fields are customizable in the Margin tab:
|
The following fields are customizable in the Swap tab:
|
Spread is the difference between the Ask and Bid price of the instrument. The standard Metatrader 4 Strategy Tester supports only a fix spread. In reality, spread changes constantly during each price movement, representing the support and demand of current sellers and bidders. The Advanced Tester allows you to simulate this environment in two different ways:
•Embedded Spread: This is when you have exported data from Tickstory and checked the Embed spread option. This option allows you to place the real spread between bid and ask prices that is occurring in the data-source and use it in your back-test. See this section for more about how to use embedded spreads. •Random spread: A random spread value in-between the values that you specify are used. This option is useful to determine your strategy's tolerance for changing spreads, as would occur in a real trading environment.
The spread is automatically adjusted with selected values. See SYMBOL_SPREAD for more information. You can also use the calculation of Ask-Bid to perform a spread calculation.
|
Slippage occurs when the price you specify on your trade is not exactly the same price you get executed/traded at. This can occur for various reasons such as if the market price of an instrument drops quickly and your broker cannot execute your stop-loss at your specified price. The difference is known as slippage.
The Advanced Tester allows you to simulate this market condition by allowing you to select a random slippage amount that is applied to your execution price. Note that the slippage amount is deterministic. This means that as long as your strategy, execution conditions and parameters remain exactly the same, you will get the same slippage on subsequent runs. This allows users to replicate their results between testing runs.
Slippage information is automatically printed in the Strategy Tester > Journal log. The order price is automatically adjusted based on the slippage price that was applied, therefore no changes are required to your EA code.
For more information about how to use slippage, consult this section. For more information about getting an order's execution price, see the MQL Reference for OrderOpenPrice and OrderClosePrice. |
Some EA developers have been known to produce fraudulent strategies by "doctoring" their historical results. With the ability of hindsight, they can change their code to suppress trading to hide any periods where the strategy is not profitable or does not perform well. This makes their strategy appear much more appealing than it really is. Of course, when the strategy is faced with live data, it will not have the same impressive results.
To counter this, the Advanced Tester allows you to alter the time-stamp of the tick data that is fed to the EA. The simulation of future data will elude any code logic that attempts to alter its behavior based on fixed dates or times or prices.
Adjust Time-stamp By activating the "Adjust time-stamp" check-box, you can choose the number of days and hours to add to the time-stamp. A number of "365 days" for example will add a year to the time-stamp passed into the EA. A specification of "12 hours" will additionally add 12 hours to the time component of the time-stamp.
If find that your results are the same with and without the time-adjustment, you can be more confident that the EA's results are not being manipulated by date or time.
Adjust price By activating the "Adjust price" check-box, you can choose the number of units the price is changed by. A positive number will add that many units to the price and a negative number will subtract that number of units from each price tick.
Note that if your EA is somehow dependent on the price such as position sizing based on the absolute price of an instrument, it is possible that you get different results when altering the price in this way. It is important to make sure that you understand how the EA operates before coming to any conclusion about whether any differing back-test results are a result of cheating or just an expected by-product of the updated price.
|