StockFetcher Forums · Filter Exchange · A SIMPLE MARKET TIMING FILTER<< 1 2 3 4 5 ... 7 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #103064
Ignore Kevin_in_GA
10/22/2011 4:53:54 PM

Doubtless many of you have seen or heard of sector rotation models for the market. The basic idea is that money rotates between sectors, and the overall flow tends to give a good indicator of investor sentiment.

The S&P 500 is characterized by nine sectors, each of which is tracked by an Exchange-Traded Fund. Three are usually considered "defensive" sectors - Utilities, Consumer Staples, and Healthcare - while three others are "offensive" sectors - Industrials, Consumer Discretionary, and Technology.

If one looks at the relative performance of Utilities versus Industrials, it quite often gives a heads-up about whether or not the market is about to change trend. As investors become more concerned about the economy, they shift from Industrials to Utilities. As confidence in the economy returns, the money flows back into Industrials and out of Utilities.

This is actually easy to code for in StockFetcher, using either the Comparative Relative Strength function or the ROC (rate-of-change) function.

Here's an example:

Fetcher[

set{relstrength, roc(11,1) - ind(SPY, roc(11,1))}

symlist(XLI,XLU,SPY)
ADD COLUMN SEPARATOR
ADD COLUMN relstrength {relative strength}

SORT ON COLUMN 6 DESCENDING
do not draw relstrength
draw ind(XLU, relstrength) on plot ind(XLI, relstrength)

ROC(11,1) above 0

]



Why 11 days? Well, over the last four years, this has been the most profitable timing for this strategy, yielding a return of 55% since 10/1/2007 (versus a -20% return for the SPY). Trading this is simple - buy the ETF with the highest Relative Strength, and sell it and buy the countertrend ETF if it becomes the leader. Since 10/1/2007 you would have been in the market 85% of the time in either XLU or XLI.

Alternative way to play this is to buy SPY when XLI is the leader, exit to cash when XLU leads (less profitable, but lower risk).

Eman93
4,750 posts
msg #103066
Ignore Eman93
10/22/2011 6:21:20 PM

Great work Kevin.. i like it better than the SPY VXX. the cross on the chart are very nice.

Its not very choppy,, nice market sentiment tool.




sierraseller
23 posts
msg #103069
Ignore sierraseller
10/23/2011 11:52:33 AM

Kevin:
Nice work.

FYI....All three charts in your post seem identical and don't match the three ETF closing values: i.e. 180 ish for all of the charts vs three different actual losing values for the etfs.. When I run the filter it seems to work ok, so i'm wondering if this is a posting glitch with SF or?

Also, any thoughts on combining this filter with a market direction scheme to catch the downtrends?

TIA

glgene
616 posts
msg #103070
Ignore glgene
10/23/2011 12:53:38 PM

Kevin,

Another great SF script by you. Thanks!

One question, though. When I run it (for example) on Oct. 4 or Oct. 5, I get the reply: "No stocks matched your filter. Debug."

Is that because of this script line? ROC(11,1) above 0

Wouldn't you want the result -- on any day -- to be either XLI or XLU? Maybe I'm missing something. ??

Gene


Kevin_in_GA
4,599 posts
msg #103072
Ignore Kevin_in_GA
10/23/2011 2:37:32 PM

Thanks, Eman. I have great respect for your skill and trading style, so I see this as a real compliment.

Since I like to provide full backtest data on my filters whenever possible, here is how this filter performed over the last 4 years:

Photobucket

The Sharpe ratio is not as high as other systems I have looked at, but this is not really designed to manage risk as much as provide guidance and a potentially profitable strategy for timing the market.

Kevin_in_GA
4,599 posts
msg #103201
Ignore Kevin_in_GA
modified
11/2/2011 1:30:33 PM

Might be a bit early to make this call, but it looks like the timing filter here is signaling a possible switching into XLU (the defensive sector) from XLI by the end of today or tomorrow. If so, this typically indicates a "risk off" period is now in place. Let's see over the next day or so if this plays out as I think it will.

EDIT: Could be a data delay from SF - the gap is significantly wider just 10 minutes later. Now I would not assume a transition in sector leadership just yet, but given the chaotic behavior of the markets, nothing can be ruled out!

gmg733
788 posts
msg #103214
Ignore gmg733
11/2/2011 9:56:55 PM

Several weeks ago I put all the Xxx ETFs into the ROC 14 week filter you posted based upon Mebane Faber's work. I noticed in another thread, or possibly this one, you reference risk on/risk off based upon the ETF at the top of the list. For several weeks now it has been the XLU and I made the same correlation you did in that when the XLU is at the top it is risk off.

I am beginning to fine Mebane's work very fascinating and very practical.

Good work.

duke56468
683 posts
msg #103216
Ignore duke56468
11/3/2011 11:42:05 AM

glgene
471 posts
msg #103070
- Ignore glgene 10/23/2011 12:53:38 PM

Kevin,

Another great SF script by you. Thanks!

One question, though. When I run it (for example) on Oct. 4 or Oct. 5, I get the reply: "No stocks matched your filter. Debug."

Is that because of this script line? ROC(11,1) above 0

Wouldn't you want the result -- on any day -- to be either XLI or XLU? Maybe I'm missing something. ??

Gene
******************************************************************************
Thanks Kevin......... once again very helpful. I have the same question as Gene, why don't all 3 symbols display every day?


Kevin_in_GA
4,599 posts
msg #103218
Ignore Kevin_in_GA
11/3/2011 12:47:31 PM

Yes, it is because the ROC(11,1) is not above 0. If you want just modify the filter by removing that line, but add

Add column ROC(11,1)

instead. You'll see that during the times mentioned above, the ROC was negative. This filter then says "go to cash". Very helpful in late 2008 and early 2009.

Kevin_in_GA
4,599 posts
msg #103275
Ignore Kevin_in_GA
11/9/2011 1:27:15 PM

Just noticed - as of 1:30 PM this filter indicates that one should move to XLU (or cash, if that is how you are using this approach). To me this makes sense - the XLI trade netted about 9-10% since the call on 10/6. Time to lock in profit and either move into a new defensive long position in XLU or to sit in cash until XLI is again the leader.

StockFetcher Forums · Filter Exchange · A SIMPLE MARKET TIMING FILTER<< 1 2 3 4 5 ... 7 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.