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:

One comment

  1. sydap2003

    Alpari seems to have stopped providing MT4 data downloads. They just advise using Download in History Centre. Which others say is not good data.?
    FXTester provides 10 years of downloads, refreshed every month.
    http://www.forextester.com/data/datasources.html
    But I have had problems importing their downloaded data. Don’t know why – some worked, most pairs did not.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

All results shown on this website are hypothetical.

No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading.

All information on this website is for educational purposes only and is not intended to provide financial advice. Any statements about profits or income, expressed or implied, does not represent a guarantee. Your actual trading may result in losses as no trading system is guaranteed. You accept full responsibilities for your actions, trades, profit or loss, and agree to hold Ziba Online Limited and any authorized distributors of this information harmless in any and all ways.

The use of this website constitutes acceptance of our user agreement.

Logos and trademarks are the property of their respective owners.