Advertisements
$ £ ¥
¥ £ $

How to Backtest in Forex

If you want to be sure that your strategy can yield better results than you would attain by simply buying and selling randomly, you need to test it. There are two ways of doing that: backtesting (when you use past data to see how the strategy works) and forward testing (when you use the strategy on a demo or small live account in real-time). Forward testing has one serious disadvantage — it will take you months or even years to test a strategy, whereas backtesting allows you to do it in several minutes or hours.

Backtesting can be done either manually or in an automated way. Manually, you just scroll the chart from some point in the past into the future and look for how your strategy's entry and exit signals would work out. When performing automated backtesting, you use special software, which runs your strategy against the chart data and produces a report with results for all executed trades. For this to work, your strategy has to be formalized in some way. Usually, it is done by coding an expert advisor (robot), which implements your strategy's algorithm. However, some backtesting programs do not require coding and allow strategy input in a form of simple rules.

One of the biggest advantages of the automated testing software is that you can run your strategy multiple times on the same chart data but using a range of different input parameters to find the best combination of such parameters. This is called optimization, and although it is easy to over-optimize a strategy, it is a useful tool for strategy creation and analysis.

Below, you will find brief descriptions of the most popular of the currently existing ways to backtest Forex strategies.

MetaTrader 4, being the most popular trading platform among retail FX traders, is also a tool of choice to backtest strategies. To use MT4 Strategy Tester, you first need to code an expert advisor based on your strategy. The Strategy Tester is quite powerful with visual mode, optimization, and several price data models (the most precise being Each tick). A very detailed report is available upon backtesting completion.

MT4 Strategy Tester Input Parameters Example

MetaTrader 5 is becoming more popular as a trading platform with each year, but is still not as popular as MT4. Despite that, its Strategy Tester is much better than that of its predecessor. In addition to all the features present in MT4, MT5 allows backtesting on real ticks data, custom trading symbols, using a part of a testing period for forward testing simulation, trading delay imitation, and cloud computing (more on this in the next paragraph).

MT5 Strategy Tester Settings Panel

MQL5 Cloud Network in MetaTrader 5 allows optimization and backtesting of calculation-heavy strategies using the computing resources deployed by other MT5 users around the world. This feature allows fast and cheap backtesting of huge numbers of strategies.

MT5 Cloud Network Processing Optimizaition Task

cTrader is less popular than MetaTrader when it comes to choosing a trading platform despite the fact that, in terms of backtesting, it offers the same features as MetaTrader 4 and also testing on real ticks data and timeframe optimization. It also requires coding your strategy into a program, which in cTrader is called a bot.

cTrader Backtesting Report

NinjaTrader offers a rather extensive toolset for backtesting strategies (which should be coded in C# in NinjaScript Editor). NinjaScript is less popular among Forex traders than MT4/MT5, however, its Strategy Analyzer offers more powerful features, except for lacking a cloud computing network. Unfortunately, using NinjaTrader is less straightforward than backtesting in MetaTrader and even cTrader.

NinjaTrader Strategy Analyzer with Settings and Results

Forex Tester, which currently is in its 5th version, is a piece of software aimed at assisted manual backtesting but is capable of producing fully automated backtests on real ticks. Moreover, it can backtest multiple EAs on multiple currencies and multiple timeframes at the same time. It lacks optimization feature and is not as robust as MetaTrader/cTrader backtesting but, nevertheless, offers unique approach to the testing process. Forex Tester 3 works with its own sort of EA written using C++ and Borland Delphi API. Forex Tester 5 is a paid software. A free demo version is available but is quite limited in its backtesting capabilities.

Forex Tester 5 Strategy Analysis

TradingView offers traders a possibility to backtest strategies (coded in PineScript) via its platform's web-based interface. The Strategy Tester is rather simple and lacks many features offered by the above-listed software. For example, optimization is not available and period selection is weird. However, it is a rather fast way to test some trading ideas using TradingView's data and without need to install any software.

TradingView PineScript Strategy Tester

Excel is not a specialized Forex trading or backtesting software, but being a general-purpose spreadsheet application, it can be used for data analysis, and backtesting is exactly that. Setting up a backtesting spreadsheet in Excel is not easy — you need to have a good understanding of both the software and your strategies' inner workings; you would also need to import all the data you might need into your workbook. Nevertheless, with no hard limits on what you can do with the data combined with the power of VBA, Excel is a viable backtesting tool used by many professionals.

Backtesting Simple Trend-Following Strategy with Excel

Considering all the pros and cons, the recommended backtesting platform is MetaTrader 5 due to the real ticks data and the power of MQL5 language for strategy implementation. When you need to optimize an expert advisor with more than 100,000 combinations of input parameters, you should consider running it on the MQL5 Cloud Network. Of course, lots of traders also use MetaTrader 4 because many expert advisors are coded for that platform and do not run on MT5. Some traders are reportedly very happy with TradingView because PineScript is so easy-to-use when it comes to coding simple strategies and because the data is easily available on TradingView.

If you want to provide more details on how you backtest your strategies, please do so by posting in our Forex forum.

If you want to get news of the most recent updates to our guides or anything else related to Forex trading, you can subscribe to our monthly newsletter.