April 15


Using Fear to Time the Market

By Jeff Swanson

April 15, 2013

automated trading, Automated Trading Development, EasyLanguage, mean reversion, S&P Emini, stock index futures

Would you like to see a trading model that is 75% correct and consistently pulls money from the S&P? The following trading model is called the VIX Stretch Strategy and was found in a book called “Short Term Trading Strategies That Work” by Larry Connors and Cesar Alvarez. The concept is executed on a daily chart of the S&P E-mini futures market and the rules are very simple.

1) Price must be above its 200-day moving average
2) VIX must be stretched 5% or more above its 10-day moving average for 3 or more days
3) Exit when 2-period RSI crosses over 65

A  200-day simple moving average (SMA) acts as a simple market environment filter by dividing the market into two major regimes: bullish and bearish. Since the strategy only goes long, trades are initiated if the closing price is above the 200-day SMA filter.

The next rule utilizes the VIX which is a measure of the implied volatility of the S&P 500 index options. This is sometimes called the fear index. Why? You will see this index climb dramatically when the market sharply falls and market participants become fearful. Thus, spikes in the VIX index are often associated with steep or dramatic market selling. Since we are looking for a market downturn to open a long trade when we are within a longer term bullish trend, we use the VIX index to gauge the market downturn. Buying the dips within an overall bull market is a classic trading setup. It’s also interesting to note we are not simply using price action to gauge a market downturn. By using VIX to gauge the level of the market downturn we are measuring the increasing volatility seen in the S&P 500 index option prices. Thus, we are not measuring a pullback in price directly, but indirectly.

The final rule is our exit rule which uses a 2-period RSI. Upon the close of the daily bar the RSI is calculated and if this value is above 65 we exit at the close. I coded these rules in EasyLanguage and tested it  on the S&P cash market going back to 1983. It did rather well. Before getting into the details of the results let me say this: All the tests within this article are going to use the following assumptions:

  • Starting account size of  $100,000.
  • Dates tested are from 1983 through March 31, 2013.
  • The number of shares traded will be based on volatility estimation and risking no more than $2,000 per trade.
  • Volatility is estimated with a five times 10-day ATR calculation. This is done to normalize the amount of risk per trade.
  • The P&L is not accumulated to the starting equity.
  • There are no deductions for commissions and slippage.
  • There are no stops.

Here is the position sizing formula used:

Shares = $2,000 per trade / 5 * ATR(10)  

Below are the results for the S&P cash index trading the rules as defined by the original creator of the system.

This strategy, like many of the Connors trading models, did well until late summer of 2011 when U.S. debt talks spooked the market into a series of strong bear days. The trading model as it currently stands does not have any protective stops! Remember, this is a study of a potential market edge that could be exploited with a complete trading system. But as it stands, it’s not a complete system. However, even after the big crash in 2011 the system continues to produce winning trades so I’m not overly worried about that single big loss, for now. I’m more interested in testing the robustness of the input values surrounding this basic system premise. Let’s look at a few of those inputs now.

Testing Stretch Factor

The original rules look for three consecutive days where the VIX is stretched 5% beyond the 10-day average. I want to test different percentages around the original 5% values to see how well the system will hold up. This is done to test the robustness of this setting thus, the robustness of the trading model. A strong market edge will allow variations within the parameters of the model and still produce positive results. Ideally changing the stretch factor values should maintain positive results. What I don’t want to see are small changes in the stretch factor changing the trading results dramatically.

I will test the stretch factor using TradeStation optimization feature. I will test stretch values of 1% – 15%. Below is a graph depicting the results. The x-axis depicts the percentages 1 – 15 and the y-axis depicts the profit generated for that particular run.

It’s not too surprising to see we have fewer dollars generated by the system as we increase the stretch factor. It’s a very orderly decent. Of course we’ll have fewer trades as we require the VIX to be further and further stretched thus, we’ll also have less profit. One may be tempted to simply take trades that are stretched beyond 1% and make $40,000 in profit. However, what this does not tell us is how effective or efficient each trade may be. Sure you are making more money but how many trades is it taking to generate that return? Let’s look this from another angle by graphing the average profit per trade vs. the stretch factor.

This is even more interesting. Notice as we go from a 1% stretch to around a 10% stretch we generate more dollars per trade. In other words, our system becomes more efficient. If we take all trades that generated by a 1% stretch or greater we make just over $100 per trade. But we average around $200 per trade when we get around 8% and go beyond that at 9% and 10%. Here we can see why a 5% value seems very reasonable and not optimized.

There is something else here too. Notice after the 10% stretch value our average profit falls off. This tells me that if the VIX is stretch beyond 10% price is likely to continue to fall! This is an important clue. Maybe limiting tradable setups to only between 5% and 10% would be a worthwhile test to conduct. For now let’s leave it be and conclude a 5% stretch factor appears robust and not optimized. Let’s look at another parameter.

Testing SMA

For the same reasons as stated in the stretch factor test we just performed, I now want to look at the 10-day average parameter. Once again I will use TradeStation’s optimize feature to test values over a 1-20 period. Below is a graph depicting the results. The x-axis depicts the look-back period used in the SMA calculation, 3 – 20, and the y-axis depicts the profit generated for that particular run.

Here we are happy to see that there is a wide-range of profitable choices to pick for an SMA look-back period. Our current value of 10 does not look optimized at all. Now that we’ve look at the two important input values, let’s look at how the market behaves after a trade is triggered.

Post Event Market Behavior

After we have detected what we consider a spike in fear and we believe it’s time to go-long the market, I want to test the market’s general direction after such an event. Does the market tend to move lower, higher or not do much of anything? To test this I will simply hold a position X days after opening it then close it. I hope to see that after a VIX Stretch event occurs the market has a tendency to rise over the next few days or couple of weeks. Based upon my knowledge for testing other similar setups, I’m guessing this is exactly what we will see. I’m also guessing the longer we hold a trade, the more profit we generate. This would be consistent with other similar timing methods for the S&P. Below is a graph depicting the results. The x-axis depicts the hold period and the y-axis depicts the profit generated for that particular run.

Bingo! Just as I thought. The longer you hold a trade, the more profit you make. I would guess the VIX Stretch system could easily be improved upon by looking to hold trades longer than the original rules provide.


This appears to be another viable method for determining a high probability entry point. We have demonstrated that the parameters of this trading model appear robust, working across a variety of values. We have also demonstrated that the market tends to show a strong tendency to rise after a trade is triggered.

The code I used to generate the results is available at the bottom of this article. Is this a complete trading system that you can trade with your own money? Probably not. Please note the code used to generate these results has no stops! Most people would consider this a complete violation of the rules. I myself would not trade without stops. So a catastrophic hard stop may be added. In closing, this timing strategy is a great seed idea for building a complete trading system. With a little creativity I’m sure you could turn this into a winning system.

Get The Book

Jeff Swanson

About the author

Jeff has built and traded automated trading systems for the futures markets since 2008. He is the creator of the online courses System Development Master Class and Alpha Compass. Jeff is also the founder of EasyLanguage Mastery - a website and mission to empower the EasyLanguage trader with the proper knowledge and tools to become a profitable trader.

  • Very interesting. Thank you!

    The main problem is it doesn’t trade enough. Just for fun, I made the following changes: Stretch decreased from .05 to .03; threshold increased from 65 to 75; # days above 10 day decreased from 3 to 2.

    This doubled the # of trades.


  • I could be wrong, I often am, however I think the entry should be “buy this bar at close”


    If Condition1 And Condition2 Then buy(“LE”) Cntracts contracts this bar at close;

    from Connors’ book:
    1. The SPY is above its 200-day moving average (you can use the
    SPX also).
    2. The VIX is stretched 5% or more above its 10-day MAfor 3 or
    more days. If this occurs, we’ll buy the market on the close.
    3. Exitwhen the SPYcloses above a 2-period RSI reading of 65 ormore

    Thanks for coding this. I have CVRIII coded if you want it.

    Also on your TRIN indicator it should say put TRIN in Data2 not VIX.

    All the best,

  • Hello Sean. Thanks for the corrections. Would love to see the CVRIII code. Feel free to email it to me via the form on the site or post it here in the comments. Thanks much!


  • Here is the Connors VIX reversal strategy code. It is another great mean reversion tool. It only occurs a few times a year when the VIX is above its ten day MA and the open is above the close (e.g. the reversion has begun):

    vars: vixH(0),vixL(0),vixo(0),VixC(0),avgval(0),buycond(false),sellcond(false),catlong(0);

    vixH = high of data2;
    vixL = Low of data2;
    vixC = Close of data2;
    vIXo = open of data2;

    avgval = average(vixC,10);

    buycond = VixL > avgval[1] and vixC >= (avgval[1] + (.10*avgval[1])) AND VIXC < VIXO;
    sellcond = VixH < avgval[1] and vixc VIXO;

    If buycond then buy on close;
    if sellcond then sell on close;

    if Vixl = avgval[1] then exitshort this bar on close;

    Have you coded any of the TPS strategies?

  • I don’t know any programming, but I have followed Jeff’s work for over two years. I do daytrading only on short tf. However, I’d like to expand to swing trading. I’d like to share with you all this model and receive feedback for what you think it is worth, or whether it is rubbish: http://www.marketgene.com/indicators.aspx. It is seems correlated to Jeff’s look on markets long-term overbought/oversold, beginning and end of trends, as well as strength of a trend.

  • Hey Sean,

    Did you forget something in the code that you posted?

    sellcond = VixH < avgval[1] and vixc ?? VIXO;

    Did you mean to have < for ??

    Thanx for the post,


  • There’s another VIX strategy in Dec’12 Stocks and commodities magazine. I’ve been playing with it quite a bit and seem to like it.
    Basically the equity buy only rules are:
    – VIX closes below the 50 period moving average 11 consecutive days
    Exit rule
    – VIX closes above the 50 period moving average 11 consecutive days
    Very simple just like a simple moving average filter on price and some amazing results too. I will share my results across different ETFs (core, sector, leveraged), Mutual funds, Equities later when I have more time.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Learn To Code & Build Strategies
    Using EasyLanguage.