Vollständiges Transkript von „I Generated +1300 Strategies, Only 10 Survived.“. Klicke auf einen Zeitstempel, um das Video an dieser Stelle zu öffnen. Du brauchst ein anderes Video? Nutze den YouTube-Transkript-Generator.
0:00 What happened when you take a hand-built indicator and feed it to a genetic algorithmic machine and then let the machine discover combination that you would never think of? I ran the experiment and here is what it found. Before we go any further, let me tell you about the hand-built indicator. It's called KC bands. I built this indicator a while ago and I have a couple of videos on it from the channel which you can watch it to learn about this indicator. And here is what the indicator looks like. It's like Bollinger Bands, but instead of taking the moving average of the close prices, I take the average of the highs for the upper channel and the lows for the lower channel. And then instead of adding a standard deviation,
0:45 I add a multiple of ATR to the top and deduct a multiple of ATR from the bottom. so we get a different channel than Bollinger Bands remember the indicator is not about becoming the best channel indicator it's just about being different than the other channel indicators so we can get different strategies different equity caps also built in the channels I have the %c of KC Bands and the width C% so this %c measures where the close in respect to the channel so for example you see here the close is below the lower channel and that's why you see here the close is in the red
1:31 zone and here the close is above the upper channel and that's why you see it above the upper channel here so this is another way to measure where the close is in respect to the channel and this is in fact the best way to trade a channel because this way you can easily have a level for entry and exit And the other indicator measures the width of the channel. So for example, you see here, this is a very wide channel and you can see we are wide here. And then for example, here in red, we can see this is a lower width. And this is a kind of volatility measure using the channel. And it's all built in the same indicator. Now I programmed this in easy language or power language because this is the language that I am proficient in. and
2:20 before this used to be a big obstacle to convert this into strategy quantX because strategy quantX while you can easily program in java indicators the problem is in order for the strategy to be exported from strategy quantX and work in other platforms you have to build those indicators for the other platforms so that means you have to build it for StrategyQuantX and be compatible with MetaTrader 4, MetaTrader 5, MultiCharts and TradeStation. Those are the platforms supported in StrategyQuantX. Like I mentioned, it used to be an obstacle, but now thankfully to AI, it's a lot easier to do it. And so I did transfer this indicator to
3:09 StrategyQuantX with the compatibility indicators for the other platforms. All this is available for free in my community and an installation guide so you can easily follow up to get the indicator so once you import the indicators you will have three indicators the KC bands KC bands %c and KC bands with c so remember the with c is a volatility indicator %c is the most effective indicator because you can add levels to it KC bands it gives you three bands the upper the lower and the middle one and in fact if you go to algo wizard and just add condition and let's
3:56 see KC bands so if you put KC bands you see here you will have upper lower and the middle and these are the parameters you can change for KC bands so the look back period the ATR level and the multiplier for ATR and then there is a smoothing average If you put this to one, then there is no smoothing average. Now I built hundreds of strategies, mere reversion strategies on the S&P 500 index because that market has a huge edge on the long side using mere reversion style. So this time I'm going to be harder on SQX to come up with better strategies because I already have hundreds of them. So let's build something that is much more profitable, better quality
4:43 strategy than what I have. Also, I'm going to force it to only do it with KC bands. So we get a different equity curve. So here is the setup. In strategy quant X builder, we will build a simple strategy long only. And I will use the genetic evolution. So the reason I'm using genetic is I want a different entry signals. Something that I would not think of. And for the conditions, we will force StrategyQuantX to pick only one entry rule and one exit rule. This is the global indicator periods and the look back shift period and the number of exits including stop loss and profit target. Now
5:29 stop loss and profit target are not required. And then we go genetic options. I did not play with it. It's only profit factor above one. Data I'm using the S&P 500 from 2018. 7 all the way to end of March 26. I have 25% out of sample. And in trading option, nothing is picked. And in building blocks, there is nothing picked in signals. In indicators, I only picked three. So the KC bands, KC bands, percent C, and with C. Now I see here 22 blocks because you need comparison blocks for the indicator to work. And in this case, I picked all of them. and then for stop limit entry blocks I'm using the close the high and the low then we come
6:17 to the indicator so we are going to use limit and market and we will allow the following options the exit profit target trailing stop and exit rule money management I'm using one contract fixed size and we are not doing any cross check And like I told you, the ranking will be a little bit more difficult. So the profit factor for the end sample is 1.6. The odd expectancy in sample is 0.5. And I want the average trade of the out of sample to be better than the average trade of the end sample. The profit factor of the out of sample is greater than 2. So the end sample is 1.6. This is much higher. And minimum of 200 trades. Now for this run we are going to do only 400
7:06 strategies. Okay so the 400 strategies are done and for the second run I will change the condition to be 2. So that means I'm forcing the genetic algorithm to pick two conditions. Hopefully I'm going to see probably KC bands width with the KC band C% so using the volatility and we will run it and we are looking to make another 400 so we have about 500 strategies and finally I'm going to ask for a different combination with a pattern so for the patterns I will pick the IBS so this
7:54 is internal bar strength and it's a good pattern for mirror version And this is a multi-bar internal bar strength. And it should be a good combination. So now I'm going to force it for three conditions. So hopefully I will have two KC bands and one internal bar strength. And I'll run again for about 400 strategies. So we should be around 1,300. Okay, so we have 1,377. and let's sort by net profit and let's see what strategies we get so we go to source code and pseudo code and let's see the first one so this is I think the
8:41 three conditions so we have KC bands with C so this is a volatility measure and KC bands so this is the normal KC bands and you can think of the normal KC bands as a moving average So in this case it's saying this KC bands with these parameters is lower than this KC bands with these parameters. So it's like trend is down. And then the other block is IBS. So this is just like I expected. It used the KC bands, the normal KC bands, which is like a moving average considerate. And then we have the width C, which is like a volatility filter and the IB, which is pattern
9:27 so these are three different things and they are not the same thing and if I go to the next one this is totally different so this is IBS one block and then the next block is KC with C that's the volatility measure and so this is good to conditions and then this one again it's for conditions this one But now sorting through 1400 strategies almost to find out which one is very close to the other. Because remember, if you say KC bandwidth with the look back of 13 and then the other strategy saying KC bandwidth look back of 15, those are basically the same
10:12 thing. Yes, there's a little bit of difference, but they will be highly correlated. So we need to filter them on correlation. thankfully this is available in SQX so let me expand this and you see here we have filter by correlation so let's pick weekly and let's go below 0.3 so currently we have 1377 strategies let's filter them down so our strategies filter 1257 so that means out of 1377 we have 120 and this is not a mistake this is the normal behavior
10:57 this is what you should expect if you are building strategies based on ranking you will have a lot of correlated strategies in fact I should go further because 120 still a lot so let's go by 0.25 because I expect if I go really low then I will probably have one strategy let's try 0.25 And 48 is gone. That's good. Let's try again by 0.2. And I think I'll go a little bit lower maybe. And let's try 1.5. So this is really on the edge. And I like this. So we have 28 strategies from 1,377.
11:44 And these are 0.15 correlation. So that is really good. And of course, still, this is too many. So let me pick the top 10. So I'll pick one here. And let's pick top trades. So I picked 10 strategies that are basically the best in different categories because it's very hard to judge which strategy is better. So now let me save these strategies to CSV files. now I'll bring these strategies to this app that I built so if we go to add strategies and once the strategy are imported we can see that most of them are highly elevated
12:32 in overfit risk now this is a measurement it's not a guarantee it's just an indicator but two of them are moderate and immediately we can see that this one is not doing so well recently even though the equity curve looks amazing. So let's look at this one. Now one of the main reasons I built this app is to have a single score. Remember before we had to look at net profit, return to drawdown, our expectancy, sharp ratio. This one score combines 21 metrics into one. So we know this score is good. but remember I told you it's not doing so well lately and this is the
13:17 reason if we look at the latest trends we will see that the time underwater recently is higher than before and the maximum consecutive losses is higher than before so overall this is nothing because we have all the other metrics are good now the other good strategy that is moderate in overfit risk has a bit of problem in risk score so the risk score is 50 let's look at this one and this score is caution and we can actually see why so if we bring the drawdown so we have a big drawdown in the beginning in 2009 if we look at the top drawdowns this one is 42 percent and lasted for
14:07 almost four years And here are three strategies I loaded in AlgoWizard to see exactly what's happening. So this first one is really simple. KC bands percent C is rising. So that means this indicator is rising. Now condition says it's rising, meaning we don't care where it is in the channel. We are just looking for a rising pattern. So this could be here. This could be here. This could be here. and then we enter on a limit order at this level the low of three bars ago and then we have an exit of a profit target 195 ticks or a trailing stop of 120 ticks
14:56 so this is a very simple strategy And honestly, I would not think of this. The idea is with a simple indicator, you can generate different ideas, unique ideas. That's not saying that it will be robust, but it will be unique ideas that you can test for robustness and see if you can include it in your portfolio. Because you will have thousands of iterations that you can easily filter out with correlation or with another method. And then once you have 10 to 20 strategies, now you can pick and choose by diving into the details of that strategy the drawdown periods stagnation what's your CSI score or whatever combination of metric score that you can build to come up with a strategy that
15:45 you can take it to final robustness testing and put it in your portfolio if you like this video then you will love the next one