<< Click to Display Table of Contents >> Navigation: How Tos > How To Test with Tick Data and Variable Spreads |
Metatrader 4 data does not natively support testing with tick data or variable spreads as its data only contains 1-minute data with fixed spread information. Advanced Tester, alongside Tickstory, allows you to bypass this limitation by exporting tick data to MT4 and embedding variable spread information so it can be used by the MT4 Strategy Tester. As a result, your back-tests will result in 99.9% modeling quality and your back-tests will be significantly more realistic.
Below are the steps required to test with tick data and variable spreads. Expand each section for more details.
In Tickstory, select the symbol you with to test with and select the "Export to MT4..." option. This option creates an MT4 database that contains all the necessary historical charts (.HST) and tick data (.FXT) that will be used for 99.9% modeled back-tests.
Select all the usual export parameters such as your desired export date range and make sure the "Embed spread" option is checked. By selecting this option, you will ensure that Tickstory embeds the bid/ask spread information for every tick. If you wish, you can also "pad" the spread by the specified amount. For example, if the padding is set to "2", then the variable spread will be an additional 2 points (i.e. Tick Spread (in points) = Convert_To_Points(Ask Price - Bid Price) + 2 points).
NOTE: This step only needs to be done once unless you wish to export a new date range.
|
Once the data has been exported, you are ready to use in within the Advanced Tester. By default, the tester will continue to use the standard 'fixed spread' mode of back-testing until it is enabled.
To enable variable spread testing for a specific terminal:
a)Start the terminal, if it hasn't been started already. b)Select the terminal in the Ready to Test tab. c)In the Custom Settings box, select the 'Spread' tab and check 'Enable Variable Spread' and select 'Use Embedded Spread' as shown in the screenshot.
|
You can now commence your test in the MT4 Strategy Tester:
a)Select your Expert Advisor you wish to test. b)Select the Symbol you wish to test with (and whose data you exported in Step 1). c)Select the "Tick" modeling method. This will ensure you are using the exported tick data with variable spread. d)Press the 'Start' button to commence testing.
As the test progresses, any Ask-Bid calculations inside your EA's OnTick() method will return a changing spread for each tick. At the end of your test, your Strategy Tester Report tab should read 99.9% modeling quality, indicating you have successfully used tick data in your back-test.
NOTE: MQL's MODE_SPREAD calculation will always give you the fixed spread. You should not use this variable inside your EA if you want the variable spread. Instead, always use the Ask-Bid calculation.
|