MetaTrader 5 is a solid automated backtesting platform. But did you know that it’s also a pretty good manual backtesting platform?
In this post, I’ll show you how to use this free software to manually backtest your strategies. This is a great option if you don’t want to purchase software like Forex Tester.
I’ll give you all the tools that you need and the exact steps on how to do it. If your broker only has MT4 available, then It will work in a very similar way.
Why You Should Backtest
Backtesting is an excellent first step in helping you determine if a strategy has an edge or not. Since you can run through historical data very quickly in backtesting, this gives you a lot more data than if you only traded in a demo or live account.
Testing that might take months or years in demo trading, can be completed in a matter of days or weeks with backtesting.
You can also practice a strategy when the markets are closed, making it an ideal training tool.
So it’s extremely beneficial to learn this skill and MT5 is a good software to start with because it’s free.
This is the beginning of the roadmap to successful trading. To get a copy of the Trading Success Roadmap, read this post.
Here we go…
Download MetaTrader 5
The first step is to download MetaTrader 5.
You can get the software from your broker or you can download it directly from the MetaTrader website. It’s usually best to get it from your broker, but if you don’t have a broker yet, the MetaTrader version will do just fine.
Once you have a broker, you can connect to your broker through the MetaTrader version.
When you get the software from your broker, it’s automatically setup for that broker, so it can be a little easier to get started. Either way, you can get the complete MT5 installation instructions here.
Download Your Data
In order to do a valid backtest, you should have as much historical data as possible. Over the years, I’ve tried several backtesting solutions that only allow you to test a couple of years of data.
That’s totally useless because you won’t have enough trades to make a valid decision about a trading strategy.
So get as much data as you can. To download additional data, go to: View > Symbols
Then select the currency pair that you want to download data for. After you’ve selected the pair, click on the Bars Tab.
In this example, I’m going to download the USDCAD currency pair.
On the Bars tab, select the timeframe of data you want to download, then the starting and ending dates of the historical data.
Finally, click the Request button to do the download. I found that I had to click the button several times to get the data.
So if you don’t get it on the first try, keep trying.
If you have your own data, then you can upload it with this button.
Once the data is downloaded, you will see it in the window. You can scroll through the data to see how far back it goes.
That will give you the data you to do your backtesting.
If there isn’t enough data from your data source, then consider downloading additional data from this provider.
Open Your Spreadsheets
Trade Tracker Spreadsheet
Before you get started, you’ll need a spreadsheet to record your results. One of the biggest benefits of other software is all of this information is automatically recorded for you.
But if you would like to continue using MT5, then create a spreadsheet with the following columns:
- Open date
- Open time (if day trading)
- Currency pair
- Long or short
- Open price
- Close price
- Stop loss price
- Take profit price
- Pips result
- Pips risk
- Pips to profit target
- % Risk on trade
- Risk multiple result
- $ P/L
- Running balance
- Win %
TraderEvo members get this spreadsheet as part of their membership. Once you’ve built your spreadsheet, then move on to the next step.
Backtesting Results Spreadsheet
Next, you should keep a spreadsheet that tracks the results of each of your individual tests.
Be sure to track the following for each currency pair:
- System name
- System notes
- Chart timeframe
- Test number
- Win Rate
Then create a sum and average in the last two columns.
Keep Your Trading Plan in Front of You
When you’re backtesting, it can be easy to deviate from the plan. If you’re like most people, you’ll start tweaking the strategy in the middle of the test.
I’ve done this before too, so that’s why I keep my trading plan in front of me while I’m testing.
It will keep you on track and ensure that you are sticking to the plan.
You can get a free PDF download of the Trading Plan Worksheet I use here.
Once you have your plan in front of you, it’s time to begin your testing.
Now it’s time to get started!
First select the pair and timeframe that you want to test.
Next, add any indicators that you’ll be using to your chart.
Then scroll your charts back to a point in time that you want to start from. If you are testing the H4 chart or higher, I would recommend going back as far as possible.
You can usually test all of the data for a Forex pair on a H4 chart or higher.
When testing lower timeframes, you should pick a few timeframes and test on those timeframes only. Pick a good mix of timeframes that have the following characteristics:
- Strongly trending market
- Strongly ranging market
- Neither strongly ranging or trending
That will give you a good idea of how your strategy will perform in different market conditions.
Do the following to scroll back quickly on your chart:
1. Turn off Autoscroll. This will stop the chart from moving to the most recent candle every time price changes.
2. Hit Enter on your keyboard to specify a start date. A small box will appear in the lower left corner. Enter the date that you want to scroll back to on the chart in dd.mm.yyyy format, then hit Enter again. You can also manually scroll back to the date on the chart that you want to start from.
Once you have scrolled back to the historical data that you want to start at, then hit F12 on your keyboard to move the chart forward, one candle at a time.
Record Your Results
Every time your setup fires off, place a trade and record it in the spreadsheet. You don’t have to take screenshots at this point because you don’t even know if the strategy works or not.
So just keep testing as fast as you can, so you can get as much data as possible. Creating screenshots will only slow you down.
Review Your Results
Now take a look at your spreadsheet and calculate the following:
- Win Rate (%)
- Return (%)
- Number of Trades
- Maximum Drawdown
This is enough data for now. It will help you understand if you want to pursue this strategy or not.
If you want to be extra sure, do another round of testing to verify your results.
Sometimes you might be distracted or not in the right mindset when you do a test. So if you get the same result with a second test, that will give you much more confidence that a strategy has an edge and you should move forward to the next step in your testing.
Test Another Pair
If you’re satisfied with the results of a currency pair, then move on to testing another currency pair.
Not all currency pairs behave in the same way, so you can’t assume that it will work on other pairs too.
Some pairs are more volatile than others. Each individual currency is influenced by different economic factors.
You might be surprised at how differently a strategy performs with different strategies. This is why you need to test each pair individually.
Be sure to record all of your rounds of backtesting on a separate spreadsheet.
Things to Avoid
Here are a few things to be aware of when doing backtesting with MetaTrader 5. These tips will help you get the most out of your MT5 testing sessions.
Moving Too Fast Through the Charts
When you move too quickly through a chart, there’s the tendency to move past an entry point on the chart. That leads to hindsight bias because you already know what’s going to happen.
If you already know how a trade will turn out, then you’ll have biased data.
So find the testing speed that will allow you to get a lot of testing in, but also won’t give you advanced knowledge of each trade.
Changing Your Strategy in the Middle of a Test
It’s really tempting to start tweaking your strategy in the middle of a test because you see a new advantage. But stick with the strategy, or you won’t have a valid test.
When you change a strategy in the middle of the test, you won’t know how good the original rules really are. You also won’t know how good the new rules are either because you are only doing a partial test with them.
So finish a test with one set of rules. Then create a new test with your new testing idea.
Otherwise, your testing data is useless.
Stopping Too Early
If you win 10 trades in a row in the beginning of a test, you might be tempted to stop the test and call it a success.
The strategy may have just hit a really profitable streak that isn’t normal for that strategy. Stopping early won’t allow you to see the entire picture and can lead to losses later.
Giving Up on a Low Return Strategy
It can be tempting to give up on a test if it’s only returning 1% per year. However, consider what would happen if you compounded that return with multiple pairs or timeframes.
If the strategy has a high win rate, it’s certainly worth considering.
You might give up on an otherwise profitable strategy and find yourself jumping from strategy to strategy, when the first strategy would have met your goals.
Don’t Keep Testing if the Results are Obvious
On the other hand, if it’s obvious that the system doesn’t work, then quit and save your time. For example, if your strategy has lost 80% of the account, then it’s probably time to stop.
There’s no way you would continue with that strategy in real life.
Forcing the Strategy to Work
People also tend to be too optimistic about a trading strategy. So they will subconsciously pass on losing trades and only take the winning trades, just to prove that the strategy works.
I was guilty of this when I first started backtesting. When I reflect back on this, I did this partially because I wanted to get the backtesting process over with (and trade live) and I didn’t like being wrong.
I’m not sure why others do it, but those were my reasons. They’re very odd reasons in hindsight, because they didn’t help me become a better trader.
But our actions aren’t always logical and we need to continually reflect on our behavior to progress.
Although backtesting can be very beneficial, not all strategies can be backtested. Learn more about this limitations of manual backtesting in this blog post.
But if you can backtest a strategy, it’s a great way to test a trading idea, get hard data and build confidence in your skills.
This tutorial will give you a good starting point, be sure to read the Complete Backtesting Guide for more details. Once a strategy tests well, the Forward Testing Guide will show you how to take your trading strategy into the next phase of testing.
If you would like help with anything mentioned in this post, be sure to sign up for the TraderEvo Program. It will take you through this process and provide the support you need to get through it.