• Home
  • Blog
  • Backtesting in forex trading

Melvin Hofmans August 1, 2022 Average reading time: 5 min

Backtesting in forex trading

After creating a trading strategy or trading system, the next thing traders do is to test it out in a market environment. Demo accounts usually come in handy because it provides a risk-free environment. There are many methods of testing a strategy such as forward performance testing, scenario analysis, etc. But, experienced traders usually backtest and hone their strategies rigorously before they apply them to live trades.

Forex Backtesting is the process of subjecting a trading strategy to historical data to find out how it would have performed with time. It tells the trader how effective his strategy is, and whether it should be discarded, adjusted, or deployed to live forex markets immediately.

Backtesting is normally accomplished on backtesting softwares or on some trading platforms that support backtesting. The process can be done automatically or manually. Long-term strategies for position trading are backtested for many years while short-term strategies are only backtested for a few months.

Forex backtesting softwares are programs that enable traders to test their trading strategies using historical forex data. They recreate the market price action for a selected period in the past as well as how the market would have reacted to the strategy. The trader can use the data to measure efficiency and further optimize the strategy by tweaking some of its parameters.

The major basis of backtesting is that the market patterns and reactions often repeat; so a strategy that performed well in the past will likely perform well in the future. Marketers of forex trading robots and indicators usually state that it has been thoroughly backtested with years of historical market data. This boosts buyers’ confidence and belief that the trading system will work for them.

Backtesting a strategy is usually done by choosing a sample market data from a specified period. This data is chosen in such a way that it represents different market conditions and certain irregularities.

Manual backtesting

This is done on the trading platform by manually scrolling the chart to desired dates or periods and testing the strategy. Before you start backtesting a strategy, make sure that you have defined the rules for the following:

  • Entry signals
  • Exit signals
  • Stop loss
  • Take profit
  • Risk management
  • Directional bias


Depending on the strategy, there may be other parameters to define. Many traders use the MT4 platform, TradingView platform, etc for backtesting their strategies.

Follow the steps below to manually backtest on the MT4:

  • Login to your MT4 platform
  • Check if your charts have enough history; if not, you can download more history by clicking tools> options. When the dialogue box opens, select the ‘charts’ tab, and under ‘max bars in history’; select the max number in the drop-down. Click ok.

  • Go to tools> History center. When the dialogue box opens, select the forex pair that you want to backtest by clicking on it and double-clicking on the timeframe. You can download or export the market data.

  • Switch the end button off and scroll the chart to the desired dates. Use the F12 key to move the chart forward and Shift+ F12 to move it backwards.
  • Once you find a good setup for your strategy, you can plot your entry, target levels, and stop loss.
  • Then, use F12 to move the charts one step at a time or hold to move it fast.
  • Use a journal to record your results.
  • Deduct any commissions or spread charges to obtain the net return.

Some traders export the chart data spreadsheet like excel for analysis. One problem with manual backtesting is that it takes a lot of time. It is also prone to errors.

Automatic backtesting in MT4

The strategy tester in the MT4 and MT5 platforms is designed to backtest expert advisors (EAs) and indicators. So, you must first build your strategy into an EA or indicator. To backtest a strategy in the MetaTrader platform, do the following:

  • Log in to the desktop version of your MT4 platform
  • On the menu bar, click View>strategy tester or click Ctrl + R.
  • Choose the EA, indicator or strategy to be tested.
  • Select the testing parameters such as timeframe, forex pair, model, date range, spread, etc
  • Click ‘start’ and wait for the results.
  • You can check the testing result, report, graph, and journal on the next tabs.



Normally, automatic backtesting is done by traders with coding knowledge. But, there are other backtesting softwares; some of them are Forex tester, TradeIdeas, Soft 4 FX, Forex finder, QuantOffice, etc.


Why backtest your strategies?


  • Backtesting is a powerful risk management process that helps a trader eliminate inferior trading strategies or fine-tune a strategy to make it more effective.
  • Manual backtesting helps a trader train his eyes to spot trade setups faster.
  • Backtesting boosts the traders’ confidence. Signal subscribers tend to give credibility to rigorously backtested strategies and trading systems.


  • Though price patterns repeat with time, it may not always be the case. The forex market is dynamic and backtested strategies and trading robots fail.
  • When you assess the performance of a strategy based on backtested data, you are undermining the impact of other market conditions or occurrences.
  • Many traders have spent hours manually backtesting their strategies on different timeframes, and currency pairs; only to discover that the strategy is flawed.


Backtesting tips

  • Use relevant data; for example, do not backtest with exotic pairs; they are highly volatile. It is better to keep the volatility low.
  • Always aim to use the same forex pairs or correlated pairs. For example, if your strategy is designed for the EURUSD pair, do your backtesting with the same historical data for EURUSD.
  • Test with different market conditions such as bullish, bearish, and ranging markets.
  • Use different margin requirements, position sizes, transaction costs, etc. This will enable more accurate results.
  • Do not over-optimize the strategy else it may work great for historical data and fail with current and future market data. This is known as overfitting.



Backtesting is the method of testing a new trading strategy with old market data to rate its performance. It is an important strategy because it lends credence to a strategy and builds confidence. Traders who use this strategy generally believe that a strategy that did well in the past is likely to do well in the future.

Manual backtesting is popular and can be done on MT4, TradingView, and some other platforms. Automatic backtesting can be done on the MT4 and many other softwares.

The problems with manual backtesting are time-consuming, error prone, and may lead to overfitting.