iBankCoin
Joined Nov 11, 2007
1,458 Blog Posts

Trendfollowing Setup for the Buy and Hold Investor: Part 3

Monday, July 27,  marked the first time since early 2008 that the 200 day simple moving average (dsma) of (SPY: 97.89 -0.47%) turned up.

This development presented a good opportunity to test a new idea. The idea is to go long if the 200dsma is higher than the previous day and the close is above the 200dsma, and sell the long position and go short if the 200dsma is lower than the previous day.

You might want to visit other variations of this theme here: Variation 1 and Variation 2.

The Method:

Variation 3: Buy the SPY if the 200dsma is higher than the day before and the close is above the 200dsma. Sell short if the 200dsma is lower than the day before.

The exit signal for long positions is generated if the 200dsma is lower than the day before. The long exit signal is also the short entry signal, and vice-versa.

All variations compound gains (this is to make for an accurate comparison to buy-and-hold investing) but do not include commissions and slippage.

The Results:

200dsma-variation-3

200dsma-spy-long_short-portfolio-equity

200dsma-spy-long_short-underwater-equity

200dsma-spy-long_short-profit-table

Summary:

This system beat buy and hold handily (5.02% return for B-n-H during the same period) and reduced the drawdown significantly (56.47% drawdown for B-n-H).

During this period of time, the short side trades worked extremely well (the average winner was 6x larger than the average loser). However, if we go back to 1929 on the SPX, we will find that this hasn’t always been the case. I will have another post up going back on all SPX data for the sake of comparison.

These results show that adding the short trades might be worth the extra exposure, versus earning a risk-free return on cash when the 200dsma is downtrending.

But before we take this study to the bank, we will need to examine how this setup has performed over all the history of the S&P500.

If you enjoy the content at iBankCoin, please follow us on Twitter

9 comments

  1. B-rad

    Sounds like the lazy investor’s system. It is interesting to note that on the short side you may be wrong more often than you are right, but you know right away (<7 bars).

    What software are you running this on? Is it possible to show the chart w/ the entry/exits like the tradestation charts you’ve posted in the past?

    Keep it up! Thanks.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  2. Woodshedder

    B-rad, I’m running it on AmiBroker, only because I like the reporting a little bit more than Tradestation. I can show the chart with the entry and exits, but I don’t think they look as good as they do on TS. I will post that on the next installment.

    Love the avatar!

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  3. bill

    Woodshedder,

    Great research as usual. I have another variation (maybe “Variation 5”) that you might check out. I ran it for the last 15 years and it looks nice. It’s basically an “always in” (long or short) approach. It’s more of a Donchian channel strategy.

    Long when SPX makes a new 200 day high.
    Short when SPX makes a new 200 day low.

    Simple but interesting. If you have time I’d love to see how it compares with the others.

    bill

    • 0
    • 0
    • 0 Deem this to be "Fake News"
    • Woodshedder

      Bill, here are my results, tested over the SPY. Let me know if they are similar to yours. I’m showing
      6 total trades over all the SPY data. It seems to have worked really really well since about 1994/1995. I also tested it over the SPX, going back to 1929. It has worked, before 1994, but it really really starts to work well in 1994/1995.
      All trades Long trades Short trades
      Initial capital 100000.00 100000.00 100000.00
      Ending capital 631342.10 420003.32 311338.78
      Net Profit 531342.10 320003.32 211338.78
      Net Profit % 531.34 % 320.00 % 211.34 %
      Exposure % 99.97 % 70.08 % 29.89 %
      Net Risk Adjusted Return % 531.48 % 456.63 % 706.95 %
      Annual Return % 12.71 % 9.76 % 7.65 %
      Risk Adjusted Return % 12.71 % 13.93 % 25.60 %

      • 0
      • 0
      • 0 Deem this to be "Fake News"
  4. tamas

    Hello Wood,

    may you publish the Amibroker code of this idea ?

    thx
    Tamas

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  5. Woodshedder

    tamas, sure. Here it is:
    // tamas the code below is set up to be optimized to figure best MA and best lookback
    Num=Optimize(“Num”, 200, 1, 200, 1);
    Num1=Optimize(“Num1”, 1, 1, 200, 1);
    MA200 = MA(C, Num);
    Cond1= Ref(MA200, -Num1) MA200;

    Buy = C > MA200 AND Cond1;
    Sell = Cond2;
    Short = Cond2;
    Cover = Cond1;

    // tamas the code below is setup to be run for the basic 200 day average system
    MA200 = MA(C, 200);
    Cond1= Ref(MA200, -1) MA200;

    Buy = C > MA200 AND Cond1;
    Sell = Cond2;
    Short = Cond2;
    Cover = Cond1;

    Let me know if you have any questions.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
    • tamas

      Thank you!

      I think you missed one operation sign from this row:
      Cond1= Ref(MA200, -1) MA200;

      I think the right row is:
      Cond1= Ref(MA200, -1) > MA200;

      and you didn’t define the Cond2 variable.

      Am I right?

      bye,
      tamas

      • 0
      • 0
      • 0 Deem this to be "Fake News"
  6. Woodshedder

    Tamas, you are right, I left some things out.
    It should read like this:
    Cond1= Ref(MA200, -1) MA200

    This should fix it. Let me know if you have any more questions.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
    • tamas

      Hello Wood,

      I got a different result,than you . Can we check our codes nad settings etc? If yes, please send me an e-mail, I don’t want to make others tired.

      thanks

      • 0
      • 0
      • 0 Deem this to be "Fake News"