Show full Transcript

Hey. Adrian here, and in this Amibroker tutorial, I want to show you a really cool feature that you can use when you are developing single instrument trading systems, trading systems that trade just one ticker. Most of my systems trade a whole portfolio of stocks simultaneously, but this week, I’ve been working on a new mean reversion system to trade the QQQ ETF, and I developed that system. At the end of the day, I’m really happy with it, and I wanted to know what other ETFs might that system work on? Where else could I deploy it? Because the results are pretty cool.

Let me show you what I got so far. I developed this whole system on the QQQ, and then I realized that if I trade it on the TQQQ, which is the leveraged version of the Qs, the system generated much better profits. So I’m just going to show you the backtest report here, and here’s the compounding equity curve. So yeah, it’s kind of nice. It’s not the best system I’ve ever seen in the world, but for a mean reversion system on US stocks, not too bad. The drawdown profile, the drawdown’s a little high here, but again, it’s a mean reversion system on an ETF. I’m not expecting it to shoot the lights out. I just want something that works and is stable over time.

Had a annual return of 19%, drawdown of 40, which is a little high for comfort, but the curve MD is 0.47. Not sure if you can see that. It’s a little bit small. There it is, 0.47. So as part of a portfolio of systems, this is something that certainly has some potential. The interesting thing about it, if I can show you this again, is it’s only invested 12% or 13% of the time, and it makes 19% return. So the risk adjusted return is actually over 148%, which is really quite compelling, certainly compared to buy and hold. So, that’s what I developed for the TQQQ.

Now, my question was, where else could I apply it? And what I want to do is show you a little trick in Amibroker, so you can apply a single instrument system to many different tickers simultaneously and get all of the results at once. So what you want to do is, first of all, we’re going to backtest on a whole watch list. Now, I’m going to backtest this. I’ve got this watch list called US Sector ETFs, and there’s nine of them in here. It’s all the XL ETFs, so XLB, XLE, XLF, and so on, and I’m going to backtest on all of those.

What you want to do is come into analysis settings, come down to report, and usually, this is unticked, Generate Detailed Reports for Each Symbol in Individual Back Tests: Slow. And the reason it says Slow is because it is slow. It does take some time, but let’s just tick it and then we see what happens. Now, instead of pressing backtest, what you want to do is click the little dropdown arrow and go Individual Backtest. And what that’s going to do is test the system against each of those tickers one at a time, because this is a single instrument system, and it’s going to produce the backtest reports for all of them individually.

Now, you can’t just press the report button here. You’ve got to go to the Report Explorer, so you’ll click on that, and what we’re going to do is sort it from… This is, I’ve run 27,500 backtests since I’ve cleared this, if you can believe it. And you can see here, all of the backtest reports for the different sector ETFs have been produced. Now, from here up, what we can do is have a look at each of them individually. The best one is clearly XLK, and that’s because that’s very similar to the QQQ, and the equity curve looks pretty amazing. This is exactly, well, not exactly, but it’s very close to the ETF that it was designed on, so I would expect that it works very well there.

Absolutely compelling. Equity curve is great. The annual return is 9%, but the risk adjusted return is 61. Let me just zoom in so you can see that. There you go. And the curve MD was 0.41, so that’s okay. It’s a good benchmark. Let’s look at some of the others. You’ll see here, I’ll just highlight them all again, most of them are not that great. The compound annual returns go from 3%, 1%, 2%, zero nine, zero three, basically zero two. So most of them aren’t very interesting, but this one, XLB, is potentially interesting. I’ll just open that one up, and let’s look at the equity curve.

Yeah, look, it’s not great, but it’s got some potential and maybe if you could fine-tune it to that particular instrument, you might be able to make something of it. So, what is the XLB? Let’s just go to the chart. XLB, it’s the material sector ETF. Okay? So that is a quick hack to allow you to backtest your single instrument systems over many different instruments simultaneously and get all of the performance reports. Now, when you’ve done with this, my suggestion is you go back to your analysis window, go to the settings, go to the report tab, and uncheck this Generate Detailed Reports for Each Symbol and Backtest, because it is slow and it does clog up your computer with lots of unnecessary reports if you don’t need it.

So if you’re doing an investigation, you want to find, where else can I apply this system? What other instruments will it work on? That’s a great way to do it. Doesn’t require any extra code. I hope this Amibroker tutorial has helped you. If you need help with Amibroker, you got any other questions, comment below this video. And if you’re watching this in the members area, then ask any questions in the forum and I’ll help you out. That’s all for this video. Bye for now.

Pin It on Pinterest

Share This

Share This

Share this post with your friends!