Did you know that the vast majority of entry triggers that many traders use have absolutely zero predictive value and I know better than random? My Name’s Adrian Reid and I’m the founder of Enlightened Stock Trading and I’ve been a systematic profitable stock trader for over 15 years now and in this video today, I want to talk to you about the importance of ensuring that you have an edge, a positive image generated by your entry trigger.
Now I know there’s a lot of talk out there about how entry triggers and not that important and you make the money on the exits and everything and while that’s true, what I know from all of my trading experience and system testing over the last 15 years, and I’ve tested hundreds of trading systems, is that if you have an entry trigger which is no better than random or is not profitable, then you are leaving a ton of money on the table. If you don’t know whether your entry trigger has a positive edge, generates positive expectancy, then you are leaving money on the table. Now, if you get your entry trigger right, when you know that you’ve got a positive edge as a result of your entry trigger, then you can be a lot more profitable.
Yes, entry is not the only thing that matters. You’ve got to have a complete trading system, but in this video I want to demonstrate how you can determine whether your entry is better than random and whether it actually makes money. What I’m going to do is use AmiBroker to show you how to test the edge of your entry trigger over various different timeframes. I’m going to do that using a highest high breakout entry. Looking at stocks making new highs, and we’re going to determine whether or not that entry trigger actually makes a difference, is it better than random, does it generate a positive edge in your trading. In AmiBroker, what I’ve done is created a simple template here for … here it is.
I’ve created a simple template here to calculate the edge of an entry trigger over various different timeframes. Now I’ve just set this up and I’ll run you through this real quick. I’ve set it up with a very high level of starting equity. I’ve given it $10,000,000 because what we want to do is we’re going to run this entry trigger over thousands of stocks, over decades of trading data to determine whether on average over many, many trades, this entry makes a difference. We’re going to have a large starting equity. Similarly, we’re going to have a large maximum number of open positions. I’ve set the max open positions to a thousand.
I’m not going to worry about margin or leverage. I’m just going to set the account margin to a 100 because this is not really a proper back test. We’re just calculating the edge of a system. I’ve set commissions to zero because again, we just want to know how big the edge is. This is not a complete trading system. I’m using a standard back test and I’m entering the day after the breakout. In this test, we can see the close is a new highest high breakout and then we’re going to enter the open the next day.
In order to make this somewhat realistic, I’m setting a minimum turnover of the stocks that we’re trading because I want to eliminate tiny little microcap stocks or stocks that are really illiquid because I want to make this representative of stocks that you would actually trade. I’ve set a minimum daily turnover over the last 20 days of $500,000. Now what that does is eliminate stocks that trade very erotically. These are stocks that are tradable, you’d be able to get in and out without too much slippage and so that’s really important. Now here’s the actual entry signal that we’re testing. The first thing I’ve done is we can test different lengths of breakout, okay.
I’ve set the number of breakout bar as an optimization variable in AmiBroker, and I’m going to set a default value of 200, but I’m going to set my optimization to vary between 25 buyers and 300 buyers in steps of 25. What that’s going to allow us to do is look at different lengths of breakout to see if the length of the breakout impacts the magnitude of the edge that this entry trigger gives you, and that’s going to be really important as you’ll see. The actual entry trigger itself is that the closing price is equal to the highest high close of the last X number of bars, in this case breakout bars. When we run this back test with a default value of 200, we’re going to enter when the stock makes a new 200 day highest close, okay.
Then in order to determine whether this entry is valid, we’re going to hold it for a certain number of days. I’ve set the exit buys again to an optimization variable and we’re going to vary it from 10 days to 50 days in steps of 10 or 10 bars to 50 bars in steps of 10. Now you’ll see here the buy signal and the sell signals. The buy signal, I’m combining the liquidity filter which we defined here. The entry trigger a which we defined here which is the breakout, and I’ve also added this extra thing which says basically ensures that we’re only taking a new breakout. Okay. I don’t want to take every single breakout in a trend because over the course of a trend, there’ll be many breakouts.
What I want to demonstrate here is the edge generated by the first breakout in the trend, so that’s what this little rule does here. Now, there’s no sell signal, no formal sell signal. What I’m doing instead is having a time stop. There’s an end bar time stop using the applystop Amibroker function and the number of bars in the time stop is determined by this exit bars function, which again were varying from 10 to 50. For the purposes of this test, I’m making every single position a constant $1000 going into each trade. What that allows us to do is compare across all the different trades and make sure whether or not we’ve got an edge.
I’m going to run this back test over 20 years of data also on the Australian stock market and we’re going to see whether or not entering on a new 200 day highest close gives us a positive edge in our trading. What do you think, will it or not? Let’s go across to the AmiBroker screen here and I’m just going to open up this little piece of Amibroker AFL code that we were working on just before and I’m going to set the stocks to all Australian stocks. In my back test settings, it’s long only on a daily chart, and so that’s what we’re going to test. It’s from 1993 to 2018, middle of December. Actually, let me just set this to today and we’re going to run a back test. You’ll see AmiBroker is super quick at this sort of thing which makes analysis so easy.
If you’re trading without the benefit of trading software like AmiBroker, you’ve got to get on board because this allows you to analyze your performance of your different components of your system and your whole trading system just so much better, okay. You can see already in just a couple of seconds, we’ve got data on all of the different stocks in Australia from 1993 to present on the profitability of that breakout signal. Now remember, I just ran the default setting so we’re testing a 200-day breakout and holding it for 50 bars. There’s no other rules and what we want to know is, is that profitable. Coming back to AmiBroker here, I’m going to just click on the report tab and let’s have a look at the report or just maximize that.
You can see it took 2362 trades. That’s a lot of data and the average profitability of those signals was 1.85% Now this is huge, right? Because what this shows you is that just buying a 200-day high and holding it for 50 bars has a positive edge. There is no stop loss, there is no exit rule, there’s no fancy filtering, there’s no index filtering, there’s no worrying about whether it’s a bull market or a bear market. This shows you that just buying a highest high breakout, a 200-day highest high breakout has a positive edge over 50 days. Okay, now let’s have a look at the chat and just see how stable it is over time.
Now, obviously this is not a complete trading system and I don’t recommend you only trade by buying a 200-day breakout and holding for 50 days, but what this shows you, this equity curve shows you, is that the performance is fairly stable over a long period of time. Okay, there’s some shaky periods in here and it’s not always profitable. The equity curve is going sideways in the middle here, but over the last 20 odd years, this signal has had a positive edge. Now that’s fantastic because that means that this is a solid basis for you to start to develop a trading system around. This is why breakout systems work, but I want to show you a couple of other things here because the question really is over what time period is this signal giving us an edge. This is 50 bars.
Does it give us an edge over 10 bars or over 20 bars or over 100 bars? What we can do with our code here is remember we had this optimization variable, which is the number of bars in the breakout. We had this other optimization variable, which is number of bars we hold for. I’m just going to leave it at a 200 bar breakout for now and let’s try varying the exit bars and have a look of what happens, okay. Because when you vary the exit bars, you’re going to see whether or not the edge is profitable at 10, 20, 30, 50 days and that’s going to give you an idea of how long term your system should be when you use this 200-bar breakout entry trigger. I’ve just changed it to a param statement, so it’s not going to vary.
AmiBroker when I run the optimization is not going to vary the breakout bars. It is going to vary the number of bars we hold for. Let me save that and let me come back to AmiBroker here. Let’s open it up again and this time, I’m going to hit optimize, and what it’s going to do is it’s going to step through 10, 20, 30, 40, 50 days of hold period and see what sort of edge the system generate. Here we’ve got five test values and if you look all the way over on the right hand side, if I just expand this out here a bit, you’ve got the number of bars held in the test. Now coming back to the beginning, I just want to look at the average profit per trade, so let’s go across here and find it. Again remember, this is not a complete Amibroker trading system, okay.
All I want to do is this signal giving a profitable edge of a certain amount of timeframe. The average profit or loss in percentage terms is in this column here, and you can see that over 10, 20, 30, 40, and 50 days, the edge of a 200-bar breakout is absolutely profitable. What that means is that entry is going to give you an advantage in the market. Is your entry giving you an advantage in the market right now? If you’re using an indicator to give you an entry and you have not tested it, then you don’t know if you’re trading is any better than random. You need to do this sort of analysis and validate that your entry is actually better than random and better than a simple entry trigger like this at 200 bar highest high breakout can give you a dramatic edge.
Now, this is in the Australian stock market. If you’re trading the US or the UK or anywhere else, you want to run this on your own data, on your own stocks and determine whether or not it gives you an edge in your markets too. Now I want to take this a little further. Okay, so we can see that the 200-bar breakout gives us an edge over 10 to 50 days and beyond probably, but what I want to do now is look at different length of breakout. Let’s fix the number of bars that we hold these trades to just 50 bars. It’s a fairly long term system, medium to longterm system, and I don’t want to vary the number of bars and the breakout and just see whether or not that makes a difference.
Do lower levels of breakout delay to enter more quickly give you a positive edge as well? Let’s go back to our Amibroker code here and I’m going to set the number of bars held to a default value of 50 and I’m going to change the size of the breakout to an optimization variable. We’re going to optimize that and let’s vary it from 25 to 300 in steps of 25. That’ll give us a good idea about whether or not different lengths of breakout give you a profitable edge again over a constant 50-bar hold period. Let’s come back to our AmiBroker. I’m going to open this up again and run the optimization. Now this will take a minute or two to run, or even maybe just a couple of seconds, and then we’ll be able to analyze whether or not different lengths of breakout have different levels of positive edge.
Again, you can see that running a back test like this in AmiBroker is super quick and if you’re not doing this sort of analysis, chances are you’re leaving money on the table. If you’re not doing this analysis, chances are you don’t have the level of confidence in your trading approach that you really need to be profitable in the long run. Okay, so the test is finished. You can see we’ve got 12 different optimization results because we’re varying our breakout period from 25 to 300 in steps of 25. Now again, what I want to do is just look at the average profit per trade in percentage terms and see is that breakout giving us a positive agent and is there some sort of logical optimum over this 50-bar hold period, so let’s have a look.
The shortest breakout period not surprisingly gives us the lowest positive edge. A positive edge of 0.4% per trade buying a 25-bar breakout and holding for 50 bars. Now the short term breakouts are not as profitable. Why is that? It’s because a short term breakout like a 25-bar breakout will get you into lots of false moves. There’s plenty of moves where you’ll get a little rally. It’ll hit the 25 bar high, but it’ll fail and fall back to a ranging market, but the longer the breakout, the more certain you can be that you’re getting a real trend. Okay, so let’s see if the data actually supports that.
If we’re just looking down this column here, as we increase the length of the breakout, this is 25 bars, this is 50 bar, this is 75, this is 100, you see that the average profit on each of these trades is increasing. Longer breakouts give us better results, but only to a point. You’ll see here that the results start to flatten off and we get less and less incremental advantage from lengthening the breakout, but what this shows me is that I would not want to use a very short term breakout for a medium term system. I much rather use a longer period breakout like anywhere in this sort of range is going to give you pretty good results, right?
That’s between 125 bars say in 300 bars, doesn’t really matter that much. The entry edge is fairly constant. Okay, so a 200-bar breakout right in the middle of that range actually works really well. This is the way that you want to evaluate your entries to make sure that they’re better than random. Are they actually giving you a positive edge? Now this system if you like, the 200-bar breakout, let’s just run this 200-bar, 50-bar breakout again and have a look at this equity curve. You’ll see when you look at the equity curve, again it’s not a complete system, doesn’t encourage slippage and commission, but this is keeping you out of bear markets. It’s stopping you from buying trades when the market’s going down.
The overall trend in the equity curve over 20 odd years is up, and so having an entry with an edge can make a dramatic difference in your trading. Now if you’re not doing this, then chances are, as I said earlier, you’re leaving money on the table and you probably don’t have a 100% confidence in your trading system. Now I don’t know if the 200-bar highest high breakout is the right entry for you, but what I do know is that you need to test the entry you’re currently using and if you’re not doing this, then what I want you to do is click the link on this post.
Click the link below and download my trading system confidence cheat sheet because what that’ll do is show you step by step how I evaluate a trading system, the steps I go through to make sure that I’ve got absolute confidence in my trading systems. When you’ve got that confidence, you better follow your system much more consistently and you’ll know for certain is your system profitable. Simple testing techniques like this using AmiBroker can put streaks ahead of the pack of unprofitable traders because getting an edge in each component of your trading system makes it real different.
Just imagine if you take this technique, you get an entry signal with an edge, you get a trend filter with an edge, you get initial stop loss that gives you an edge and you can exit signal that gives you an edge, and you get a market filter that gives you an edge, and you combine all of those together. All of a sudden you’ve got a dramatic positive expectancy in your trading system. It can make a huge difference for your trading. Click the link below and download my trading system confidence cheat sheet and improve your trading today. My Name is Adrian Reid. This is Enlightened Stock Trading and I’ll see you in the next video. Bye for now.