Seeking Alpha

ETF ProTrader's  Instablog

ETF ProTrader
Send Message
CTO, FLHP Trading Systems, LLC Aerospace and Computational Engineer with 28 years experience in Engineering and Scientific Modeling and Programming including large scale vector and parallel processing. Work includes Finite Element Modeling in Structural Analysis, Magnetic Modeling, and Fluid... More
My company:
FLHP Trading Systems, LLC
  • Developing A Simple Model To Day Trade SPY 0 comments
    Aug 4, 2014 11:33 AM | about stocks: SPY, SH, SSO, UPRO, SPXL

    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 counter-intuitive, 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 buy-and-hold 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 ex-dividend 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:

     Total DaysWinning DaysLosing DaysAverage Daily GainAverage GainAverage LossGain/Loss Ratio
    Buy the Close Sell the Open53933076 57.04%2317 42.96%0.035%+0.393%-0.440%0.893

    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 392-day 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 392-day 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 > 392-day SMA and Zone 2 is when SPY < 392-day 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:

    ZoneTotal DaysWinning DaysLosing DaysAverage Daily GainAverage GainAverage LossGain/Loss Ratio
    1 Long

    3819 76.35%

    2213 57.95%1606 42.05%0.054%+0.350%-0.354%0.989
    2 Short1183 23.65%577 48.77%606 51.23%0.025%+0.724%-0.640%1.131

    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 392-day MA strategy is after the 392nd day when we can accurately compute a 392-day SMA.

     Total DaysWinning DaysLosing DaysAverage Daily GainAverage GainAverage LossGain/Loss Ratio

    Buy the Close Sell the Open

    50022819 56.36%2183 43.64%0.035%+0.413%-0.452%0.914

    So a couple of quick observations. Zone 1 (SPY > 392-day 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 < 392-day 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:

    ZoneCondition 1Condition 2
    1SPY > 392-day SMASPY > 12-day SMA
    2SPY > 392-day SMASPY < 12-day SMA
    3SPY < 392-day SMASPY > 12-day SMA
    4SPY < 392-day SMASPY < 12-day SMA

    Here's the statistics for our new four zone strategy:

    ZoneTotal DaysWinning DaysLosing DaysAverage Daily GainAverage GainAverage LossGain/Loss Ratio

    1 Long

    2445 48.88%1315 53.78%1130 46.22%+0.015%+0.302%-0.319%0.946

    2 Long

    1374 27.47%898 65.36%476 34.64%+0.124%+0.422%-0.437%0.966

    3 Short

    532 10.64%274 51.50%258 48.50%+0.050%+0.617%-0.553%1.116
    4 Short651 13.01%303 46.54%348 53.46%+0.005%+0.821%-0.705%1.165

    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 buy-and-hold 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 16-zone 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.

    Stocks: SPY, SH, SSO, UPRO, SPXL
Back To ETF ProTrader's Instablog HomePage »

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.

Comments (0)
Track new comments
Be the first to comment
Full index of posts »
Latest Followers

StockTalks

More »
Posts by Themes
Instablogs are Seeking Alpha's free blogging platform customized for finance, with instant set up and exposure to millions of readers interested in the financial markets. Publish your own instablog in minutes.