This is how to backtest an indicator based on the No Nonsense Forex method of trading.
This post is a response to all of the questions coming in on how to properly backtest all of the new indicators that listeners of the Forex Q&A Podcast have been discovering.
Like this question from Taylor:
“What are some considerations in backtesting indicators and their settings to judge their effectiveness?”
Taylor from Blue Lake, California
This is only going to be a tutorial on how to backtest an indicator based on the information you all have so far.
I was originally saving this tutorial for when we had all of the pieces in place.
As of right now, we have just over half of what we need in terms of entering a trade and managing a trade.
But this is enough to give us a good idea of which indicators can stay and which indicators can go.
So we’ll have a part one (this blog post), and a part 2 later once we’ve revealed all of the pieces we need.
This will still go a very long way in stream-lining the process and making it a lot more effective.
Step One: Get Caught Up
You need to know our thought process before doing anything else.
Seriously, this will make no sense to you if you don’t have the prior knowledge my readers and listeners already have.
There are 6 pieces of my algorithm’s structure when it comes to entering a trade. I have uncovered three.
- Confirmation Indicator
- Exit Indicator
In this post, we will be going over how to backtest a Confirmation Indicator.
If you have not seen the video on how to best discover a good Confirmation Indicator, it is required you watch this now, or you’re going to have a hard time with the rest of it.
So we know what makes a good trend indicator now. This is great, because we can really make our testing more effective by eliminating indicators we know aren’t going to work for us from the start.
This will save you mountains of time already.
We also know how to manage a trade once we’re in it, up to the point where we take our first half of the trade off the table and bank profits.
You will know this too by watching the Risk Video and the Scaling Out Video
With this information, we can now take the indicators we like and see which ones are the best so far.
It’s far from perfect, but we don’t need perfect right now. We just need to see who comes out on top based on what we already know.
The indicators that outperform the others at this stage of the game are also going to win out later as well, so we might as well discover those winners now.
Step 2: Set Up
This seems like a lot, but it isn’t.
Once you have everything set up and in place, the rest of it is super easy.
There are two parts to the set-up. The chart, and the journal.
Three easy parts to this.
1 – Pull up whichever currency pair you want to start with on MT4. Remember, we use the daily chart at No Nonsense Forex, because it’s superior to the rest.
2 – Place the indicator you want to test on your chart. You will likely want to start off with the default settings, because this way you’ll have a base data you can compare with other settings if you like.
3 – Place the ATR on your chart as well.
This can honestly be a notepad if you want it to be, but hard-cores like me love to take a free and easy spreadsheet like Google Sheets and have our data set up there.
Now some questions are going to have to be answered on your end before starting.
- How many currency pairs are you going to test this out on?
- Are you going to tweak the settings on these indicators. If so, how many times?
- How far back are you gonna test these? Make this answer the same for everything you test.
Figuring this part out goes a long way, because you can have your spreadsheet set up perfectly to receive your data, without having to go back and adjust it later.
Oh, and have a separate sheet for every currency pair you’re testing. You can use the ‘tabs’ function on your spreadsheet to make this easier and cleaner going forward.
You’ll thank me later for this, trust me. My shit was really messy before I figured this part out.
Now that you know this info, your spreadsheet should look like this:
You can figure your Win % by dividing your wins by the total number of trades. You can even set your spreadsheet up to do this for you.
Warning: Some mathy stuff you can easily skip follows…..
Don’t quote me on this, it may be off, but these 5 columns we have are all lettered. The Win % column is “E” for example. So I think the equation would be:
C1/(C1 + D1) = E1
And if you click and drag the answer in column E all the way down like 30 rows, the equation should duplicate itself all the way down.
Then again, you’re asking one of the dumbest math guys out there, so you can figure this part out on your own if you want to streamline things further.
End of mathy stuff
Step 3: The Test
Everything is set up. You have your spreadsheet ready, you have the indicators you want to use. Go time!
Here is what determines a win or a loss, listen up.
1 – Start from today, and go back in time until you see your indicator give a buy or sell signal.
2 – Find the value of the ATR at the time the buy/sell signal was given. We do not care what the ATR was at any other point in time. We only care about what it was when we got the signal.
3 – Then find out which happened first. Did price end up hitting the value of the ATR first, or did it hit the value of 1.5 x ATR int he opposite direction first?
For example: If the ATR at the time of the signal was 80 pips — which happened first? Did the trade make you 80 pips of profit, or did it lose you 120 pips? Which occurred first?
If the profit happened first, it’s officially a WIN. If the loss happened first, it’s officially a LOSS.
Make a mark off to the side somewhere to track wins and losses.
Repeat this every time the indicator gave you a signal, all the way back to the point in time you decided to stop recording.
*You will find times where your indicator gave you a signal to go the other way before price had the chance to become a win or a loss. Just chalk this up as nothing, and move on.
4 – Take the information you have recorded, and enter it into the spreadsheet
5 – Repeat for every indicator and every setting on that indicator you want to test out.
Now, once you have done this for every confirmation indicator you are considering, you can sort column E to see who the top performers are.
And don’t get rid of the sheet once you’ve finished! Every time you find another indicator, enter it into this same sheet and compare it against the indicators from before. This sheet will last forever!
Most of these win percentages should be reasonably high. This is not a difficult test. You’re asking an indicator to get to a smaller number before it gets to a larger number in the opposite direction.
But your top 3-5 performers, even though we don’t have all the information we need in our algorithm, are still going to out-perform the others 99% of the time. So keep them around and start forward testing them now.
How Far Back Should You Go?
I mentioned a few different options on the podcast, but I prefer a good 2 years back.
Remember, we use the daily time frame here at No Nonsense Forex, so this still won’t end up being a whole lot of work for you, even if you go back this far.
In the past 2 years, we’ve seen dead markets, wild markets, elections, over-compensations, and all things in-between.
I want to make sure my best indicators perform well in all of those types of markets.
Because in real life, all of those markets are going to happen again. So why have an indicator that’s going to get you destroyed once market conditions are no longer favorable?
A real killer confirmation indicator is going to give you signals when the market is right for it, and avoid giving you signals when it’s not.
And this is how you figure out which ones have the potential to become that special indicator for you going forward.
No fun pictures this week, just a detailed how-to when it comes to backtesting the confirmation indicators that may someday become the vehicle for your success in this game.
Again, this seems like a lot, but I can test out a good 5 indicators, all with different settings, in about 30 minutes these days.
It will take you a bit longer at first, but you’ll get it down fast.
This is the type of work you’re going to have to put in to end up having one of the best “jobs” in the world someday.
Not 4 years of college to go trade stocks and pray you eek out a 10% return every year. 30-60 minutes of pure, joyful discovery, 5 days a week or so.
As for testing Exit Indicators, we can’t really do that yet, because we have yet to go over Trailing Stops. Trailing Stops is what your Exit Indicator is ultimately going to be competing with.
All in due time however. Getting this right first is what’s important.
Going slow, going step-by-step in this whole journey and making sure we have the early parts right before moving on to other things, is even more important.