Learn To STOP Curve Fitting!
Download this free guide on how to stop curve fitting. Following these four simple steps can improve your trading dramatically!
Warren Buffet has been quoted many times as saying, “If I don’t understand it, I don’t invest in it, no matter how attractive it may appear.” I love that quote for a number of reasons, but I think it’s a great advice for system traders as well. We (myself included) have a tendency to get hypnotized by really pretty equity curves and big profit factors, but if you have no idea how those two things are being achieved, you’re on shaky ground to say the least. I’m really big on keeping things as simple as possible for several reasons: 1. Simplicity means it’s easy to understand why your edge exists (and just as importantly why it could stop working), and 2. Simplicity means it’s most likely robust…. it’s much more difficult to curve fit if you only have two lines of code. Another thing I strongly believe in, is that the best systems are based on simple market observations made over time. With these two things in mind, let’s try to build the simplest system you’ll ever find.
So it’s been well documented on STS that the ES futures have a mean reverting tendency. By keeping things simple and trying to build a mean reverting system for a mean reverting market, let’s see if we can uncover an edge that we can exploit. As funny as it sounds to say this, I generally think that building trend models, even for the ES, is easier. I think a major reason for that is it’s simply much easier (for me) to translate and define what constitutes a trend and what does not into code, then what defines or constitutes mean reversion, but let’s give it a go and see what we can come up with.
In my discretionary day-trading, when I’m doing my morning prep work, I generally focus most of my “homework” on what we did the previous day, or what we did the last time we were in the specific area that we’re set to open up in. I then come up with several “If, Then” statements of how I plan to execute if and when the market gets to my pre-defined areas of interest. As you might guess, the previous days high and low are usually very important reference points for me. So this got me thinking, “I wonder if we can use the previous days high or low as the main reference point in a mechanical system?”
I first started testing the idea by seeing what it would look like if we just bought the breakout of the previous days high using a stop order, or selling a break of the previous days low. Below are the results of that since the ES’s inception.
So I wouldn’t exactly recommend that you buy or short every breakout of the previous days range, in fact, it looks like a ticket straight to the poor house. Slippage and commissions account for $80k of the $103k loss, but even if you had no slippage or commissions, it’s a loser.
Now let’s flip it around and see if that good ole mean reverting tendency is gonna show its pretty face if we get long at the previous days low or short the previous days high. Knowing that the S&P both has an upward bias, and is mean reverting, I’m going to take a guess that says buying the previous days low might be an improvement. We’re going to make one slight change to the backtest results. Because we will be using a limit order and not a stop order or market order, we can in essence reduce slippage to zero, and really, for mean reversion systems, slippage is actually a good thing, as that means we just get better trade location. So only $10 roundtrip will be deducted for commissions, and in the backtesting tab in TradeStation, we’ve enabled the fill assumption where at least 100 contracts have to trade where our limit order is to get filled.
And there she is, the longs actually make about $10k, but over the course of 1810 trades, I’m sure there are a large number of those that are unproductive trades, so let’s test some of our tried and true filters and see what we get.
From this point forward, we’ll only be focusing on the longs, as the previous test concluded that only the longs have a strong enough initial edge to pursue. Let’s now test dividing the market into a bull and bear regime. We’ll do this by simply adding a simple moving average, and if price is above the moving average (on the daily chart) then we consider us in a bull market, if we are below the moving average, then we are in a bear market regime.
We’ll first test the bull market regime filter testing the values from 10-200 in increments of 10. Below are the results:
Here is the net profit in a stacked graph:
Very surprising results to me, as I fully expected the bull market regime filter to greatly improve the results, but as you can see, every single value that we tested hurt the results over the baseline.
Now let’s flip the regime filter around to only take the long trades at the previous days low when we are in a bear market regime, we’ll once again test from 10-200 in increments of 10.
Here is the net profit in a stacked graph:
Now that is much better. A truly beautiful example of why testing things quantitatively is so important, because I would have bet the farm that this idea would have performed better in a bull market regime. Pretty much any value you choose between 80 and 200 is a nice improvement over the baseline and weeds out a ton of unproductive trades. 110 is what tested as best, let’s just go with 140 for future testing as it’s right in the middle of the 80-200 area that tested best.
Now let’s test some more ideas to see if they will improve the results. I want to see if opening up inside the previous days range or outside of the previous days range really effects the results.
Here are the results when we open up inside of the previous days range (the bear market regime filter has been removed, we are just testing again on the baseline of buying at the previous days low):
Certainly no improvement.
Here are the results when we open up outside of the previous days range:
The results surprise me as I would have assumed that opening up inside the previous days range would have been a large improvement, but once again, the data says otherwise. Needless to say, we will not be using either one of these filters moving forward.
Next, I want to try a very crude and simple volatility filter. Basically when the previous days range was smaller than “X” I don’t want a trade to trigger. The theory being that I suspect that a lot of our unproductive trades are hiding in the very low volatility days. Generally, when we are in a bear market regime, the volatility will be higher, and since our baseline tested much better in bear market regimes, I’m guessing that the higher volatility days will yield better results. I’m going to test from a 4-handle range all the way through a 40-handle range and above in increments of 2 to see if there is a clear line where the better volatility improves the idea.
Aha! Now that’s more like it, as the optimization report shows, we more than triple our net profit by only taking trades where the previous day had a range of at least 18 handles (which just so happens to be the mean ATR of the ES). This is certainly a filter that we will want to keep when we combine rules.
Next, let’s take a look to see if buying the lowest low from the past X days will be an improvement over just buying the previous days low. We’ll test buying the lowest low from the past 1-10 days in increments of 1, below are the results:
Not too bad… naturally as you buy the lowest low from a longer time period, you’ll get better results. I think we’ll table this idea for the next article as there are several directions we could go with this.
Another idea I had was, “does it matter if the previous day was up or down?” Being as how this is going to be a mean reversion system, we should expect that the previous day being a down day will improve the results.
Here is what it looks like when we only take the long trades at the previous days low when the previous day was up:
Very, very bad.
And here are the test results from when we only take a long trade at the previous days low if the previous day was a down day:
Bingo! Our best test result yet, and another beautiful example of the mean reverting tendencies of the S&P e-mini.
One last idea is if we create an offset of some kind to see if we get “better value” when we try to buy the previous days low minus X ticks. I wouldn’t want to hardcode anything like that into a final system, but I’m interested to see a quick test if buying at some level under the previous days low will yield better results. If it does we can experiment further with percentage offsets, percentage of ATR offsets, standard error offsets, really anything as there are a million different ways we could offset from yesterday’s low. So for our crude and simple test, we’re just going to use an X ticks offset. We’ll test from 4 ticks to 40 ticks in increments of 4 (so each test is on a round point value… 4 ticks=1 pt).
There is certainly some improvement there, as we get about 7 handles under the previous days low yields consistently better results than just buying at yesterday’s low. But we’ll table this improvement for another day as there are just too many different approaches to dive into.
Now let’s try and combine some of our rules to see if we can get some nice results. Our two best filters were the previous day being a down day, and the previous day needed to have a range of at least 18 handles. Here are the results when we run the previous days range filter combined with the previous day down filter:
As you can see these two incredibly simple filters create a pretty decent range of outcomes. For the most part, the higher we make the previous days range filter, the better our profit factor becomes, but we start to lose a little bit of net profit. I’m a net profit kind of guy, as they unfortunately don’t let you pay your mortgage with profit factors, so let’s stick with 18 for the time being as our previous days range filter. I also like to keep as many trades as possible at this stage of the testing, you can always go back and reduce the trades to improve efficiency.
Now let’s try adding in our bear market filter to see if that again really improves our test results. Here are the results from the bear market filter of (140), previous days range was at least (18) handles, and the previous day was a down day:
Well we improved the efficiency a bit with a better profit factor, and higher average trade, but we lose about $9k in net profit and we just added another filter. For my style of system development, if a filter doesn’t REALLY help, leave it out.
Here is what our equity curve looks like with just the previous day down filter and the previous days range larger than ‘X’ filter:
So there you have it, 1 simple idea to go along with 2 stupidly simple filters. In my experience, the best systems are just two things: 1. They are based on an empirical idea through market observations, and 2. They. Are. SIMPLE! Are you going to get rich trading this? No…. Would I trade this system right this minute? No…. Remember, there are no stops or profit targets of any kind. Can we improve this really simple system? Hell yes! I have a lot more ideas we can test in future articles, but I would also love to hear readers’ ideas. What do you think will work or improve our results?
Ben has been a private trader for over 7 years and is now a TradeStation Trading App Developer. Finding and exploiting edges is his game, as he’s not only a trader but a professional sports handicapper. You can find him on Twitter @TRUmav for financial commentary, or @BtheHouse for sports betting commentary. If your interested in more models like the one above, check out BtheHouse.com. Ben always enjoys sharing and brainstorming ideas with like-minded traders, bettors, and investors.
Please log in again. The login page will open in a new window. After logging in you can close it and return to this page.