With a wide range of markets to trade on our platforms, you'll need a backtesting approach that's best suited to each asset class. Explore the benefits and risks of backtesting.
Backtesting is a way of analysing the potential performance of a trading strategy by applying it to sets of real-world, historical data. The results of the test can help you favour one strategy over another in the search for the best outcome.
Backtesting relies on the idea that strategies which produced good results on past data may perform well in current and future market conditions. By trying out trading plans on previous datasets that closely relate to current prices, regulations and market conditions, you can test how well they perform before committing to a trade.
It's important to note that backtesting isn't a guarantee that a strategy will be successful in the current market. Past results are never a fool-proof indicator of future performance. Rather, it's part of doing your due diligence before opening a position. Backtesting will help you establish how volatile an asset class can become and take the necessary steps to manage your risk.
Traders should bear in mind that real trades incur fees which may not be included in backtests. You need to account for these trading costs when performing simulations, as they will affect your profit-loss (P/L) margins on a live account.
With us, you can backtest on platforms like MetaTrader 4 and ProRealTime to customise your entire trading experience. Learn more about trading strategies.
There are several advantages to backtesting trading strategies. You can test various, even very different, strategies very quickly and without risking any capital. The test, optimise, re-test cycle enables continued fine-tuning of any strategy you think could produce favourable results. And you can develop and adjust strategies tailored to your individual preference in terms of risk versus reward.
There are also real drawbacks to be aware of. Past data isn't necessarily a good predictor of future market behaviour, so no strategy can guarantee accuracy. You may be tempted to refine a model so that it best fits historical data, without accounting for the fact that future conditions may differ — a pitfall known as overfitting or curve-fitting. Past datasets may be skewed due to an adverse market event or uncharacteristically positive sentiment. Insufficient datasets will likely produce models that don't account for a wide variety of market conditions. A strategy that works well on data from one market, such as forex, may not work well in another, such as shares. And strategies that tested well in a bullish market may not perform in a bearish environment, and vice versa.
When implementing any trading strategy, it's important to take the necessary steps to manage your risk. Even in a simulated environment where there are only virtual funds to be gained and lost, it's vital to get exposure to positions that suit your risk appetite.
Backtest on MT4 and ProRealTime with us.
Backtesting is different from scenario analysis and the forward performance approach to testing the effectiveness of a given trading strategy.
Backtesting looks to the past: it checks how certain sectors performed and which strategies produced good returns using real historical data. By contrast, scenario analysis tests a strategy against a set of hypothetical market conditions, perhaps not found in historical datasets. For example, you might run a simulation to track how a portfolio of healthcare stocks would perform using a certain strategy under a specific set of assumptions, factoring in key variables such as changes in interest rates and inflation.
Forward performance testing, also called 'paper trading', is the application of a trading strategy to current and unfolding market conditions without risking your capital. Traders test their strategies on paper, rather than live within the trading platform, speculating on the exact points of entry and exit in certain conditions and documenting the results.
You can perform these simulations using ProRealTime, which gives you the option to backtest a strategy, walk forward and use a market screener, so you can filter stocks that fit your risk profile. You can also trade risk-free on current markets by opening a demo account with us.
MT4 has a backtesting tool called the 'Strategy Tester'. You can test automated trading programmes (called Expert Advisors, or EAs) using this tool. Before you get started, make sure the EA program is installed and dragged to the tester platform.
Once you navigate to the Strategy Tester, you'll launch the program to get several reports and charts supported by quantitative data for you to analyse. There's lots of information you can use to test your strategy, including profit-loss percentage ratio, the number of profitable and loss-making trades in a given period, the risk factors involved and more. Analysing the results helps you detect possible flaws in your strategy and customise the EA parameters to get the best outcome.
Here are five steps to follow when backtesting on MT4:
Note that success with past data is no guarantee of future results. The market conditions and factors that influence price can change over time, which can affect the accuracy of the simulation. Learn more about automated trading with us.
The ProRealTime platform offers a powerful tool called ProBacktest. To use it, you'd navigate to the indicators and trading systems tab within the platform to launch the backtest. Select the backtest you want to run from the options provided. Once you click 'ProBacktest my system', the program will run and give you a detailed report to analyse.
Traders can modify the parameters to test whether the strategy is successful within a certain date range. You'll observe the charts and detailed report of that strategy over the period tested. With this data, you can also customise the exact starting time of the strategy, the current time, and the capital used in the test.
One benefit of this platform is that you can observe a breakdown of previous high and low points of the equity curve to gauge the level of risk you can tolerate. There's also an orders list featuring the price associated with each order, and a closed positions list providing statistics on the entry and exit date of each trade.
Here's an example of one method to run a backtest with ProRealTime:
Remember, there's no guarantee that re-testing and refining a trading strategy using past data will have a positive outcome when applied to current or future markets.
Ready to put your strategy to the test? Open a demo account to backtest and paper trade with £10,000 in virtual funds, or open a live account to trade across 15,000+ markets. For more, explore our guides on trading strategies and automated trading.
This information has been prepared by IG, a trading name of IG Markets Limited. In addition to the disclaimer below, the material on this page does not contain a record of our trading prices, or an offer of, or solicitation for, a transaction in any financial instrument. IG accepts no responsibility for any use that may be made of these comments and for any consequences that result. No representation or warranty is given as to the accuracy or completeness of this information. Consequently any person acting on it does so entirely at their own risk. Any research provided does not have regard to the specific investment objectives, financial situation and needs of any specific person who may receive it. It has not been prepared in accordance with legal requirements designed to promote the independence of investment research and as such is considered to be a marketing communication. Although we are not specifically constrained from dealing ahead of our recommendations we do not seek to take advantage of them before they are provided to our clients. See full non-independent research disclaimer and quarterly summary.