How to backtest a trading strategy

8 Min read

Learning how to backtest a trading strategy is one of the most important skills in improving trading performance. After all, trading is about making decisions and it is difficult to make decisions when the outcome is unknown. While past performance does not guarantee future performance, backtesting a strategy to learn about the frequency of wins and losses and other data points, can help the trader have more confidence in implementing their system.

What is backtesting trading?

In order to do backtesting successfully a trader first needs to have a trading strategy with a set of rules. This could be a manual strategy where traders find the setups themselves or even an automated trading strategy in which a computer algorithm takes the trades. The two approaches differ when it comes to backtesting.

When learning how to backtest a trading strategy manually a trader would go back in history to find all of the trades that would have met their trading strategy rules and then record that data in a journal. With this data, the trader can then see the historical wins and losses, the largest run-ups in the account, the largest drawdowns, the consecutive win to loss ratio and many other data points. This will then give the trader confidence in how effective the system is and whether to trade it live.

Another option is to learn how to backtest a trading strategy in MT4 (MetaTrader 4) or MT5 (MetaTrader 5), a popular trading and backtesting platform that can be downloaded for free from Admiral Markets UK Ltd. This method is very popular among automated traders. Once they have programmed their trading system using an Expert Advisor or using a free one from the MetaTrader Market place, then the MetaTrader trading platform will automatically find all of the previous trades that met the rules coded into the system and provide a historical and detailed report, similar to the one below:

A screenshot of a hypothetical trading system's historical backtested results from MetaTrader.

Did you know that you can download the MetaTrader 4 trading platform provided by Admiral Markets completely FREE? With this trading platform you can trade directly from the chart and use algorithmic trading strategies as well! Start your FREE download by clicking the banner below:

How to backtest a trading strategy

Whether you are learning how to backtest a Forex trading strategy or learning how to backtest a stock strategy, learning how to backtest a trading strategy using Excel is important. It is one of the best ways to get started in the financial markets, to build confidence in yourself and your system.

The process of backtesting a strategy manually is powerful because it allows beginner traders to condition their minds with the right visual image. Trading is as much about pattern recognition as it is analysing the numbers. The more you can build your memory bank of what you should be trading and what you should not be trading, the more likely you are to make better decisions in the future.

However, in order to start backtesting, a trader first needs a trading strategy to test.

How to build a trading strategy

There are a variety of ways to build a trading strategy. The core and most basic components should be the following inputs:

1. Which instruments will you trade on?

Identifying the markets and symbols you want to trade on is essential. A strategy that may be effective on indices may not work at all on Forex markets. While it doesn't matter which markets you will trade on, it is important to have a focus. For example, many Forex traders would first start with the major currency pairs against the US dollar. With Admiral Markets you can trade CFDs ( Contracts for Difference) on more than 3,000+ instruments which include Forex, indices, stocks, commodities and others.

2. Which time frames will you trade on?

Backtesting a strategy on the daily chart and then trying to trade it on an hourly chart would lead to some very different results. It is important to identify the time frame you plan to trade on. Will it be the daily chart, four-hour or one-hour chart for example? The MetaTrader trading platform provided by Admiral Markets provides access to a variety of different time frames to trade on.

An example chart showing a variety of different trading tools and indicators. DISCLAIMER: Charts for financial instruments in this article are for illustrative purposes and do not constitute trading advice or a solicitation to buy or sell any financial instrument provided by Admiral Markets (CFDs, Exchange Traded Funds, Shares). Past performance is not necessarily an indication of future performance.

3. What tools will you use to buy or sell?

When traders make trading decisions they usually use different tools to help them. These tools could be from technical analysis or fundamental analysis with the former being the most popular. In technical analysis, traders will use chart patterns and trading indicators to make trading decisions on when to buy or sell. Defining your tools is essential in backtesting as you need to know what you are looking for.

4. How will you risk manage your trades?

Risk management is a key component of long-term trading success. How much will you risk per trade? Where will you put your stop loss and take profit? When looking back at historical trades it's important to have this information ready to make the backtesting results more meaningful.

Did you know that you can upgrade your MetaTrader trading platform provided by Admiral Markets to the Supreme Edition? This will allow you access to automated analytical tools which scan for a wide variety of trading patterns on more than 3,000+ asset classes! Start your upgrade completely FREE by clicking on the banner below:

How to perform a backtest

Once you are armed with your trading strategy rules you can now look back historically to find examples of when they have occurred in the past. This data should be recorded in an Excel spreadsheet so you can quickly filter for best performing days and quickly see data points such as consecutive winning and losing trades.

The Excel spreadsheet for backtesting could like this (a hypothetical example with random figures):















Forex H4












Forex H1










After a larger sample size has developed, users can then add up the wins and losses and see how effective certain months and days have been, as well as how effective the strategy has been to the long side and short side. However, it is the process of building the memory bank of what meets the rules and what does not meet the rules which is a very powerful aid in making trading decisions for the future.

Why start trading with Admiral Markets?

  • Begin your trading with a well-established, reputable company that is authorised and regulated by the Financial Conduct Authority (FCA).
  • Start trading on the world's most popular trading platform called MetaTrader for PC, Mac, Web, Android and iOS operating systems so you can also trade on the go.
  • Supercharge and upgrade your trading platform completely FREE to the Supreme Edition for actionable trading ideas on thousands of different markets.
  • Open a Trade.MT4 or Trade.MT5 trading account to trade via CFDs and potentially profit from both rising and falling markets.

One of the best ways to get started is to test-drive the trading platform and practice your ideas and strategies in a virtual trading environment. Did you know that you can open a FREE demo trading account with Admiral Markets? This means you can trade in a virtual trading environment until you are ready for a live account.

Get started today - completely FREE - by clicking on the banner below!

About Admiral Markets

Admiral Markets is a multi-award winning, globally regulated Forex and CFD broker, offering trading on over 8,000 financial instruments via the world's most popular trading platforms: MetaTrader 4 and MetaTrader 5. Start trading today!

This material does not contain and should not be construed as containing investment advice, investment recommendations, an offer of or recommendation for any transactions in financial instruments. Please note that such trading analysis is not a reliable indicator for any current or future performance, as circumstances may change over time. Before making any investment decisions, you should seek advice from independent financial advisors to ensure you understand the risks.

Top 10 List of Blue Chip Companies to Watch in 2022
Are you unsure how blue-chip companies and their stocks could impact your investments? Perhaps, you're asking yourself, 'what are blue chip stocks?'. This guide offers the overview that you are looking for, as it offers a list of blue chip companies, outlines the top European and UK blue-chip stocks...
The SP 500 index - How to invest in the S&P500
The SP500 is a stock index in which 500 of the largest companies in the United States are traded. It is managed by the Standard & Poor's financial rating agency. If you are thinking of investing in the SP500, this article is for you! Table of Contents What is the S&P 500? 5 curiosities...
An Introduction to Passive Investing
Passive investing is an investment approach which can often divide opinion amongst investors. There are those who strongly favour it but others who advocate for its opposing style - active investing. However, in recent years, the popularity of passive investing has grown significantly as peoples’ at...
View All