This page is obsolete and no longer maintained. Please browse the blog article for information regarding backtesting on different custom charts.
For MT4 build 574 and higher, this backtesting script names are suffixed with “_b574”. Therefore, you should be using RangeBarsBacktesting_b574 and RangeBarsBacktestingAlt_b574 scripts with the latest MT4 builds.
The backtesting feature for RangeBars is available via RangeBarsBacktesting script, which is part of the RangeBars plug-in for Metatrader4 and is located in the Navigator window’s Scripts branch, once you install the range bars plug-in package.
This backtesting method is mainly designed for backtesting EAs that use completed bars to calculate trading decisions. You should use the “Open prices only” model in MT4’s strategy tester. Scalping EAs and EAs that rely on inter-bar price action should be tested using tick data.
When you double-click the script or drag it onto the selected instrument’s chart you will see the following backtesting options:
The meaning of individual variables are described below:
BactestingRangeBars – This is used to select one or more pip ranges that should be prepared for backtesting using all historical data available in MT4 (on the 1-minute chart). The values should be separated by a comma.
i.e. 3,13,20 = 3 pip range, 13 pip range, 20 pip range.
BacktestingSpreadInTicks – This is used to select the spread value that should be used for backtesting. This value is entered in ticks so if your broker has 5 decimal quotes you should enter 20 for a 2 pip spread.
StartFromBar – This variable defines the number of historical bars, which will be used to create the range chart for backtesting. It is set by providing the date & time of the first 1M bar used to calculate the first historical range bar for backtesting.
The default value of “1970.01.01 00:00” will result in using all available data on the 1M chart.
BackTestingServerName – This is the name of the virtual MT4 server that will be created and you will need to login to, to use range bars with MT4’s backtester module.
Once you set the values above and press [OK], the script will begin to set up the virtual server for backtesting. Once this procedure is completed you will see the following message:
Now you can log in to the “range” server by choosing Logon from MT4’s File menu. This will display the following pop-up window:
Now, simply enter “range” in the Server field and click [Login]. Your MT4 should now show “No connection” (this is normal).
Next, you need to shout down MT4 and reopen it again.
This time you will see the selected range bar symbols ready for backtesting in your Market Watch window:
Now you can open MT4’s strategy tester, select the Expert Advisor you wish to test and select the range bar value to be used by the backtester:
IMPORTANT! – Always choose M5 for the period used for backtesting as the range bar chart is stored in this time frame.
Interested in 99% modeling quality, reliable, tick-by-tick backtesting? Click Here
JUL
2012