Show Full Transcript
Hi Adrian Reid here, founder of Enlightened Stock Trading. And in this Amibroker tutorial video, I’m going to show you a very cool feature for you to use when you’re optimizing your Amibroker trading system. So you can visualize the results that you’re getting and help you choose the the best parameter settings or the right the right parameter settings for your objectives based on your optimization. As you can see on the screen in front of you, when you do an optimization, you’re normally presented with a table of data. And if you’re a numbers person and you can look at this and choose the, the parameter value that you like the most, then that’s great, but some people find it a little bit difficult and would prefer to visualize the data. So I’m gonna show you how to do that natively within Amibroker in this video. So the first thing I’m going to do is we’re going to select as I’ve run, I’ve run here and optimization based on one of my trading systems called the freight train. And this is just a single variable optimization based on the moving average.
I varied one of the moving averages over quite a wide range. And as you can see in this output table, there’s 20 steps in this optimization. And usually what I do is I look down the list, the column of each of the relevant, um, performance variables like the compound annual return, like the risk adjustment, return the max system draw down and so on and try and find the area of maximum stability. Sometimes it’s quite hard though to see that just in the numbers. So if you want to see the chat, this is what you do. First of all, run your optimization, then click on the hitting of the column that you want to visualize in a chart. So click on car for instance, compound annual return. And then if go to this, see this optimize button, there’s a little dropdown arrow right next to it.
And if you click that, then click on 3d optimization chat. And what happens is you get this three H shot of the column that you have, um, optimized, very plotted. So the performance of the companioning return in this case against the, um, the optimization, the parameter values. So we’ve optimized the number of bars and a fast moving average. And you can see here we’ve optimized from 10 to 100 in steps of five and we’re plotting the compound annual return, which shows there’s a peak here at around 20 and then it drops down and then it’s fairly stable and drop down again and so on. And there’s a couple of really cool features that you can do with this Amibroker chart. The first one that I really like is, um, this high watermark, this watermarks, so water levels. So you can, by clicking these buttons on the right, you can raise or lower this horizontal.
You see this sort of bluey line here, that’s called the water level. And the reason you, you use this is to where the values, where the performance is similar. So if you just click down and you can see which values poke through the watermark first. So here around 40 is higher than here and higher the here. And then if you keep dropping the watermark, you can see how it appears. So just helps you interpret the data a little bit. Um, so that’s called the water level. Now the next thing you can do, there’s all these buttons about how to format it. I don’t worry too much about that, but what you can do is just click and drag this chat around so you can adjust the three day view quite a bit just by clicking and dragging. Personally, I quite like the default value, so I just didn’t normally look at it just like this.
Now we’ve looked at the car, now you can copy this and paste it into your notes. So I keep all of my, um, system development notes in a OneNote page. So I started a new OneNote page for every system that I’m developing. And as I go down and record the results, you know, I might copy this. Um, see if you click this copy button that puts a bitmap of that graph into, onto the clipboard. And then you can go into your OneNote or into your trading journal and paste it in there. So you’ve got a record of it. So this is just one, um, performance variable that we’re plotting. What if we want to look at something different? Let’s now look at the, um, max system drawdown. Let’s plot that one. So all you have to do is click on the headline, the hitting of the column that you want to plot.
Then come back here to optimize. Click the little dropdown box to the right, and then click the 3d optimization chart. And you see now we’ve got maximum system drawdown. And higher on this chart is always better, right? So, and a draw down of 28% is better than a drawdown of 33%. So the best drawdown, let’s adjust the how the water level. Again, the best drawdown on this optimization occurs here at looks like about 30, um, bars in the fast moving average, but it’s not very stable. You can see here, this is one of the great things about this 3d chat. You can see the relative stability of the, um, the, that performance variable as you change the parameter value. So, um, the best value for drawdown in this case is it 30 bars in moving average, but you can see it’s not stable.
It’s a performance spike or peak. Um, because if you go up a little bit, the performance drops. If you go down a little bit, the performance drops. So where is the area of stability? Well, it’s actually at here to the right between about 15 and 25 or 30. That’s the area of maximum stability. So if I was looking at this optimization, I would choose that as the performance value. And you can plot this for any of the columns in your, um, in your optimization results. So if we click on net profit, produced this chart again, and you’d get a chartbased on net profit and you can see, you know, stability and so on. Um, so that’s for a one dimensional optimization. Now what if you’re optimizing two parameters simultaneously? This is where it gets really, really useful. Now, I’ve already done an optimization, uh, for the purposes of this video over here on the other analysis tab.
And you can see what I’ve done is I’ve optimized two moving averages simultaneously. There’s the longterm moving average and there’s the short term moving average. So let’s have a look at how the 3d, um, graph helps us interpret a two dimensional optimization. So we come, I’ve selected compound annual return as the variable I want to plot and we click on three optimization chart and look at this. So we get a three D chat now that has the number of buys in the fast moving average on this axis, the number of buyers in the slow moving average on this axis and on the vertical axis, the performance, um, variable that we’re measuring in this case compared annual return. And this is where the, the water level is particularly useful because uh, this surface chart is fairly hard to read and what we’re looking for is an area of maximum stability.
So if you increase this water level, you can see how that the peak in performance, the best compound and your turn is way over here. And that looks like at about 60. I’m on a fast moving average and a hundred on the slow moving average, but you can see it’s a bit of a spike. There’s not really a big stable error of performance there. I think a bit of area of performance might be sort of out here or even over in this area. But the point is, or the useful aspect of this tool is you can now visualize within Amibroker your optimization results. And um, I think that’s really powerful because when we’re optimizing the enlightened stock trading way, we’re looking for stability, not just the peak and performance and plotting it like this on a three D chat really helps you do this. And again, with the three day chart, even with a two parameter optimization, you can look at any of the performance values, um, maximum system drawdown and we’ll produce this chat again and you can see the maximum system drawdown.
You can start to make decisions about where to position your parameter values based on the interaction between those, the longterm moving average in a short term moving average or whichever parameters it is that you’ve optimized. So I hope that’s helped. Don’t forget to, um, make sure each time you produce these, keep notes of why you’re making the decisions, you know, copy these, paste them into your trading journal and make sure that you keep a record of all of your decisions. And you know, this is just another powerful tool in helping you optimize for maximum stability. And the great thing about optimizing for maximum stability is it helps you get a high level of confidence. You’ll be profitable in the future and not just have a beautiful looking back test. It’s actually completely useless in real time trading. So I hope that helps. That’s all about the three D graph viewing in Amibroker, a very underutilized tool. Highly recommend your chicken out and I’ll see you in the next video. Bye for now.