Full index of posts »
StockTalks

Developing A Simple Model To Day Trade SPY $SPY, $SH, $SSO http://seekingalpha.com/p/1v1u7 Aug 4, 2014

Using Leveraged ETFs With A Market Timing System: SPY, SSO, SDS, SPXL, SPXS http://seekingalpha.com/a/17r1h Feb 23, 2014
Developing A Simple Model To Day Trade SPY 0 comments
This post will introduce several simple day trading strategies using the well know ETF SPY. We'll begin with a simple observation, do some analysis, and then step by step build a model to trade this ETF in a unique way. The strategy and model is extensible to other ETFs but for simplicity we'll simply focus here on SPY, the S&P 500 ETF. The original "edge" was discovered quite by accident in previous studies of ETF behavior and modeling.
We'll start with a very simple strategy: Buy the Close and Sell the next day's Open. That would seem to be counterintuitive, but like many things in the stock market and life in general don't be surprised if the conventional wisdom is wrong. After all the conventional wisdom would say  you're exposing yourself to a great deal of risk, either overnight risk or weekend risk with such a strategy. However a simple analysis proves that initial reaction wrong; following this simple strategy actually outperforms, by a small margin, a simple buyandhold SPY strategy. For this article we'll look at all of the data for the SPY ETF that is available; the inception date for the SPY ETF was Jan 29, 1993 and we'll show data in this article through the end of 2Q 2014. We'll also neglect the effect of dividends; this is a valid omission since following the simple strategy with the actual ETF will have you as a valid holder of the ETF on each exdividend date.
When we begin development of a model and look at optimizations we look at a range of data and statistics. Specifically, the key output elements we focus on are winning percentage (# of days that the model or strategy is net positive / total number of days) and the average percent gain (or loss) for both winning days and losing days. Here's the data for the very simple strategy Buy the Close, Sell the Open for SPY from Jan 29, 1993 to Jun 30, 2014:
The total percentage gain for this simple Buy the Close Sell the Open strategy is 189.06% vs the actual gain for SPY over the period of 188.84%.
So looking at the statistics we can make two quick observations; first the winning percentage is actually quite good at 57%, however when the strategy is wrong the average loss on a losing day is greater than the average gain for a winning day (0.440% vs +0.393%). The first question one might ask is "Can we find a filter to reduce the average loss on losing days?". There are a wide range of potential candidates and strategies that one can investigate in that pursuit; for our study here again we'll stick with something very basic  the Simple Moving Average [SMA] for SPY. Here's the hypothesis we'll test: when SPY is above a specific SMA we'll employ the strategy, however when SPY is below that same SMA we'll reverse the strategy and go short (one way would be by buying the inverse SPY ETF SH at the close and selling at the next day's open). Graph 1 below is a plot of the total percentage gain for a range of simple moving averages where the green line is the percentage gain when SPY is above a given SMA and the red line is the percentage gain when SPY is below a given SMA.
(click to enlarge)
So the first thing we notice is that there is indeed an optimal value for a SMA in this study (there's actually two distinct peaks on the graph but we'll come back to that later) and the optimal value for our SMA is 392. By going Long SPY only when SPY is above its 392day SMA we can improve the winning percentage and average gain and we can also see that there is a small net overall loss when SPY is below its 392day SMA, so indeed it would be advantageous to short SPY when that condition is met. What we now have is the basis for a simple two zone strategy; Zone 1 is when SPY > 392day SMA and Zone 2 is when SPY < 392day SMA, and the model is long Zone 1 and short Zone 2. Let's look at the statistics for this new strategy overall and for each Zone:
3819 76.35%
Now let's compare this with an "adjusted" baseline. Why do we need to "adjust" the baseline? Because the original data started with the inception of the SPY ETF and the earliest we can begin to use the 392day MA strategy is after the 392nd day when we can accurately compute a 392day SMA.
Buy the Close Sell the Open
So a couple of quick observations. Zone 1 (SPY > 392day SMA) has both an improved winning number of days and a nicely improved Gain/Loss ratio vs the baseline. We now have a strategy that produces a nearly identical gain vs loss on winning days vs losing days (+0.350% vs 0.354%) and a nice 57.95% winning number of days in Zone 1. Zone 2 (SPY < 392day SMA) is a different animal; while Zone 2 actually has a slight bias toward losing days (51.23%) there's a significantly better gain (0.724%) on winning days vs a loss (0.640%) on losing days.
Now let's go back and look at the second peak in the first chart. Clearly there's a secondary peak that occurs at SMA = 12, so perhaps we can improve the strategy by expanding to a four zone strategy. The 4 zones we'll create and analyze are:
Here's the statistics for our new four zone strategy:
1 Long
2 Long
3 Short
Notice that this 4 Zone strategy offers no improvement in total gain vs our 2 Zone strategy  Zones 1 & 2 are Long and Zones 3 & 4 are Short. However it does offer us some guidance on what the probabilities and average gains are for each individual zone, and Zone 2 is a standout zone  with a 65% winning percentage coupled with a small negative gain/loss ratio this is a very nice zone to trade. One possible way to implement a strategy using these zone statistics would be to simply trade Zone 2 Long; you would only be day trading 27.47% of the time and yet the percentage of winning days and average daily gain are quite favorable. The total percentage gain for Zone 2 alone is 170.75% while the total percentage gain for the 2 or 4 Zone model is 237.22% vs 182.22% (1.30x) for buyandhold SPY adjusted for the same time period. However, being Long from one day's Close to the next day's Open a bit over 25% of the time and generating 93.7% of the overall ETF gain seems like a very nice risk/reward tradeoff. Of course, there are also 2X and 3X leveraged SPY ETFs than can be used with this strategy quite effectively.
Last, we'll simply plot the cumulative percentage gain for the three strategies against our "adjusted" baseline, the initial simple strategy, the two or four zone strategy and the Zone 2 Long only strategy. One feature that immediately jumps out from the graph is the significant reduction in volatility, especially for the Zone 2 Long only strategy.
(click to enlarge)
In conclusion we've shown a couple of basic strategies that can be used to day trade SPY. The underlying methodology can also be used to develop more complex strategies. Currently we've developed 8 and 16zone strategies for several popular ETFs and experimented with 32 and 64 zone strategies.
Disclosure: The author has no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.
Instablogs are blogs which are instantly set up and networked within the Seeking Alpha community. Instablog posts are not selected, edited or screened by Seeking Alpha editors, in contrast to contributors' articles.
Share this Instablog with a colleague