How To Run An Effective Back Test Using MT4
First open your Meta Trader 4 program, then initiate the tester in MT4 via “View > “Strategy Tester” or just short-cut via CTRL+R. Select the EA you want to test (via the drop-down menu), select the market symbol (EURUSD etc) and date-range (plus the time-frame of M5, M15, H1 etc) – then hit “Start”.
Simple enough? But look at the dropdown menu next to “Model:”. Note the options/choices for test quality. You’d best seek to optimize your data-feed – or your quality will be below that credibility threshold of 90%. How do we do that? And finally, before pointing you in that direction, it’s always best to use a completely separate MT4 clean install. Use Alpari UK (www.alpari.co.uk) for a demo account. You’ll see why in the steps below:
- After installing your fresh MT4, shut it down and navigate to it via Windows Explorer.
- Go into the HISTORY folder and delete all the files (.hst and .raw) in there (drag to the recycle bin).
- Re-open your fresh MT4, open up a demo account, Go to “Tools > Options > Charts” and change the numbers there to 999999999 (in both drop-downs).
- This will remove any limitations to MT4 sucking in tick-data.
- Go to URL link: https://www.alpari.co.uk/en/trading-tools/mt4-historical-data.html – and download their M1 data for the pair(s) you want (the process is on that page).
- Alternatively, for different brokers data, just Google “MT4 historical data downloads“
- Rename the file extracted from the downloaded zipfile as (for example) EURUSD1.hst (the number “one” signifying M1 data)
- Copy it into the (now empty) History folder.
- Inside MT4 go to “File > Open Offline”
- You’ll see the data file you just threw into the HISTORY folder, the number of bars and the date-range
- Highlight that bar-line and click “Open” – and a chart of EURUSD will open on M1 timeframe
- Go “View > Navigator” and drag the “Period Converter” (found under “Scripts” onto your chart
- A menu will open and if you’re wanting an M15 chart just type 15 into the column
- Click OK, give it a few moments to convert then check the Journal and Experts tab
- Under these tabs, MT4 will have recorded having just created the M15 bars for you
- You’re now ready to test, but only on EURUSD M15
- Run the same procedure for other pairs
However before pressing “Start”, make sure:
- Your robot is loaded/selected
- Then check your date-range and “Expert Properties” for the robot are correct
- Take a look at the variables under “Symbol Properties” and adjust if desired (spread, 5 digit broker etc)
- Also be aware that the manual for your “bought” EA might contain some guidance about needing to set your broker’s GMT offset time manually for backtesting
- If your brought EA has security in place, e.g. a license key, you should insert this in the “Expert Properties” to prevent your test from failing
- You may even find that some EA’s cannot be validated via backtesting for a very good reason, normally associated with their modus operandi
Now click “Start” and you’ll see it running, then:
- Tick “Visual mode” if you want to see the chart play out
- Vary the trading-speed with the slider bar (there’s also a pause/play button)
- Slider full left = market normal speed. Full right equals 32x mkt speed.
- After a few seconds, minutes or hours you’ll hear an aural alarm (the ruptured rubber duck) and see the results (under “Results” tab)
Now you can inspect the results:
- First inspect the equity graph (under the “Graph” tab)
- Click on “Report” and check the modelling quality (was it at least 90%?).
- Don’t be discouraged if it’s less than 90%. You may need to check all your settings were correct.
- Even if they were, reset some new parameters and try it again.
- Compare the differences (mismatched chart errors?). One mis-set setting can skew the outcome tremendously.
- Tick-data from a different broker may also distort the results one way or the other.
If you see a significant difference between your backtest results and a live micro-lot account with real money, it may be that the difference in spread between an ECN and a non-STP broker is influencing the outcome.
Want To Get Serious With Your Back Testing?
If you decide you want to get serious with your back testing, just Google the “Walk Forward Analyzer” and invest in that $30 program (or free-trial it for 14 days first). Scalping EA’s in particular are very sensitive to data quality and require a more sophisticated approach to serious back-testing. Dukascopy will be your first port of call.
If you want to practise your manual trade entry and exit strategies or systems via the MT4 strategy tester, think about using TBX Tradebox Pro 2.4 EA (it allows you to place trades, stops, take-profits and trailing stops) with candles to see the price action.
Note: for manual/systems trade-testing: