We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.
BOOK YOUR FREE STRATEGY SESSION NOW >>How can we tell if a system we've just created is reliable in terms of robustness and longevity?
In this video, we'll make some examples of methods that can help us evaluate the possible out-of-sample performance of our systems and understand what we can expect from these systems once we put them live.
By watching the video you'll discover:
- What are the degrees of freedom of a strategy and why they are important to understand the strength of a strategy
- What are the main approaches to validate a trading system and how do they work
- How to interpret the results obtained by these methods of evaluation
Enjoy the video! 😎
Hey everyone and welcome back! One of the coaches of Unger Academy here. Have you ever wondered if a trading system that you've just built is reliable in terms of robustness and longevity?
Well in this video, I'd like to show you a possible approach to validate your trading systems and set the right expectations for out-of-sample performance.
Okay, so let's get started right away with a trading system that we've already finished.
We've already seen this strategy a while back in a recent video here on YouTube. I'll leave you the link at the top right of the screen.
This is a trading system on Amazon that looks for volatility compression phases and enters based on a breakout logic. So let's go take a look at the system script. It's a very simple code. Here it is.
Here you can see: cash per trade, so how much money we want to invest in each trade. Then we have a condition that requires a volatility compression on the day before the day we want to enter the market, and then the entry level and a trading time window.
After that, there are also a stop loss and a take profit based on equity. Nothing more, nothing less.
Let's see what the results of the finished trading system are, which has been already optimized in all its parts. This was the result and this was the equity line.
Let's go take a look at the Total trade analysis. It was performing around $747 in average trade, which means 0.7% of the trade value.
The equity is very nice. The parameters chosen for the start and the end trading times were 11:30 am and 3:30 pm. Then we have the "Daily Factor", which is set to 0.5. And then a stop loss of 4% and a take profit of 7%.
But what would happen if we changed the range of values of the chosen inputs? What would be the outcome of the system with a stop loss at 3.5% or a take profit at 6.5% instead of 7%? And how would the system perform if we started trading at 11:15 instead of 11:30?
You see, we're trying to put pressure on the system by modifying the range of its parameters, that is to say by modifying its degrees of freedom.
To do this, it would be enough to launch a random optimization for the values that surround the final parameters that we've chosen for our system, and then analyze their performance as a whole.
We recently recoded in MatLab a tool that was created by Algoritmica.Pro back in 2015. This is a software that is called "Validator" and can be very useful to perform this kind of study.
So let's upload our strategy and see what results we could expect from this system if we modified the selected parameters.
So here's the result. As you can see we have a bundle of equity lines. The one highlighted in red represents the system we chose while the other ones represent the performance of the system as its degrees of freedom vary. As you can see some of these equities are above the red one and some are below it.
Actually, we can say that approximately 50% of the equity lines end up below and approximately 50% above.
We can also analyze the performance a little more accurately in terms of net profit, average trade, profit factor, maximum drawdown, and so on. The red dot that you see in these charts represents our strategy and lets us compare it with the results we'd obtain by varying the different inputs.
You can see that this system seems to be really good because it has all the credentials to be at least stable in terms of performance.
Let's take for example the average trade, which is located at almost the 50th percentile. This means that if we were in a slightly different market condition compared to the situation given in the in-sample, as you can see, our performance could be expected either to go down slightly or to go up.
Another way to validate the system is to compare the equity that we've obtained in-sample with a Walk Forward Optimization.
Here you can see the comparison between the red line, which is always our reference point, and the blue line, which is slightly below because it's optimized from time to time following a WFA and optimizing the net profit on the drawdown for each period.
You can see that we have some performance losses. It's no surprise.
The maximum historical drawdown of the strategy goes from $15,700 to $20,600. The net profit, on the other hand, drops by only 1%, which is a very good result. As for the average trade, it also drops a bit but that's something we can expect.
Just to be fair, the 857 that we saw differs from the value we saw here, which is around $700-750, because the WFA doesn't take into account the first period. Indeed, you can see that we are starting in 2014 when our backtest started in early 2010.
Another way to validate our system would be to do a Monte Carlo simulation above the WFA curve. This Monte Carlo is done without resample, so all trades are always used.
You can see how the equity curves differ depending on the order in which the single trades are selected. The worst one from a drawdown standpoint is this one here highlighted in red, as you can see. Our default is highlighted in green, this one right here. So, this tells us that we can expect a drawdown to be around an average of the ones we find here. The worst-case scenario is this one here, with a drawdown that almost doubles, but we know it's a very extreme case.
We could also perform a Monte Carlo simulation with resample, in other words, we could reconstruct the time series of trades by looking through all available trades, so it could happen that some equity lines will have the same trade more than once. And indeed, the arrival point of the equity lines is different.
Here again, we can analyze the drawdown. You can see that the worst combination leads to a drawdown that is about double the drawdown we found with our WFA.
This parameter gives us an indication of what might be the ultimate limit beyond which we should not go further with our system, for example.
We could also perform many other tests to find out if our system is statistically valid or not.
We'd just like to leave you the following message: always look into the features of your trading system. Go and stress it, modify the inputs to understand if the core or the starter script of your system is valid or not.
And if you are interested in our approach to trading and want to start investing in the markets in a systematic way, then I recommend you click on the link below. It will take you to a page from where you'll be able to watch a presentation by Andrea Unger, our founder and the only four-time world champion of trading with real money, or get a free copy of our best-selling book, "The Unger Method", covering only the shipping costs, or even book a free call with a member of our team.
Finally, before saying goodbye, I invite you to leave us a “Like" if of course you liked this video, subscribe to our channel, if you haven't already done so, and click on the notification bell to stay updated on the release of all our new videos coming out.
And with that, I will see you in our coming videos! Until then, bye-bye!
We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.
BOOK YOUR FREE STRATEGY SESSION NOW >>Andrea Unger here and I help retail traders to improve their trading, scientifically. I went from being a cog in the machine in a multinational company to the only 4-Time World Trading Champion in a little more than 10 years.
I've been a professional trader since 2001 and in 2008 I became World Champion using just 4 automated trading systems.
In 2015 I founded Unger Academy, where I teach my method of developing effecting trading strategies: a scientific, replicable and universal method, based on numbers and statistics, not hunches, which led me and my students to become Champions again and again.
Now I'm here to help you learn how to develop your own strategies, autonomously. This channel will help you improve your trading, know the markets better, and apply the scientific method to financial markets.
Becoming a trader is harder than you think, but if you have passion, will, and sufficient capital, you'll learn how to code and develop effective strategies, manage risk, and diversify a portfolio of trading systems to greatly improve your chances of becoming successful.