Comparing a Back-Tested Algorithm to the Live or Walk-Forward PerformanceAlgorithmic Trading Educational & Tutorial Videos
This algorithmic trading educational video is a great overview on how we compare the live performance of an algorithm to it’s back-tested.
Topics covered include: How do we back-test an algorithm? Why is the back-tested model the most optimistic version? Once an algorithm begins trading live – how do you know if it’s still a good trading algorithm? What is the swing trader algo? How does it perform in back-testing? More importantly, how has it done since it’s algorithms began trading live? With 19+ months of live trade history – we are ready to grade the algorithms contained in this automated trading system.
In this video, our lead developer reviews the back-tested results from the swing trader (Momentum ES Algo + Treasury Note TY Algo) and compares the live/walk-forward returns to the back-tested. Is the swing trader meeting the back-tested expectations? Watch this video to see for yourself.
It is our opinion that the algorithms we offer are high-quality trading systems, however no trading system is perfect. Trading futures & options involves substantial risk of loss and is not appropriate for all investors. With that said, if you have risk capital available to trade and are willing to accept the risk trade off – with the potential for great gains, reach out to us for a live demo where we will review our algorithms in great detail!
How To Evaluate a Trading Algorithm
Video Transcript Follows: In this video blog, I’m going to be doing an evaluation of the Swing Trader algorithm since it went live back in October of 2015. I’m going to compare the Momentum ES algorithm and the Treasury Note TY algorithms using the walk-forward analysis, and compare it to the back-tested. And just kind of do a review of how these algorithms have done since they went live, or since the last optimization.
Before I do that though, I would like to do the standard disclaimer. My company, AlgorithmicTrading.net, we are not registered commodity trading advisors. We claim the self-executed exemption from registration that the CFTC grants. Keep in mind that trading futures and options involves substantial risk of loss and it’s not appropriate for all investors, and throughout this video blog, I’ll be talking about live returns, also walk-forward, and then also back-tested. We’ll have the appropriate disclaimers listed when we get to those points. One thing I’m also going to do though is talk about, I’m going to actually go over an example of some, basically an algorithm, I’m going to show you how we back-test it, just so that you know kind of what I mean when I talk about back-testing. And in that, I’ll also do a quick optimization of it, and use that as kind of a, well, basically to provide context for the rest of the discussion that we do. Let me go over the topics that we’ll be covering.
Back-Testing vs. Walk-Forward Testing
We’ll be talking about the swing trader which again, it trades two algorithms, the Momentum ES and also the Treasury Note. I’ll talk about the difference between a back-tested model versus walk-forward. Then I’m going to talk about just how we evaluate an algorithm’s live performance versus its back-tested. I’ll go over our methodology for that. Then we’ll do a case study of the Momentum ES algorithm which is one of two algorithms that are traded in the swing trader. We’ll do the same thing for the Treasury Note TY algorithm and then I’ll just kind of do a conclusion where we combine the Momentum and the Treasury Note and show you how they’ve done compared to the back-tested. First I’d like to just talk about the swing trader algorithm.
The swing trader is a combination of two algorithms that we offer. It’s the Momentum ES algorithm. We also have called that the Swing Trade ES and also the Bull Fire. But, it’s designed to do well in up moving markets. And the other algorithm that the swing trader trades is called the Treasury Note TY algorithm, or the Swing Trade TY, and early on it was called the Push Pull algorithm, and it’s designed to do well in down and sideways moving markets. When you combine these two algorithms, you have the swing trader. It trades in unit sizes of 15,000 and it’s, the last time that it was optimized was October 1st of 2015 and this is the equity curve since then. The total number of trades, percent profitable, the max drawdown it’s seen, and the average gain per month, and then per year. Next what I’ll be talking about is how we analyze an algorithm. Basically we’ll be comparing the difference between back-tested and then walk-forward.
When someone develops an algorithm, usually the way that they start is they’ll create a back-tested model and they’ll optimize it, and that’s kind of the starting point for any algorithm. The next thing that, more than likely, they will do is a walk-forward analysis. Now, keep in mind that the back-tested model is always the most optimistic. It’s the least reliable of all the models, but it’s a starting point for any algorithm that you might develop. The walk-forward analysis is done usually after you’ve created a back-tested model that looks good, and what it does is it runs the algorithm, optimizing in an in-sample data set, and then it compares in an out-of-sample data set to see how that algorithm would’ve done had it been created, say, in 2008. It will optimize from maybe 2001 til 2008 and see how it would’ve done in ’09. And then that walk-forward analysis is kind of a step forward, and you can do anchored and also rolling optimizations. But then it basically sees how it would’ve done in ’09 and then optimizes from ’09 to ’01 to see how it would’ve done in 2010, and then optimizes from 2010 all the way back to ’01, and then sees how it would’ve done in 2011. It kind of walks forward using an out-of-sample data set to see how that algorithm would’ve done.
Now, the problem is, is that even when you do a walk-forward analysis like that, since the original algorithm was coded using all the data from ’01 til, say, 2013 there’s still the possibility of over-optimization of curve fitting. That’s where the blind out-of-sample analysis is going to be the most accurate. What that refers to is, once you’ve coded an algorithm and you’ve started trading it live, you’ve already optimized it, any results you see moving forward in time with blind out-of-sample data is going to be kind of the real results that that algorithm saw.
In our case, since these algorithms were last optimized in October 2015 and we actually began offering them at that time, any results that we see after that is going to be the most reliable or most accurate. It’s going to be considered blind walk-forward, and if it’s, the fills are taken from a hypothetical account then it’s hypothetical and we include slippage, and if it’s live trades taken from brokerage account then we note it as such with zero slippage.
MACD Trading Strategy Example
With that introduction, what I’m going to do is show you an algorithm that was designed actually a while ago, I think I did it for one of the blogs, and I’m going to optimize it and just kind of show you how that works so that you can see what I mean when I talk about back-tested data. This is a chart of the S&P 500, and it’s using 60 minutes candles. I also have a session setting on this chart that only shows trades, or only shows data, when the equity markets are open. That’s why you see these kind of gap ups even though this is actually the S&P E-minis. So if I, to show you what I mean, if I remove that setting and go to the regular session, then you see all the trades that occurred kind of overnight, in the middle of the night, when Europe opens, well I guess when Japan opens, and then when Europe opens, and then when the US markets open. But typically what I will do is limit the session period to only when the equity markets are open, the US equities, and that’s because that’s when the volume exists, and since we offer these algorithms to kind of that scale, we only want to trade when the equity markets are open, when there’s enough volume so that our fills are within one-to-two ticks of slippage. But the point of what I’m doing now is to show you kind of what back-testing is and how it works and why it’s a less optimistic model.
This is actual code for a MACD trading algorithm that I coded for one of the blogs I did, I think. If the histogram is sloping higher, then the buy condition is met, and it’ll actually buy. And I use a finite state machine to do some of the transition. It’s also setup to sell or to short when the opposite happens, when you have the MACD histogram sloping lower. And so, once those conditions are met, and then you also have a bearish cross. I believe that’s when we get out in this code. But just remember that this algorithm is one that I can use as an example here but it’s not one that we offer because it’s one that really doesn’t work that well, I guess, to put it plainly. But it was one that I did for a blog. I was analyzing this algorithm for, I think as a comparison of kind of what separates us. So just remember, this is not an algorithm that we offer but I’m showing you it so that I can show you how you back-test, and kind of show you the code as well. But if I zoom out, you’ll see now that, on the chart, there’s all kinds of trades applied. And so, here’s an example where it would’ve bought, and so the histogram is sloping higher, actually on these two candles, and so it would’ve bought, and it got out when it hit its target, kind of the next day on the gap up.
It had a few good trades here. Here’s an example where it went short. I’d like to show you the performance report for this algorithm because it’s really not that good, from what I remember, but let’s just kind of take a look at it. What it’s doing now is, Trade Station is looking at all the trades since, I think this goes back to May 2003. And if you look at the equity curve, it’s actually really horrible. So, even though it had a few good trades here and there, overall this algorithm is about as bad as an algorithm could be. But when you, let’s say though that this was an algorithm that had a promising equity curve. What we would do after we coded it, added it to the chart, examined the performance report, the next thing that typically people will do is optimize it. If I go into the strategy, and what I’m going to do is change the stops. Right now it’s set to a stop of 200, but what I want to do is let the, let Trade Station kind of schmoo across various stops, starting with $50 and we’ll go all the way up to $1000, and we’ll do it in $50 increments, which would be kind of one point on the S&P. What it’s going to do now is it’s going to actually optimize and so what we’re looking at, again just a reminder, is we’re, I’m showing you how a back-tested model is the most optimistic version of an algorithm that someone could provide. So, what Trade Station did is it ran through all the trades that would’ve been created, going all the way back to 2003, and it ran with a stop of $50, then $100, then $150 and so on, all the way to $1000.
Here’s the report of all the different stops that it looked at. Here’s the stop of 50, and a couple things that we’ll look at. The profit factor is one of the first things we look at. Right here you can see that, if it had a stop of only $50, the profit factor is actually 0.68, which is horrible, ’cause you want the profit factor to be above one, means that in theory it’s profitable. The algorithms that we trade, we’re looking for a prof factor of 1.3 or higher. Even after it optimized and looked at all the different combinations, it ends up picking a stop of $1000, but even with that, the prof factor still is only 1.06. But the idea behind me showing you this though is to show you that all Trade Station does is it goes back and looks at all the different combinations to see what the best one is, and it happened to be 1.06. Obviously that’s going to be the most optimistic model that we could create, because it looks at all the different combinations to see what the best stop would’ve been.
I also look at consistency. What we want to see is that, since $1000 is the best stop, and $50 is the worst stop, we want to see kind of a gradual progression of an increase in the total profit as the stop gets higher, ’cause what that tells you is that, generally speaking, with this algorithm at least, this MACD one, the higher the stop, the better. If it was kind of a random thing where you had loss, gain, loss, gain, loss, gain, and then it just happened to pick the one that had the highest, then obviously that’s not a reliable pattern more than likely, because it’s all random around it, but here you see, if you have a $950 stop, it gets a little bit, well, a little bit worse than $1000, but a little bit better than the $900. And so that’s one thing that we look at. But in this case, this algorithm is not a good one, but again, trying to show you how this is the most optimistic model.
Let’s say that the profit factor was 1.3 and everything checked out and it looked good. The next thing we would do is a walk-forward analysis. Now, in this example, I don’t think I’m going to do that because with my methodology I don’t rely heavily on that. I do run a walk-forward analysis, but the key thing here is that the back-testing tools give you an optimistic model, and that’s why a lot of people don’t put a lot of credence into a back-tested model, and they want to see kind of the live, or the blind walk-forward results.
With that in mind, go back to this slide. What we’ve done so far on this MACD algorithm is I’ve shown you just the back-tested model and how we optimize it. The next step, if this was an algorithm that we were looking at closely, is we would do a walk-forward analysis which, basically what the walk-forward analysis using the Trade Station tool does is it’ll optimize from a period way back here in 2010 all the way back to ’03, and it’ll optimize and pick whatever stop was best. Maybe starting from 2010 all the way back, the best stop to use was $800. Then it’ll kind of run the algorithm through this out-of-sample data using that stop of $800 and log how it would’ve done. And then what it’ll do is then it’ll optimize from, I don’t know, this period in 2010, all the way back and maybe now the best stop, once you include this data as well, is now, I don’t know, $850. Then it’ll step forward in out-of-sample data, and it’ll keep doing that. What it does is it gives you a less optimistic view of how the algorithm would’ve done, but it’s still not the most ideal which would be kind of the blind walk-forward or the live returns.
Analysis of Live Trades
The final thing that we look at is the blind out-of-sample data, and that’s going to be the most accurate representation. Now, the problem with the blind out-of-sample analysis is that it just takes time to accumulate it, ’cause see, the advantage of this step two walk-forward analysis is that you can do it without having to wait a year to actually accumulate live trades. So, with all of these analysis techniques, there’s always trade-offs. You know, the straight up back-tested model is going to be the most optimistic. If you code a new algorithm and you want to do some kind of walk-forward analysis, then you can run the Trade Station tool to do that. It’s going to be more than likely less optimistic than the back-tested. In other words, it’s going to be a little bit closer to what somebody might expect, but it’s still not going to be the best way to analyze an algorithm, which is with live returns. But again, the problem with live returns is it just takes time to accumulate that data. ‘Cause if we started trading this algorithm today, then six months from now we might have enough data to compare the live/blind walk-forward data with the back-tested, but it just takes time. That’s the problem. Now, for this blog though, because my company’s been around for a while now, we do have quite a bit of blind walk-forward data on the swing trader algorithm, and that’s what I’ll be talking about next.
Swing Trading Strategy Example
Alright, for the rest of this blog I’ll be going through a little bit faster, just now that we got a lot of the education side out of the way, we can kind of go through the results a little more quickly, I think. Okay so, what we’re talking about now is this step three, the blind out-of-sample analysis. We have a back-tested model of the swing trader algorithms, the two that are in it, and now we also have quite a bit of data so we can do an analysis. Usually what is ideal is to have at least 10% of out-of-sample, meaning that, if in the back-tested you have 300 trades, then you would want 30 trades of live data to begin kind of analyzing the performance.
If we go back to this MACD example, we probably actually have quite a, quite a lot of number of trades in it. Let’s see, oh and yeah. Here’s the equity curve though after the back-testing. I guess I probably should’ve done that in the previous section, after we back-tested, the equity curve does look better, and this is now going to be with a stop of $1000. It’s now, it now has a positive profit factor, which is good, or a prof factor that’s above one, I mean. Still not a good algorithm, there’s 2500 trades in the back-testing. If we were going to trade this live, once it had about 254 trades, or 10% of kind of out-of-sample trades, then we could kind of compare the live returns to see how it did compared to this back-tested. Now again, this algorithm is not good, so we really are just kind of talking hypothetical with some, you know, phantom algorithm if we were going to analyze it. You want to have at least 10% out-of-sample trades. And then once you have that, then you can see, okay, how does the blind out-of-sample compare to the back-testing? And is the, we want to see something above 75% for the percent profitable efficiency, and you also want to see at least 60% efficiency on the average gain per trade, and then are there any drawdown concerns. In other words, once traded live, has the live drawdown exceeded the back-tested by, by any amount would be bad, but you want to give it some buffer. So, between 10 and 20% is usually what I have used. Alright, so with that, let’s start looking now at one of the algorithms that we actually do offer, which is the Momentum ES algorithm.
Momentum Based Futures Trading Algorithm
Now that we’ve covered the differences between back-testing, walk-forward, and live returns, I’d like to start analyzing the Momentum ES algorithm. These are the back-tested stats, and keep in mind this disclaimer on the bottom, the CFDC Rule 4.41, regarding back-tested returns, but what you’ll see is that there’s a thousand trades in the back-testing, and that’s covered a period between the 1st of May of ’03 through October of 2015, and you’ll see that the percent profitable, the equity curve, the total amount that one contract traded would’ve made, and the margin required to trade one contract, is really only $5000, but we put $15k here, just to keep it consistent with what the, what the per-unit trade size is in the swing trader. This algorithm was originally traded in the Gambler, which is an older system that kind of became the ESTY Futures Program and then moved to the Crusher. But it’s been traded live since October in 2015, and back-tested from the 1st of May in ’03 through October of 2015. Here’s the back-tested. And again, you know, back when I developed this algorithm, or had done the final optimization in October of 2015, this is kind of the data that we had, and this is what we use to measure against. In other words, this is in theory the more optimistic model. Now, if I go to this next slide, it’s going to show the walk-forward returns. So, we’ve had 138 trades since October 2015, and so we’ve got about 13.8% of out-of-sample trades. It has a 76% profitable kind of per-trade win rate, versus the 77% in the back-testing, that’s good. The average trade per gain is actually $81, compared to the $56 in the back-testing, and so on that stat, we actually do better, or have done better so far in the back testing, which is a really good sign obviously.
Any time the live or the walk-forward hypothetical account is better than the back-tested on any one of these stats it’s a really good thing. It’s traded live for 19 months now and here’s kind of the similar stats. The max drawdown on this algorithm trading alone has seen, in that period was $4400, and that, I believe, was right in here on the equity curve. And… Yeah, so you can kind of pause this and look at these other stats, but overall this algorithm has outperformed the back-tested model since going live, at least on the average trade, average gain per trade, and the percent profitable is in line with the back-testing and the max drawdown, there’s absolutely no concerns with that, because in the back-testing, it had actually seen a loss of about $9000 and that was actually right in here on this part of the equity curve, which I believe that was in 2011.
What I’d like to do now, is look at the data a little bit deeper on a per-month basis. Okay, so what you’re looking at here is the Momentum ES algorithm on a monthly basis. You’ll see in October 2015, it made $4710 in the hypothetical account, then it took a loss of $948 in November, a loss of $1710 in December of 2015. It didn’t have any trades in January of 2016, and then onward. March was a good month for sure of 2016. April of this year was really good, February of this year was really good. And the reason why I’m showing this is because, when I analyze an algorithm, I really start by doing the back-testing, but then the next thing I do, if the back-testing looks good, and if the walk-forward looks good, and I’m talking about the step two kind of walk-forward where it’s just running simulations in out-of-sample and in-sample data sets, not necessarily the live returns that we’re looking at here, when I do that, and it looks like an algorithm that has potential, the next thing I do is I compare how the algorithm does based on what the S&P is doing. And the way I do that is I define the S&P monthly performance as either strong up, sideways/drifting higher, or down. And I define a strong up as the S&P closing up by 30 points or more, which would be about 1.5%. Anytime the S&P, or the markets in general, are up by 1.5% for a month, then I would consider that a strong up month. Anytime it’s down by four points or more, it’s a down month, and anything in between is kind of a sideways or drifting higher month. And the reason why I pick these points is because I want a even distribution in the entire back-tested period, which I believe this 163 months is from ’03 until I believe around 2016, but it might’ve been 2015. I’d have to look to be sure, but I guess we could figure it out. But basically we want a even distribution so that we have kind of an equal number of these kind of categories or months, and I think that’ll make more sense when I go to the next slide. Here’s the same kind of monthly performance of the Momentum ES algorithm. What this chart here is, this is just a monthly chart of the S&P, going back to when this algorithm began trading live. And in the back-tested analysis, what the data showed is that, if the S&P has a strong up month, which again, that’s up 30 points or more, and there’s a third of the time that’s kind of what we see, then this algorithm performed really good in the back-testing.
Momentum Algorithm Performance in Bull Markets
In the walk-forward live testing that we do and that shows on this data here, I want to make sure that, when the S&P had a strong up month for any of these months, that this algorithm did well, and fortunately the data confirms that. Starting with October, where we were up $4710, you’ll see that right in here. This is the month of October and it happened to be the, I believe based on this chart, the best month since we went live, but it closed up, this algorithm, up $4710. Another up month that did well was March of 2016, which would’ve been this candle right here and we were up $3980, and I have a little star next to the ones that weren’t up by as much as we might’ve expected. May 2016 is one of them, where it was down $50. That’s just a minor red flag. I mean, we know that this will happen, ’cause in the back-testing we see it, where the S&P might be up but still algorithm still might be, either break even, down a little bit, or maybe just up a little bit, and I just, you know, I put a little star next to it just to identify that there are times when it won’t close up these huge numbers, even though the S&P was up. And if we looked at May of 2016, it was probably this candle right here. Let’s see if that was, March, April, May. It would’ve been this one here and you can see that the market did sell off for part of that period and that’s probably why we took some losses, but then it rallied strongly towards the close of the month and so we probably made those gains back.
Momentum Algorithm Performance in Bear Markets
But anyway. If we now look at down months, we also see that this algorithm behaves as expected. Again, we trade, this is just for one algorithm in the packages that we offer and it’s designed to do well when the market goes higher and to not lose a lot when the market goes lower. And you can see that it did take losses, but the losses were not as big as the gains we see in the up months, and they’re also normally going to be smaller than the gains we see on the other algorithms that do perform well in down months. But so, in these three down months combined, the algorithm only lost about $2800. In the sideways or in-between months, if you add up all these, it also took some losses of about $2400. And if you look at these sideways or drifting higher months you will see some where it exceeds the performance expectation, like April of this year, actually this month that we just closed out. Even though the market technically traded sideways, we still closed up. And you know, June, we took some losses as well as April of 2016. Everything else though is pretty much in line with what we expect, so there’s no surprises. So again, the purpose of me showing this is if I have an algorithm that I expect to do good in an up month, but then it doesn’t do good in up months overall, then that’s also a red flag and something that would make me look closer at the algorithm to see if, if it needs adjustment or if there’s some other issue with it that we’re not aware of. So, just to kind of summarize the Momentum ES algorithm, there were eight months where the S&P closed up by 30 points or more, and we had gains of about $1600 or about a little over $2000 per month on average, and that exceeds the expectations in the back-testing. There were three months where the S&P closed down by four points or more, and our losses were only about $2800, so that meets expectations, because we don’t expect it to make a lot in these down months. We even have expectations that it’ll lose a little bit. And again, to emphasize that that’s just this algorithm, so it doesn’t mean our system is we have expectations that it’ll do bad in down months. It just means this component of one algorithm in that system is not expected to do well. Again, we have other algorithms that are expected to do well in these down months, and I’ll get to that when we talk about the Ten Year Note algo. There are eight months where the S&P closed between negative four and 30 points, and our losses were about $2400 on that, and so that’s one that we could definitely do better on, but we’ll see how the months continue and how, as we accumulate more of these, how this algorithm does. Overall, 138 trades in the walk-forward live returns, and so that’s enough data to analyze this algorithm. The per-profitable win rate is great. It’s well within the back-tested expectations. The average trade is actually higher than back-tested, so that’s really good and it’s traded 19 months. So, you can pause this, but overall the gains have been impressive on this algorithm and it continues to do well, and we have real high confidence in this algorithm because the live returns that we’ve seen have matched the back-tested, which is what we’re aiming for. Okay so, now I’m going to talk about the Treasury Note algorithm.
Treasury Note Strategy Performance
Alright, this TY algorithm is also an algorithm that’s traded in the swing trader. It’s algo two of two. The Momentum ES is the first one designed to do well in up-moving markets. This the TY algorithm, the second algorithm, and it’s designed to do well in down-moving markets. We began offering this algorithm in December of 2014. Its back-tested or last optimization date was around the 15th of December in 2014, and it began trading live as an add-on to the NQ Legacy algorithms, but it was also used in the ES Active, the NQ Active, the Gambler, the ESTY Futures, the Crusher, and the Swing Trader.
Here’s the back-tested returns on it. It’s had 229 trades. You’ll see the average gain per trade is quite a bit higher than some of the others at over $300, and that’s just because it’s a longer-term swing trade and so it holds longer. Percent profitable is really high at 79%, and again, this is back-tested, so it’s subject to the CFDC disclaimer on the bottom here. If we look at the walk-forward returns. So, the returns since October of 2014, it’s had 27 trades. 11% out-of-sample, which is above the 10% threshold, meaning we have enough data to really look at this closely. It’s 74% profitable, versus the 79% back-tested, so that’s good. It’s within the efficiency requirement that we have, ’cause again, the back-tested is the most optimistic. If we can hit that, then that’s perfect. But even if we can come within 10 to 20% of this number then it’s considered good. The average gain per trade in the live is $295 versus $315 in the back-testing, and that’s great. It matches up close enough. It’s traded live for 28 months, we have tons of data on this algorithm. It’s our longest running algorithm that’s still offered. It’s been used in all the systems we offer since it was rolled out. But here’s the equity curve, and I’ll just comment that, since 2014, the market has gone higher. The fact that this algorithm is profitable and profitable by as much as it is, which is about 8k, is really good, ’cause again, this is the algorithm that’s designed to do well in down-moving markets and to kind of cover us if the market goes lower. So, the fact that it’s done so well in an up-moving market is really good news for us. Here’s the monthly performance and, for this, the format looks a little bit different. That’s because I’ve marked it to market using the Trade Station tool. The other one was looking at closed trades, when we looked at the Momentum ES, and the reason why I do marked to market here is because we can hold onto this algorithm for a couple months, and if I did a format similar to what you see here where it’s every month, the closed trades, then the data wouldn’t really line up the way that would make sense, because we might be in a trade for a couple months and then get out, and so it would show zero returns in down months even though, marked to market, it was up. This is a more accurate way to show this data and it’s because we can hold for a couple months on this algorithm. On the next slide I’m going to be talking about the strong up, the sideways, and the down. It’s the same kind of rules, but it is using the S&P. We’re going to be comparing this algorithm to the S&P’s performance.
Okay, so if you look here, here’s a monthly chart of the S&P going all the way back to when this algorithm began trading live. And if you look at this chart compared to the other one we were looking at, it’s very similar. Right here is October of 2015. So, the other chart started here. Since this one began trading live in December of 2014, we just have the extra months added on here so that we can analyze kind of how the algorithm did in each one of these months since we went live. Okay so, if we start with the up month, you’ll see that it’s almost the opposite of the S&P, or I’m sorry, the Momentum algorithm. Meaning… If you add up the returns when the S&P had an up month, this algorithm has taken losses on a marked to market basis, about $2800. That actually exceeds the expectations in my mind because we’ve had so many of these months. The fact that we’re only down $2800 on this algorithm is really good, because if you, when you overlay this algorithm with the Momentum ES algorithm, then you can start seeing how these algorithms work. In other words, in this Momentum ES algorithm, the gains in these up months was $16k, and now the losses on the Tenure Note algorithm were only $2800. If you made $16k on the S&P algorithm and only lost $2800 on the Ten Year Note algorithm, then when you combine it, you’re up about 13k in the up months.
Now, that’s not 100% accurate though, because we are including some of these up months that the Momentum algorithm didn’t, you know, it wasn’t trading live back then, so we don’t include it, but it’s still, I think, a good way to look at it, a good way to overlay ’em. Now, in months where the S&P was down by four points or more you’ll see that this algorithm has done really well, up about $7700. And we can just look at a few of them. If we look at January 2015, that was our best month for this algorithm. January 2015 would’ve been I believe this red candle right here. This is sort of in December, and this is January right here. When the S&P sold off the way it did, this algorithm actually had a great month. Another good month would’ve been January of 2016 which would’ve been this one right here, and so you can see that this was a really big down month on the S&P, and this algorithm did really well with a gain of about $3900 per contract traded. When you add it all up though, we’re up about seven, almost $8k, which meets the expectations. On the down, or I’m sorry, on the sideways or in between months, this algorithm also does really well, and it’s up about $2k, which also meets expectations. And we can look at a few of these. June 2016 was a really good month for this algorithm, and on the monthly chart, I believe it would’ve been this candle right here, ’cause this is July, actually it would’ve been this one right here. This is June. And you can see that the S&P pretty much went sideways, but you also see that there’s a lot of volatility ’cause of how big this candle was, and so that might explain in some ways why we did so well. Okay so, when you put all this together, what you have is a pretty in-depth analysis of the live returns based on what the S&P was doing and you see that in up months it doesn’t do as well, in down months on the S&P it does really well, and then in sideways or in between months it also has positive expectations.
Here’s the summary. There’s 10 months where the S&P closed up by 30 points and the losses were about $2800 on this algorithm. On eight months where the S&P closed down by four points or more, and it was strongly positive. And then 11 months where the S&P was sideways and it was also positive on those. The win rates are 74% in the walk-forward versus 80% in the back-tested, so that’s good. The average gain per trade is in line with expectations of about $300. And it’s traded live for 28 months, so it’s, we have quite a bit of data on that algorithm. Okay, so now what I’ve done is I’ve combined the Treasury Note algorithm, the one we just looked at, and the Momentum algorithm, because that’s what the swing trader is. What this is doing, is looking at both of these algorithms combined on a back-tested basis. Here you’ll see the trades are $1244, average gain per trade $107, the max drawdown about $6500 with a 77% win rate. And again, this is back-tested, so subject to the CFDC disclaimer. Now, if we look at the walk forward, and we have to start with the algorithm that is the newest, which would be the Momentum. This is covering from October 2015 until the end of April of 2017, and again, this combines both the algorithms together.
A Complete Algorithmic Trading System
You can see an idea of, when you trade both these algorithms together, how they’ve done. We’ve got 153 trades, which is 12% of out-of-sample data so it’s more than 10%, which is good. 75% profitable, versus the 77% in the back-testing, that’s a 97% efficiency, which is amazing. Average gain per trade, 94 versus 107 in the back-testing, which is an efficiency of 87%, which is also amazing. Anything above, really above 70 to 80% is good, and we’re at 87. The average gain per month is $725 versus $945, that’s a 76% efficiency, which is also really good. And so really this algorithm continues to match the back-tested expectations within reason.
Here’s the equity curve, and you know, I think that’s really all I had on this blog. I hope you enjoyed it. Really the point of this, just to go back to the start and review kind of what we talked about. I covered the swing trader. It trades two algorithms, the Momentum ES and the Treasury Note. I showed you the difference between the back-tested and the walk-forward, and I even showed you kind of how we optimize and how that can create the most optimistic back-tested model but it’s kind of the starting point or kind of what you judge the live trades based on. I showed you how I evaluate an algorithm’s live performance versus back-tested, some of the key things I look at, then we looked closely at the Momentum ES algorithm, again, one of the algorithms in the swing trader, to show you how its walk-forward results have compared to the back-testing. I did the same thing on the TY algorithm, and then combined these two algorithms to show you kind of the final walk-forward returns that this algorithm has seen. And those returns, let me just go back to them one more time. Here’s the returns right here, and I think that summarizes it really well.
Thanks a lot for watching. Hope you enjoyed it, hope this was helpful, and we look forward to continued success with this algorithm and perhaps I’ll go back and do another update to this in a few more months when we have even more data. Thanks a lot for watching, and if you have any questions, don’t hesitate to call us or send us an email. You can request a live demo, and if you do that then I will actually walk you through these charts and kind of show you some of the trades and I’d be happy to do that, so I hope that helps, but have a great day, and thanks for watching.