How to Backtest Your Trading Strategies

If you’re new to trading or the financial markets, you’re probably looking for tried and tested trading strategies to build wealth over time. But are you confident enough in your trading strategy to unleash it in your trading account? That’s where backtesting comes into play.

In this article, we’ll explain what backtesting is, why it matters and we’ll look into ways in which you can get started with it today.

What backtesting is and why it matters

Backtesting is a process whereby you’ll measure a trading strategy’s performance against historical data. This is perhaps best understood through an example. Let’s assume your trading strategy entails buying stocks after they’ve fallen by 3%, and selling them after they’ve risen by 10%. You could go back in time, to a point of your choosing, and measure this strategy’s performance against a single stock, or a basket of stocks like the S&P 500.

As your strategy’s return on investment will vary depending on your chosen start date, end date and stock, it’s a good idea to repeat this process several times in order to build a range of outcomes. For example, you might discover that this strategy delivers a 10% ROI 25% of the time, a 5% ROI 50% of the time, and a -15% ROI the remainder of the time. This will help you build a probabilistic distribution of outcomes.

You may Also Like :  Ask a Family Law Attorney: What Happens to Business Assets in a Texas Divorce?

How to back-test a strategy manually

In order to run a manual backtest, you’ll first need software like Microsoft Excel or Google Sheets to perform your analysis. We like Google Sheets because it’s free and browser-based, with no download required. You only need an Internet connection to get started.

Next, you’ll need to get your hands on historical data. You could turn to websites like Yahoo Finance, or third party data providers, to source the data you need. However, you could also use financial functions built into Google Sheets to download historical share prices directly to your spreadsheet.

Finally, you’ll need to replay buy and sell orders over time, and measure your strategy’s return on investment. You could automate this in part through functions and “if statements” inside your spreadsheet to capture decision rules. Drag-and-drop your formulas and repeat this process manually time and time again. By now, it should be apparent to you that this is a time-consuming and error-prone process that is best automated.

How to automate back-testing

The MetaTrader 4 (MT4) platform is a widely used trading platform with support for creating, automating and testing trading strategies. On the MT4 platform, these trading strategies are called “Expert Advisors” or EAs, in abbreviated form.

You may Also Like :  Prepare for Upcoming Boards with Class 10 Sample Papers

The MT4 platform makes it incredibly easy to backtest your EAs. Its built-in “Strategy Tester” module allows you to test any Expert Advisors’ performance against historical data that’s already available within its platform. This sidesteps the need to source your own historical data. You can even make your trading environment more realistic by allowing for lags and re-quotes when you simulate your trades.

To get started, right-click your EA and select the “Test” option to open the testing panel in the lower section of the screen. There, you can choose a symbol and timeframe for your charts. For example, select the EUR/USD currency pair on a daily chart. You can also set an initial deposit and leverage for your imaginary trading account in order to replicate your trading environment.

How to measure your return on investment

Once the test is complete, click the “Backtest” tab at the bottom of your screen to access detailed statistics about the test. MT4 will report on your strategy’s ROI, gross profit and gross loss. It also calculates a wealth of other metrics, such as the largest drawdown (in percentage terms), the Sharpe Ratio and Profit Factor. You could use these metrics to objectively compare risk and return across trading strategies.

You may Also Like :  Using clear acrylic signs to catch the attention of potential customers

As an aside, MetaTrader’s Strategy Tester can access all your MT4 broker’s financial instruments, whether you’re trading Forex or CFDs on stocks, indices or even cryptocurrencies. That’s why it’s important to take time to compare the best brokers for MetaTrader 4, and open an account with one that supports a wide range of tradable instruments, and all Expert Advisors.


Trading platforms have come a long way in recent years, and retail traders like you have more ways than ever before to create and test automated strategies that were previously the preserve of Wall Street. However, no matter how encouraging these results are, it’s important to remember that past performance is no guarantee of future results. Markets may change in such a way that past relationships and correlations break down. That’s why it’s important to focus on risk management and capital preservation, above all, no matter how keen you may be to start trading with your chosen MT4 broker.