Past Performance Might Be Indicative of Future Results

Screen Shot 2015-05-11 at 4.14.02 PM

Like many people, I’m intrigued by stocks that have a good multi-day run up. I spend a fair amount of time trying to figure out what makes them tick. And while getting in at the start of a run may or may not be predictable in some way, are there other ways to make money off these “momentum bursts”?

One thing I started wondering is if certain stocks are more “prone” to these bursts. It certainly seemed like I came across the same names quite a lot. So I thought I’d go gather some data, which you might be interested in.

First of all I picked some parameters: the Russell 3000 would be my ‘universe’ of stocks to choose from, and I’d look at the period from 1/1/2010 through 05/08/15.

Then I defined the particular momentum burst I was looking for. I kept it simple: from the open of day 1 to the close of day 3, the stock must have jumped at least 15%. And so I don’t end up with overlapping, duplicate signals, I insist that the condition isn’t true on either side of this jump (although the stock is free to jump up or down before or after, just not up 15% in an overlapping three day period).

Then I had my trusty stock robot (aka AmiBroker) find all the appearances of this pattern. It then counted how many times the pattern appeared in the previous 60 bars, and how many times the pattern appears in the following 20 bars. This was done in such away to avoid any “future leaks”.

Basically, I’m trying to determine if a stock that is prone to momentum bursts in the past is more likely to have a burst in the next month. Here are my results:

Screen Shot 2015-05-11 at 4.30.50 PMThe X axis shows all the signals, sorted by the number of momentum bursts (as defined above) in the past sixty bars. This includes the bar that was used as the signal. As you might imagine, there are many more instances of a stock having the momentum burst without anything preceding it, than there are stocks with six bursts of 15% in sixty bars. In fact, in this 5+ year period, only 15 stocks had six bursts. However the data becomes meaningful for five bursts and below. There were almost a hundred samples for stocks with five bursts, and about 275 for four bursts in that sixty trading-day period.

And the results: if you have a stock that has its first or second burst in the past sixty bars, there’s a less than even chance of it happening again in the next twenty bars. However when you get up to three bursts, things start to get interesting. And four or five bursts show a definite likelihood for the stock to “pop” another time soon.

Interesting, don’t you think?

FAS Double Down System – First Trade Completed

That vertical line is just so I can see quickly at a glance where I entered. I forgot to remove it before the screen capture, and can’t be bothered to redo it.

Back a few weeks ago I outlined a swing-trade system using a leveraged financial-sector fund called “Direxion Russell 1000 Financials Bullish 3X ETF” (FAS). Catchy name, eh? You can read about the system’s parameters and statistics on the original post here. It has a great hit percentage and a beautiful equity curve. What’s not to love? The only real down side to this system is that the potential set ups are frequent, while the actual entry opportunities are maybe once a month or so.

On April 13th I was presented with just such an opportunity, and I dove in. What followed was a lot of “chop.” The ETF kept generating closes above and below the entry price, almost daily alternating back and forth. This was certainly on the longer side of durations for this trade: 19 days in the market, almost a full month. (50% of the trades historically have lasted 3 days or less).

But then with Friday’s booming stock market, FAS closed over my threshold and I sold. That was a gain of over 5.8% before commissions.

It’s always nice when the first trade of a new system using actual money provides a win. Although with this system and it’s 86% historical hit rate, I had high expectations.

Sometimes Lines Are Just Lines

As you can see from the graph below, the market has fallen dramatically below a very solid line of support. Sell everything and hide in the root cellar until the storm passes….

Sell! Sell!


Except the market kept moving:

Oops! I sold too soon!
Oops! I sold too soon!


I was reading an online article written by a diehard chartist. I won’t link to it to spare him any embarrassment. He had drawn lines on charts showing how previous bull markets had topped out by dipping under diagonal lines of support (“channels”). So if those two previous markets had ended that way, and this current market was also dipping under his line of support, then…well the end is nigh!

Notice I said “his” line of support. The problem of course is that these lines are subjective. You can look at a chart and say “well obviously the line should go from here to here.” But how do actually quantify that? And if the price dips significantly below the line and then rebounds, what do you do? Say something pithy like “well the support line was severely tested, but is still holding for now.” Really?

Or maybe you just redraw the line.

Lots of people do. Lines of support and resistance, like much about chart-based trading in general, is backward-looking and subject to hindsight. Yes the price did such and such and lined up just so. And yes in the future, a small subset of traders might actually set their buy or sell orders near one of those lines. But all the other traders could care less where you drew your line, or why. Or perhaps they drew Fibonacci lines or horizontal lines or Andrews Pitchforks (yes that’s a thing) or Gann lines (yes, also a thing) or doodled on a chart and accidentally traded that doodle. Or maybe you’re trading against a robot who doesn’t give a crap about your puny human lines of support.

Lines of support/resistance are notoriously untestable because they’re subjective. Personally, if I can’t test a theory, I won’t put my money anywhere near it. Sometimes lines are just lines.


My ‘Decel’ Swing Trade System Pt 2

Yesterday I proposed a swing-trade system based on descending lows that were dropping by smaller amounts each time, as an indication that a turn-around was about to occur. The details of the system are in that post (link). But just like American Idol, I’ve divided my posts into the ‘performance episode’ and the ‘results episode.’ So let’s see how this system does.

And let’s lay this out in the open right away: I wouldn’t trade this system. So why do I bother writing about it? Because I think there is a germ of an idea here that could be refined. The results show promise but I don’t think it’s quite there yet.

Here are some examples of ‘average’ winning trades, and also an ‘average’ losing trade. I pick them because they won or lost around 4%. Please excuse the hot-pink desktop. My son set that for me, and I have neither the desire nor know-how to change it.

decel example - winner1
Here we have a winner. The trade got in at the open of a down day, but got out at the open of a much higher down day later. Notice how the signal day (before the buy day) has a low that is higher than the previous low.


decel example - winner2
Also a winner. Note that the signal day here had a low that was below the previous day’s low. The direction of the last low doesn’t matter, what matters is the ratio comparison. If you’re confused, see the previous post.


decel example - loser
This was a losing trade. It got in at the open of a down bar, and got out at the open of an up bar! Hey those are the breaks.

Like a good boy, I developed this using an in-sample (IS) period, and then checked it with an out-of-sample (OOS) period. If you develop a system using all the data, you’ll end up finding a system that works really well on all the data…but doesn’t work on the future data nearly as well. It’s called “curve fitting” and it’s a bad thing.

My IS period was 1/1/2010 through 12/31/2012. My OOS period was 1/1/2013 through 05/05/2015.

When testing a system, I look primarily at several things:

• First and foremost, the CAR/MDD ratio. That stands for “compound annualized return divided by the maximum drawdown”. This calculates your profits, figures out what that number would have been if you’d been able to trade every day of the year, and then divides it by the maximum drawdown the system experienced. This way you’re not just looking at profit, but also looking at the periods of time where your spouse is asking where all the money’s gone.

• I also look at the win rate. While Sir Mix-A-Lot might like big butts, I like big win rates. I don’t care how profitable something is, if it’s only winning 50% of the time, I’ll get depressed. I start taking notice at 60%, and over 70% is even better.

• I also look at the number of trades. If the system is really good but only trades one time a year on average, I’ll likely miss the trade because my money was busy getting smaller in some other trade. So the more frequent trading is better, everything else being equal, as it also gives me opportunities to compound my winnings. Ideally >50 trades per year.

Testing was done on Russell 3000 stocks. I did not use a delisted stock database, so there could be survivorship bias. I personally think this bias is reduced when trades last only a few days, but I don’t have data to back that up. And I haven’t sprung for a delisted-stock db yet. So sue me.

I assumed a $30,000 account, maximum positions to be held at one time was 5, and the maximum investment per trade was $1500. Commissions were $4.95 each way. Returns are NOT compounded, but of course in real life you would realize the benefits of compounding. Larger accounts, larger position sizes and smaller commissions would all increase returns, but I’m trying to keep it real, yo.

Screen Shot 2015-05-07 at 12.40.54 PM

There are actually more trades during the shorter OOS period than in the IS period. The average win and losss percentages are similar between the IS and OOS periods. The overall win rate remains pretty steady too, and up high where I like it.

So what’s with the CAR/MDD? Great than 1 is pretty good for the systems I usually test, but .33 kinda sucks. I mean it’s making money but it’s not a great number. Well let’s look at some Equity Charts (a.k.a. “Is There Any Money Left?”):

This is the equity curve for the in-sample data. A little choppy, but decent enough.
This is the equity curve for the in-sample data. A little choppy, but decent enough.
Ouch! The first quarter of 2014 was pretty painful, and the year was pretty bad until Q4 when things took off like a rocket.
This is the out-of-sample equity curve. Ouch! The first quarter of 2014 was pretty painful, and the year was pretty bad until Q4 when things took off like a rocket.
Combined IS and OOS periods.
Combined IS and OOS periods. As with many things in life, when you zoom out, everything looks better.

As you can see, the OOS period had some big losses that hurt the results considerably. It still has a great percentage win rate, but the drawdowns would have made me cry.

Like I said at the outset, I don’t think I would trade this as-is. But I think there’s an ‘edge’ here somewhere, and it would likely still make money. Why not give the system a tweak and see what you come up with?

My ‘Decel’ Swing Trade System Pt 1


Some back-story:

The other day I was messing around with momentum-based trading ideas. I started thinking about acceleration: certain price aspects (the close, the high) not only increasing, but increasing at a greater rate from bar to bar. I wondered if this might be an indicator of a trend kicking in. What I did find out was that, more often than not, the trend ended right about the time it was detected!

When I first started testing, I decided to compare the ratio difference between highs, rather than the simple price difference. In other words, I compared the high divided by the previous high, rather than subtracting one high from the other.

I quickly noticed some weird triggers though, and was getting a few series of descending highs rather than ascending. I realized I hadn’t insisted that the highs be increasing, only that their ratios got bigger. If the highs are falling by smaller amounts each time, their ratios are still getting bigger. 0.95 to 0.97 is an increase in the ratio, just as 1.001 to 1.003 is.

That got me thinking! Hey maybe a downward run signals that it’s about to turn around if the highs – or, it turns out – the lows are slowing their rate of descent. Decelerating rather than accelerating. So I flipped this on its head and started looking at a mean-reversion system.

Why do all my momentum ideas seem to turn into mean-reversion ideas?

As you can see from the lead image, the change in the lows of the downtrend are getting smaller and smaller.

In my testing, it turns out that the the last low doesn’t have to be descending. It can actually pop up and show a turn around. Insisting that the last low be lower or higher than the previous one reduced profitability, so I had to code in such a way that I left this last move directionally undefined, as long as the ratio increased from the previous one. Remember, dividing a new low by a previous higher low is going to give you a number less than one, so you want that fractional number to be increasing. Eg 0.96 to 0.97 to 0.995.

There are two tests therefore. One is to check for a series of ratios that are increasing. And the other is to test if the low is lower than the previous low. And they are not counting the same number of bars. In the end, I found that testing four bars was the ideal. Those four bars must show an increasing ratio, and the first three bars must have descending lows. The last bar could have a low that was up or down from the previous low, it didn’t matter.

With me so far? Phew!

Entry Rules.

To put it in generic coding, there are two tests:

ratiotest =
(CurrentLow / PreviousLow1) > (PreviousLow1 / PreviousLow2)
(PreviousLow2 / PreviousLow3) > (PreviousLow1 / PreviousLow2)


descendtest =

(note there’s no mention of the current low for the second test).


There are more graceful ways to code this if you want to test different combinations, but I’ve already done the testing for you!

This works best if you are reverting to a larger uptrend, so I included tests to make sure that:

• the most recent Close was at least 1.3x greater the lowest low of the last 50 bars.

• the most recent Close was above the 120-bar moving average.

And finally, I made sure that the most recent close was >$2 and average volume was greater than 100,000. Don’t want any weird n’ flaky illiquid stocks causing havoc.

When these conditions are met, you buy on the next day’s open.

Exit Rules.

You sell on open, and there are three ways to get out.

• A stop loss of 30%, which is a ‘soft stop’ traded at the open of the following day (not set with your broker for an intraday exit).

• A profit >2% (by using a limit-on-open sell order)

• A maximum duration of 8 days, with your buy day counting as day 0.

For those of you wondering about the big stop-loss vs the tiny profit target, don’t fret. This system trades a lot and makes small profits with a high success rate. When disaster strikes and the stock moves against you, many times you’ll recoup a small portion of the initial loss as the price rebounds a little before the ‘duration stop’ is hit. A stop loss that’s too tight actually hurts you, because you miss out on the partial recovery. Only if the trade is truly disastrous does it make sense to get out early. Hence the 30%.

The worst trade since 2010 had a maximum adverse excursion of -31% (i.e. at one point during a day of trading, the lowest low was 31% down from the buy price). But the trade itself reverted slightly, with “only” a -24% loss. Not good of course, but it shows how a stop would have locked in that 31% if it had been a ‘hard stop’.

Check back for tomorrow’s post to see how this system does. Hint: the out-of-sample period I tested had a 67% hit rate. But 2014 was painful.

** Don’t trade this system until you’ve done your own research and made up your own mind. You’ll want to read tomorrow’s post for sure.