For MT4 build 574 and higher, this backtesting script names are suffixed with “_b574”. Therefor, you should be using RenkoBarsBacktesting_b574 and RenkoBarsBacktestingAlt_b574 scripts with the latest MT4 builds.
The back testing 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 which 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 amount 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 logon to, in order to use range bars with MT4’s backtester module.
Once you set the values above and press [OK], the script will begin to setup the virtual server for backtesting. Once this procedure is completed you will see the following message:
Now you can logon 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 on this time frame.
Interested in 99% modeling quality, reliable, tick-by-tick backtesting? Click Here
Backtesting Range Bars in Metatrader 4,