Category Archives: Momentum
Via ETFProphet, I bring you a link where Tom Demark is calling for a “significant top.” It seems most of the traders out there agree with Demark and are looking for a serious pullback here, with many calling for a beyond serious, slit-yer-wrist variety of pullback.
I believe those looking for a slit-yer-wrist pullback are over reacting. In fact, I’ll go on record right here and state that this pullback will be between 3-6% on the SPY, and that SPY will test the 1/18/2011 high before a deeper pullback occurs.
Before you remove all your hedges, know that I am engaging in a bit of braggadocio in order to generate some discussion on this matter.
I have tried to model the recent market action, and here is what I have come up with it.
The S&P 500 is up over +20% since August 31st, 2010. Today, the pullback on SPY was -1.0%. Thus we have 97 trading days since this move began (not counting today).
Buy $SPX when the 97 day Rate-of-Change > +20% AND today’s close was > -.90% beneath the previous close.
Sell X days later.
No commissions or slippage were added. I used 50 years worth of data with the first trade occurring on 10/9/1970.
Any discussion on this type of modeling should begin with sample size. If the trade is held for the full 20 bars, there are 23 instances of this setup over the last 50 years. The statisticians would prefer 30 instances, but then that would assume that the market adheres to a standard distribution.
- The winner average profit levels out around +3%.
- The loser average loss levels out around -2%.
- Based on the % of Winners and the Max. Trade % Drawdown, most of the damage tends to peak about 1 week after the setup.
- On day 7, the % of Winners climbs above 60% and peaks at 74% on day 15.
The big takeaway here is that an object in motion (the market) tends to stay in motion (apologies to Newton). In the past, after having climbed so far, so quickly, the market’s velocity has enabled it to maintain momentum. Galileo called this inertia. The bears will likely call it “Bernankery.”
When adding de-listed data to the momentum system, performance degrades significantly, even over a short time horizon of one-month. I would expect to see performance degrade with longer minimum hold times such as six months or a year, but I am really surprised how much de-listed data affects even short-term holds.
I am re-running the last test of the momentum system with de-listed data and new code to account for stock splits, and while the test will not be done until late tonight, I can already see that performance will be degraded. I will post the results when they are ready so that we can observe how using unadjusted data affected the results vs. the adjusted data. (To see the impetus for the change of code and the thinking behind it, go here. Be sure to read the comments after the post.)
But the question remains: Why is de-listed data have such a profound affect on the system, even over short holds of 22 bars?
I am really curious to hear everyone’s thoughts on this issue.
Before I progress any further with this system, I want to test to see the effect (if any) of survivorship bias.
It is a common misconception that adding de-listed data (the non-surviving stocks) to a backtest will decrease performance.
Systems that swing trade stocks may actually improve when de-listed stocks are included in the backtest. Systems with longer hold times may show a decrease in performance. I attribute this to the fact that short-term systems generally rely on making many trades with a small edge (where the primary driver of profit is lots of opportunity) while longer-term systems rely on catching and riding a trend.
Let me dig a little deeper into this in order to clarify the point…
If the longer-term trend-following style or momentum system attempts to hold a stock for a few months, and the company begins a spiral into bankruptcy while the system is long the stock, the performance of the system will suffer. The swing trading system will likely have stopped out, or sold on a bounce or covered on a dip, long before the company succumbs to bankruptcy. If during backtesting, a large losing trade isn’t included because the data doesn’t include the now defunct company, and the trade is instead replaced with a large winner, it is very clear how misleading the results will be. With a short term system, within the long downtrend of a company circling the drain, there may be many swing-trading opportunities. Thus, adding this delisted company to the backtest for a swing-trading system can actually improve performance.
Hopefully it is clear why I want to test with delisted data before moving forward.
The essence of what I am doing is handicapping the system. We want to add in all of the real-life factors such as liquidity, volume, delisted data, and commissions, before committing much mental capital to further development. After all, time is money.
Now we take a look at how all the companies that went bankrupt, merged, or were bought-out would have affected the momentum system.
With De-Listed Data
Without Delisted Data
Unfortunately, adding de-listed data adds significant doubt as to whether the system would be viable in its current form. The performance was approximately halved when de-listed data was added. Adding in commissions will cause performance to further deteriorate.
A Huge Caveat:
Redshark, in the comments section of the previous post on this system, has pointed out that I may be making a mistake in using split-adjusted data for the requirement that the close must be greater than $5.00. I believe that he is correct. Using open interest rather than split-adjusted prices will likely change the results significantly.
Here is a chart that he sent me. I think it clearly illustrates the issue:
Using split-adjusted closes rather than open interest would have excluded almost 10 years of MSFT history. In fact, I am certain that my tests have indeed excluded MSFT as it did not meet the Close>$5.00. It should be obvious that we would want to have MSFT’s huge trend included to sample in this momentum system.
Up next, I will re-run some tests using open interest rather than split-adjusted data and see how it changes things. Maybe it will make enough of a difference that we will not have to go back to the drawing board.
As an aside, I think it is appropriate to point out the power of collaboration and the benefit of generosity. Leveraging the experience and wisdom of other folks has allowed me to accomplish things that I never could have imagined on my own.
I am now adding a volume, liquidity, and price filter. Here are the specifics:
- Volume must be greater than or equal to 150,000 shares on average over the last 50 days.
- Liquidity (50 day average price * 50 day average volume) must be greater than or equal to $1,500,000.
- Price must be greater than $5.00/share.
All of the parameters from the initial testing remained the same.
Summary of Results:
We can see that these filters have approximately halved the average % profit compared to not having any filters.
This makes one ask, are the filters necessary? I think that they are. A good deal of the trades without the filters are stocks trading well beneath $5 a share. This makes sense as compared to a large or mid-cap stock, these small or micro caps seem to have a greater propensity for making a huge percentage gain over six-months’ time. Often, since they may have been virtually unknown, volume and liquidity is very low. Since we want to be able to replicate results, it makes sense to require enough volume and liquidity to be able to get in and out of the trade without significant slippage and without pushing the price up or down with our orders. In the end, the results are not as spectacular, but spectacular results mean nothing if the strategy will not work in real-life trading.
To compensate, I am going to start looking at a longer K time of 66 trading days. I am also going to put in a skip period (S) of 22 days in a future test and see how that affects things.
Just For Fun:
I know some of you like the statistics and chart porn. I’m going to throw you a bone. I ran a quick backtest of the system, using J=132, K=66, and S=1. No commissions or slippage was used. The results are below.
|Net Profit %||1906.89 %|
|Exposure %||98.26 %|
|Net Risk Adjusted Return %||1940.73 %|
|Annual Return %||16.17 %|
|Risk Adjusted Return %||16.46 %|
|Avg. Profit/Loss %||7.00 %|
|Avg. Bars Held||74.73|
|Winners||686 (50.11 %)|
|Avg. Profit %||34.32 %|
|Avg. Bars Held||81.66|
|# bars in largest win||202|
|Losers||683 (49.89 %)|
|Avg. Loss %||-20.45 %|
|Avg. Bars Held||67.76|
|# bars in largest loss||66|
|Max. trade drawdown||-319600.00|
|Max. trade % drawdown||-88.57 %|
|Max. system drawdown||-1952248.87|
|Max. system % drawdown||-71.58 %|
|Ulcer Performance Index||0.32|
|Sharpe Ratio of trades||0.25|
This current early iteration of the system shows that it has problems, with drawdowns and volatility being primary concerns. I’ll address these issues in future posts. I do find the profit distribution to be of particular interest. This system produces some very big winners, and some very big losers. The momentum anomaly ultimately drives the performance, with winners 1.37 times larger (on average) than the losers.
The other concern is how large of a K to use. This test used 66, but perhaps I should consider a longer or shorter K. 66 was chosen (see bar graph above) because from about 46 to 78, performance seems to flat line. A shorter K will mean more turnover, more commissions, slippage, etc. What I’m most curious about is the relationship between K and the volatility of returns.
Introduction: Let’s Build a Momentum System
Tonight I want to look at how momentum develops over time. When building this momentum system, I am going to rank stocks by their performance over the previous J trading days, and they will be held for a minimum of K trading days. S will represent the number of trading days to skip before initiating the trade.
I am assuming that 22 trading days roughly equals 1 calendar month. For this test I am ranking stocks by their rate-of-change (ROC) where J=132 (roughly 6 calendar months) and K varies from 22 to 130 (1 month to 6 months). The number of trading days in a month is not exact, but it should not matter significantly.
The portfolio will consist of the top 20 stocks with the highest ROC over the last J trading days, with all positions equally weighted. As the system develops, the portfolio will shrink. As this is a proof-of-concept, I want to ensure a large sample size.
It is important to note that after K has been met, 1 of 2 things may happen: If the stock is no longer in the top 20, it will be sold and replaced. If, after K has been met and the stock is still in the top 20, it will be held as long as it remains in the top 20. This is a little confusing. Leave a comment if the concept needs some fleshing-out.
All buys and sell happen on the close the day AFTER the signal to buy/sell is given. (To be clear, the exact formula will be J=132, K=22-130, and S=1). I have purposefully ran the test this way as it allows for easy replication in that one could run the scans after the close and place a Market-On-Close order for the next day. I prefer trading the close as there is more liquidity and a much less likelihood of slippage.
The test was run over all major exchange listed stocks from 1/1/1986 to 12/31/2005.
This is a rudimentary analysis, but it does show the momentum anomaly. In fact, these results do not differ much from the results in the academic momentum literature (enter “momentum stock market” in search box) where similar strategies are tested.
Buying the best 20 performing stocks where J=132 and holding for K=22-130 yields impressive average trades. There are lots of issues to consider, such as if J=22 has an average trade of ~6% then we would expect that J=110 should yield an average trade of ~30%. As this graph shows, by the time we get out to J=110, the average trade is ~18%. Thus, momentum is slowing over time. What this suggests is that it will likely be better to use a smaller J and rely on increased turnover to generate greater profits.
How does this compare to a buy-and-hold strategy on the $SPX?
At K=22, the momentum approach vs. $SPX buy-and-hold generates an alpha of better than 5%.
Next, I will add a volume, liquidity, and price filter.
Jump to Part 3: Momentum System: Adding Volume, Liquidity, and Price Filters.
Please feel free to comment during this process.
Momentum is a well-researched and documented (enter “momentum stock market” in the search window) anomaly in the financial markets. CXO Advisory also has completed some impressive work on momentum. As I have focused primarily on trading short-term mean-reversion setups, I have come to realize the importance of allocating assets into strategies that are not correlated.
Therefore, in this next series of posts, I am going to build a momentum-based rotational system, step by step.
As a place to start this testing I will be using some of the assumptions I’ve gleaned from CXO Advisory’s work as well as from this paper: Are Momentum Strategies Profitable? Evidence from Singapore. The assumptions are that momentum needs some time to develop (or one risks getting caught in mean-reversion), and that returns from momentum strategies will get smaller the longer the positions are held. Therefore, the measure of momentum I will use will be the stocks having the greatest rate-of-change over the last six months, and these stocks will be held for at least one month. The system will be long only.
The tests will incorporate the following ideas, but not necessarily in this order:
1. Test all stocks on U.S. exchanges, with no price, liquidity, or volume filter. (All tests will exclude OTCBB listings).
2. Add a price, liquidity, and volume filter.
3. Add a filter for volatility (volatile issues will be given a lower ranking, even if they have a higher six-month rate-of-change).
4. Add a bear-market filter.
5. Add a stop-loss.
6. Test system over de-listed data.
7. Investigate the effects of varying the number of positions held at one time.
8. Add in varying levels of commissions/slippage.
I will run these tests out-of-sample, over a 10 20 year slice of market history: 1986-2005. This period encompasses both bull and bear markets. The final tests will be run in-sample from 2006 to the present.
Next Post: Momentum Proof of Concept.