Testing a strategy is one of the most crucial parts of forex trading. It’s so common to see a few trades work and think you have a market breaking strategy in your hands, only to find that played out over the next few months you’re down 15% on your equity. A strategy without backtesting is gambling! If you really want to know if you’re wasting your time, you need to backtest your trading strategy over years of high quality data…
To Backtest A Forex Trading Strategy, You’ll Need To:
- Pick your trading strategy and define the rules you’ll be testing.
- Select a currency pair to test on.
- Look for trades that meet your defined trading ruleset.
- Record all relevant information in a table, including stop losses, take profits and risk to reward.
- Repeat on every trading setup, until you have completed years of data.
- Study the results objectively.
What Is Backtesting In Forex?
Backtesting is without a doubt the most important part of forex trading. At the start of my trading career, I would see an entry style or a combination of candles playing out a few times and I would automatically trust this to work. I would change setups and trading styles constantly after seeing a few successful trades. Once the dust had settled, I’d have taken 30 trades on this new strategy just to find out that it wasn’t actually profitable over the long term. This caused a huge amount of frustration and wasted years of my life trying to trade unprofitable strategies – it sounds familiar, right?
Backtesting is a way to objectively gauge whether or not a trading strategy is profitable. The logic behind backtesting is very simple – if the strategy worked over past market conditions, it will likely continue to work over future market conditions. You test the trading strategy and ruleset over years of data and thousands of trades, to see the profitability of the strategy. This cuts YEARS of trial and error out of the mix.
The Benefits Of Backtesting Your Trading Strategy
The benefits of backtesting are endless. You need to know that the strategy you’re dedicating capital to is profitable. No matter how good of a trader you think you are, if you’re trading a strategy with no edge in the markets then you’re doomed to fail – you just won’t realise it yet.
Backtesting allows you to:
- See the profitability of a trading strategy. If you’re backtesting over the course of a few years of data, you’ll get a clear picture as to the profitability of a trading strategy.
- Filter out losing trades and refine the strategy. Having access to a huge amount of data will allow you to refine, change rules and tweak the strategy to optimise profitability and consistency in the markets.
- Train your eyes for setups. If you’re manually backtesting, you’ll become a better trader and be able to spot setups forming ahead of time as you would have seen the same pattern thousands of times.
- Automate trading strategies. To effectively backtest a forex strategy you’ll need to makes the rules as objective as possible which opens the door for automating your strategies.
What Is Needed For A Successful Backtest?
A backtest done wrong is absolutely useless to a trader. You need to make sure that you have a few things in place first before beginning to test any kind of trading strategy.
Most importantly, you’ll need to ensure that your trading strategy is objective. What does this mean? In essence, you need to have established rules when doing a backtest, as to avoid human error or bias playing any part. When I was an unprofitable trader, losing on live markets, I would somehow always be profitable in a backtest.
This was because I didn’t have any fixed rules and I was just making it up as I went along.
To backtest properly, you’ll need fixed and preset rules for:
- Stop losses
- Take profits
- Entry signals
- Exit signals
- Directional bias
- And more!
If you don’t have these already, then spend some time figuring out a set of rules to create a trading strategy. If you need help creating a trading strategy, I would take a look at this Investopedia article. There are also some very interesting strategy ideas on Forex Kings website that you could adapt into manual trading strategies.
What Options Do You Have For Backtesting?
Backtesting a trading strategy can be done in 2 ways, both with differing levels of success. This can be broken down into either performing an automated backtest, or manual backtest. Let’s find out more…
Automated backtesting is when you’re using a tool to screen years of data, in the space of a few seconds. Now this will only work for very objective systems as you’ll need to input exact criteria into the back tester. The majority of automated backtests are performed using EA’s on MetaTrader 4’s strategy tester feature. The benefit of this way of backtesting is the fact you have no manual intervention, meaning you cannot interfere with the results. This typically provides a much more accurate data set and results.
Automated backtesting relies on a high quality of data, so you’ll need to ensure that the quality remains high. There’s a huge amount of different tools you can use for an automated backtest, the most common being MT4 and Forex Tester. Click here to read my full article breaking down all of your options.
Manual backtesting is a lot more common and the majority of retail forex traders like to use this as their primary method of testing. This entails a trader looking over years of data manually and taking trades based on what they see. This should still be done with a fixed set of rules and should not differ too much in results from an automated backtest. The issue with manually testing is human bias. Traders typically will say ‘I wouldn’t take that setup’ or find some kind of reason to justify a loss, resulting in backtests appearing much better than reality.
Backtesting Your Forex Strategy On TradingView
TradingView is my favourite platform for trading and it’s become one of the industries most popular backtesting platforms too. The platform is completely free but if you want to access the ‘Bar Replay’ feature, you’ll have to signup for the lowest price package (Worth it, in my opinion).
Backtesting on TradingView (Step By Step)
- Open the currency pair you’d like to test on. I’d recommend a major pair with good volume and liquidity, like EURUSD or GBPUSD.
- Click the bar replay tool and zoom out (or scroll back), to where you’d like to start the test from. I’d recommend having a few hundred trades, so scroll back years on H1+, or maybe 1 year of data if you’re trading the lower time frames.
- Press play or use the next bar button to see candles appearing, as they would do in the live markets.
- Pause when you see a trading opportunity.
- Add your risk to reward tool on the screen and set your stop loss and take profit.
- Play the chart, to see the trade unfold.
- Journal the outcome of the trade.
- Repeat this a few hundred times.
This is all you need to know about backtesting on TradingView! It’ll take a few sessions to get used to, but once you’re a bit experienced on the platform it is extremely user friendly. I find it by far the easiest platform to backtest on, manually.
Backtesting Your Forex Strategy On MetaTrader 4
MetaTrader 4 is the most common choice of retail traders looking to backtest a trading strategy. This isn’t for any reason in particular besides the fact that it’s also the most common trading platform. When testing on MT4, you’ll need to make sure that you have data. If you’ve just downloaded the platform, you will have little to no data. Even if you’ve used the platform for years, you’ll still not have enough tick data stored to make the backtest worth doing. Luckily, MT4 have a Data Center! Let’s walk through the steps…
Backtesting on MetaTrader 4 (Step By Step)
- Go to Tools, then Options. Once in options, click on Charts and set the max bars in history to 500,000.
- Go in Tools again, then click on History Center.
- Click on the currency pair you’re looking to test, then click import to bring the data onto your platform. (This will take a few minutes)
- Open the currency pair you’re looking to test.
- Turn off auto scroll (Green arrow at the top of the chart)
- Scroll back as far as you’d like to backtest.
- Start scrolling forward again looking for setups that meet your trading plan. Or press F12 to skip just one candle at a time.
- Journal the trading setup.
- Rinse and repeat.
- Make sure that your EA is installed in the MQL4 folder, in Experts.
- Refresh your EA’s. You should see your new EA in your EA’s folder on MT4.
- Click on View, then Strategy Tester.
- Add your EA into the strategy tester window.
- Edit the expert properties, as per your requirements.
- Set the symbol, model type and date range.
- Click start.
- View report and graph to look at results of the backtest.
Backtesting Your Forex Strategy With Advanced Programs
If you aren’t a fan of MetaTrader or TradingView, there are a range of other programs and tools out there to help traders in testing their strategies. I have actually tested each and every tool and compiled a handy list, if you’re interested in comparing and contrasting.
The best backtesting tools in 2022 are:
- Soft4Fx. This is built on MT4 so it’s not user friendly or pretty, but it’s certainly useful. This program was the foundation of my trading and I’d highly recommend using this if you’re a primarily manual based trader.
- Forex Tester. This is a great hybrid of Soft4Fx and Tradingview, providing the value/tools, alongside a nice user interface and easy to follow instructions.
- TradingView. One of the best tools in the market – very user friendly and I’d highly recommend charting on here. There is definitely better out there for backtesting, but it’s more than capable of a manual test.
- MetaTrader 4. We have already touched on MT4 but essentially it’s very limited for traders looking to manually backtest their systems. It’s useable but not fancy at all and doesn’t come with a lot of the gimmicks that the other testing systems come with.
Is It Possible To Backtest An EA/Robot?
EA’s and robots are rapidly becoming a very popular way to trade the forex markets. They’re especially popular with part time traders that don’t want to/cannot dedicate a huge amount of time to the charts. Although hard to code, developers are able to make a huge amount of different EA’s with different perimeters so they’re often being sold for fairly cheap on various market places. For example, I recently purchased an EA from ForexKings that was around the $40 price point.
You can backtest an EA over years of data very easily using the MT4 backtesting feature. Although this feature is fairly limited, if you’re looking to test an EA over 5+ years of data, this is going to be the best option in my opinion. I have used the feature hundreds of times and although the data isn’t 100% accurate, you will get enough of an idea of the metrics you’re working with to decide if the project is profitable or not.
Once you have run the backtest program on your EA, you’ll be given a lot of metrics, charts and data for you to work with, which allows for optimisations and tweaks to the system.
As shown here, the modelling quality was 90.00%. This really isn’t great and the results cannot be taken as gospel. I would personally need to combine this backtest with a demo forward test for a few months, to be sure that the strategy is even viable. Every percent is very important when you’re looking at modelling quality.
In Conclusion – How Do You Backtest A Forex Strategy?
In summary, backtesting a forex strategy is incredibly important and something that all profitable traders have done hundreds of times. There are a range of tools and tricks you can use to make your backtest more efficient and useful, opposed to just a manual backtest on MT4.
Backtesting a forex strategy, step by step:
- Choose a currency pair to test (I would recommend EURUSD or GBPUSD).
- Go to historic data and look for trades that meet your ruleset.
- Record all information in a table.
- Repeat until you have over 200-500 trades.
- Study the results and tweak your criteria.
This is backtesting in a nutshell! If you have any experience backtesting forex strategies or any tips and tricks, please do leave a comment down below – I’d be very curious to see how you approach this!