How to Backtest a Trading Strategy - Manual vs Automated

Jitanchandra Solanki
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.

In this article, learn what is backtesting and the different ways to start backtesting trading strategies.

What is Backtesting in Trading?

What is backtesting? Backtesting is the process of identifying historical trading opportunities that meet a set of trading strategy rules to understand how that strategy has performed historically.

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.

Advantages & Disadvantages of Backtesting

Here are some pros and cons of backtesting a trading strategy that are important to know. 

Backtesting advantages

  • Test different variables and parameters without risking any capital
  • Identify setups that provide a statistical edge
  • Build belief in a trading system

Backtesting disadvantages

  • Past performance is not a guarantee of futures results
  • Over-optimising historical patterns can provide 'fitted' results
  • Not enough historical data can lead to skewed results
  • Changing volatility levels in the market will change a trading system's results
  • Does not take into account the mindset considerations of running a trading system on live capital

Free trading webinars

Tune into live webinars hosted by our experienced traders

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 and 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 about analysing 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 Admirals 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 Admirals provides access to a variety of different time frames to trade on.

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.

Zero to Hero

Learn to trade in 20 days, from set-up to execution

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 be like this (a hypothetical example with random figures):

Month

Day

Strategy

Symbol

L/S

Entry

SL

TP

Risk

Reward

W/L

Comments

January

Tues

Forex H4

EURUSD

Long

1.19

1.18

1.2

-100

100

W

 

January

Wed

Forex H1

EURUSD

Short

1.19

1.2

1.18

-100

-100

L

 

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 on the long side and short side. However, it is the process of building a 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.

How to Backtest using MetaTrader

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 Admirals. 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, 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.

The World's Premier Multi Asset Platform


Why Start Trading with Admirals?

  • Begin your trading with a well-established, reputable company that is authorised and regulated by the Financial Conduct Authority (FCA), the Cyprus Securities and Exchange Commission (CySEC) and many others.
  • 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 using a practice demo trading account. This means you can trade in a virtual trading environment until you are ready for a live account.

Trade with a risk-free demo account

Practise trading with virtual funds

FAQs on Backtesting

 

What is backtesting?

Backtesting is the process of taking a set of trading rules and finding all of the historical setups that met those rules to measure the performance of a strategy has performed historically.

 

How do you perform backtesting?

There are two ways to perform backtesting - manual and automated. The manual way is to visually find historical setups that meet your trading rules and write down the results in an Excel sheet. The automated way is to program your strategy as an Expert Advisor in MetaTrader which will then automatically find the historical setups that meet your rules and provide statistical data regarding its performance. 

Test your trading level


Other articles you may find interesting:

About Admirals

Admirals 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 ARTICLES
Ins and Outs of Trading the EUR/USD Currency Pair
The US Dollar and the Euro are two of the most prominent and well-known currencies in the world. The Euro versus US Dollar (EUR/USD) currency pair has the largest global trading volume, meaning it is the world's most-traded currency pair. Whether you find the instrument easy or difficult to trade on...
Top Position Trading Strategies
In the financial markets, there are a variety of trading styles that are used. Position trading is a style which involved holding trades for a longer period than most other styles and is sometimes referred to as long-term strategies. In this ‘Top Position Trading Strategies’ article, we cover what...
What is a Trader? Trading Explained
The word "trader" conjures up the stereotypical image of people standing in a stock exchange, waving paper and shouting loudly at each other. It is a profession that is perhaps sometimes misunderstood and which has evolved greatly since the advent of the internet.So what is a trader? Who are they? I...
View All