StockFetcher Forums · Filter Exchange · PORTFOLIO SELECTION AND MANAGEMENT USING RISK/REWARD RATIOS<< 1 ... 11 12 13 14 15 ... 65 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #93369
Ignore Kevin_in_GA
6/1/2010 6:07:26 PM

Sure thing:

Fetcher[

/*MANAGING YOUR 401K WITH ONLY ONE TRADE PER MONTH*/

/*PORTFOLIO WILL BE COMPRISED OF ONLY 3 ETFS (EEM, IWM, AND SHY). OTHER ASSET CLASSES CAN BE ADDED AS ONE SEES FIT, BUT FOR THIS FILTER ONLY THESE THREE ARE EVALUATED.*/

/*BUY THE TOP SCORING ETF AT THE END OF EACH MONTH, AND HOLD IT UNTIL THE END OF THE FOLLOWING MONTH. IF IT IS STILL THE TOP SCORER, DO NOTHING. IF IT HAS BEEN REPLACED BY ONE OF THE OTHER ETFS, SELL IT AND BUY THE TOP SCORER*/

/*FIRST, CALCULATE PERFORMANCE OVER THE LAST 63 DAYS (THREE CALENDAR MONTHS) AND FOR THE LAST 21 DAYS (ONE CALENDAR MONTH). WE WILL USE THE THREE MONTH PERFORMANCE AS OUR SELECTION CRITERIA, BUT KEEP AN EYE ON THE 1 MONTH PERFORMANCE TO BE AWARE OF ANY WEAKENING IN PERFORMANCE THAT MIGHT INDICATE A TREND CHANGE.*/

SET{63DAYSAGO, CLOSE 63 DAYS AGO}
SET{63DAYRETURN, CLOSE - 63DAYSAGO}
SET{63RETURN, 63DAYRETURN / 63DAYSAGO}

SET{21DAYSAGO, CLOSE 21 DAYS AGO}
SET{21DAYRETURN, CLOSE - 21DAYSAGO}
SET{21RETURN, 21DAYRETURN / 21DAYSAGO}

/*NEXT, DETERMINE THE RISK-FREE RATE OF RETURN. HERE I AM USING THE AVERAGE YIELD OF A 1-MONTH T-BILL, WHICH IS CURRENTLY AT ABOUT 0.02% PER MONTH. THIS IS SUBTRACTED FROM THE ETF PERFORMANCE*/

SET{RISKFREERETURN, 0.0002}
SET{63PERFORMANCE, 63RETURN - RISKFREERETURN}
SET{21PERFORMANCE, 21RETURN - RISKFREERETURN}

/*FINALLY, CALCULATE VOLATILITY FOR EACH ETF, AND FOR THE BASELINE (SPY), OVER THESE TWO TIME PERIODS*/

SET{63STD, CSTDDEV(CLOSE,63)}
SET{63VOL, 63STD / MA(63)}

SET{SPY, IND(SPY,CLOSE)}
SET{SPYMA63, CMA(SPY,63)}
SET{63SPYSTD, CSTDDEV(SPY,63)}
SET{63SPYVOL, 63SPYSTD / SPYMA63}

SET{21STD, CSTDDEV(CLOSE,21)}
SET{21VOL, 21STD / MA(21)}

SET{SPYMA21, CMA(SPY,21)}
SET{21SPYSTD, CSTDDEV(SPY,21)}
SET{21SPYVOL, 21SPYSTD / SPYMA21}

/*NOW CALCULATE THE SHARPE RATIO FOR BOTH TIMEFRAMES (NOT ANNUALIZED)*/

SET{21SHARPE, 21PERFORMANCE / 21VOL}
SET{63SHARPE, 63PERFORMANCE / 63VOL}

/*NOW CALCULATE THE PERFORMANCE FOR SPY OVER THE SAME TIME FRAMES*/

SET{SPY21DAYSAGO, SPY 21 DAYS AGO}
SET{SPY21DAYRETURN, SPY - SPY21DAYSAGO}
SET{21SPYRETURN, SPY21DAYRETURN / SPY21DAYSAGO}
SET{21SPYPERFORMANCE, 21SPYRETURN - RISKFREERETURN}

/*ALPHA, THE EXCESS RETURN RELATIVE TO THE MARKET, IS NOW CALCULATED AS FOLLOWS*/

SET{ALPHA21a, 21PERFORMANCE - 21SPYPERFORMANCE}
SET{21ALPHA, ALPHA21a * 100}

SET{SPY63DAYSAGO, SPY 63 DAYS AGO}
SET{SPY63DAYRETURN, SPY - SPY63DAYSAGO}
SET{63SPYRETURN, SPY63DAYRETURN / SPY63DAYSAGO}
SET{63SPYPERFORMANCE, 63SPYRETURN - RISKFREERETURN}

SET{ALPHA63a, 63PERFORMANCE - 63SPYPERFORMANCE}
SET{63ALPHA, ALPHA63a * 100}

SET{21RELVOL, 21VOL / 21SPYVOL}
SET{63RELVOL, 63VOL / 63SPYVOL}
SET{21VOLPCT, 21VOL * 100}
SET{63VOLPCT, 63VOL * 100}

SET{MA200, close / MA(200)}
set{ma200a, ma200 -1}
set{MA200pct, ma200a * 100}

SYMLIST(SPY,EEM,SHY,IWM)

ADD COLUMN SEPARATOR
ADD COLUMN MA200pct {% ABOVE MA200}
ADD COLUMN 63SHARPE
ADD COLUMN 63ALPHA
ADD COLUMN 63VOLPCT {63VOL %}
ADD COLUMN SEPARATOR
ADD COLUMN 21SHARPE
ADD COLUMN 21ALPHA
ADD COLUMN 21VOLPCT {21VOL %}
ADD COLUMN SEPARATOR
SORT ON COLUMN 8 DESCENDING

CHART-TIME IS 63 DAYS
DRAW MA(200)
]



Note that after today's market close, this filter says to be in SHY (it was IWM as of close on Friday). I'll need to think about that.

medowz
59 posts
msg #93372
Ignore medowz
6/1/2010 9:57:40 PM

Excellent! More than I deserve for sure. Thanks again.

Kevin_in_GA
4,599 posts
msg #93398
Ignore Kevin_in_GA
6/2/2010 11:33:07 AM

Some more backtesting data ...

I downloaded the 3 month T-bill yields going back to 2003, and used them to generate a more accurate Sharpe ratio (which if you remember from my first post in this thread subtracts the "risk-free" rate of return from the ETF return prior to dividing by the ETF volatility).

Given that the risk-free rate of return has varied from over 5.25% in 2006 to as low as 0.00% in late 2009, it makes sense to use real data where possible. SF does not provide access to this data set, so for now I am manually assigning a value for the RFR of 0.14 (latest data from end of April). I wish we could get this as an index that could be referenced and dynamically updated.

Note that this does not change the relative strength rankings, as this value is subtracted from both sides before any comparison is made.

The above filter lets you see both the RS and Sharpe ratio (the risk-adjusted return) for the 21 day and 63 day timeframes. Obvious question - is a shorter timeframe more responseive, and do the risk-adjusted returns do as well as the "pure" performance plays?

The following data was manually generated using the T-bill yields in Excel. Rebalancing period is monthly, on the last trading day of each month.

63 day RS - 252.5% return since 7/31/2003
63 day Sharpe - 73.4% return since 7/31/2003

21 day RS - 124.0% return since 7/31/2003
21 day Sharpe - 46.1% return since 7/31/2003

SPY performance - 35.2% return since 7/31/2003


I also looked at only holding the selected ETF if it is above the 200 DMA - sell if it crosses below at the close on the day of the cross, and do not buy (stay in cash) for the month if on the rebalancing date the top ranked ETF is below its 200 DMA.

The effect for this approach is minimal - essentially no impact on the 63 day returns, and a decent improvement on the 21 day returns but not enough to make this a part of the strategy.

The 63 day RS approach has consistently been the winner, using both the ETFs since their inception dates, and the underlying index data going back through 1996. There are minor differences in the values generated, but the superior performance of this approach over buy-and-hold or a balanced portfolio of these ETFs is compelling.

My original thesis of this thread (that a risk-adjusted investment strategy based on Sharpe ratios is best) is slowly but inexorably being disproven by my own backtesting. If one is comfortable with some higher drawdown risk, the use of RS and ETF rotation can be a very effective investment strategy, and is well suited for managing things like TSPs or 401ks.



gmoney
8 posts
msg #93595
Ignore gmoney
modified
6/7/2010 11:10:17 AM

Greetings Kevin_in_GA.

I appreciate and thank you for sharing your awesome work with filters. Truly impressive.

1. Please tell me if you have created and posted a filter in the SF Forum that contains the aforementioned 63 RS criteria within your excellent ETF filter, rather than the 63 Sharpe criteria? (Note: Although your recent post says this filter now shows the difference between the 63 RS and 63 Sharpe, I don't see where the differential is shown either in the formulas, nor in the ETF screening report).

2. If so, where is this filter located and what is it called?

3. If such a filter has not been posted, may I ask you to consider posting a "new" filter with a "new" name that incorporates the request in question 1. above? Or if easier, to modify your current filter shown above to incorporate only the 63 RS criteria and delete the 21 Sharpe and 63 Sharpe criteria along with assigning a "new" revision name for this best-of-breed (beta test) simplified filter?

4. The purpose of this request is to confirm that filter modifications, such as those requested in questions 1. & 3. above, may provide even better future performance results, as indicated and suggested by your manually calculated backtesting results shown in your posting above.

Thanks in advance for sharing your knowledge and your filter-building skills.


Kevin_in_GA
4,599 posts
msg #93602
Ignore Kevin_in_GA
6/7/2010 2:08:02 PM

In the filter above, the column titled "63ALPHA" is what you want. It is the 63 day relative strength of each ETF compared to SPY. The only difference is that I have subtracted out the "risk-free rate of return" (essentially the return one can get from a 3 month T-bill or CD) from each side before comparing. Since that value is miniscule at the moment, one can ignore it if one chooses.

You can also just use the following filter:

Fetcher[

symlist(SPY,EEM,IWM,SHY)
ADD COLUMN RELATIVE STRENGTH(SPY,63)
SORT ON COLUMN 5 DESCENDING

]



The more complex filter constructed above is meant to be informative on relative risk as well as relative return. Most folks ignore or discount risk analysis.

olathegolf
119 posts
msg #93619
Ignore olathegolf
6/7/2010 11:54:08 PM

Kevin - I agree with many who say thanks for your work. I appreciate the clarity of your posts.

I would love to use a similar strategy with my 401K; however, we are limited to mutual funds investments.which are not supported by StockFetcher.

Short of manually calculating, do you know of another website that would allow me to determine the relative strength of mutual funds?

Kevin_in_GA
4,599 posts
msg #93627
Ignore Kevin_in_GA
6/8/2010 9:45:04 AM

Kevin - I agree with many who say thanks for your work. I appreciate the clarity of your posts.

I would love to use a similar strategy with my 401K; however, we are limited to mutual funds investments.which are not supported by StockFetcher.

Short of manually calculating, do you know of another website that would allow me to determine the relative strength of mutual funds?
+++++++++++++

You cn do this manually if you know the ticker - just go to finance.yahoo.com and download the daily or weekly data. Look at the percent change for each mutual fund over the past thirteen weeks (or 63 days for the daily data), and invest in the one that has had the greatest return (it will be the one that has the strongest RS relative to any other).

Alternatively, I am using the SHY, EEM, IWM, and SPY as proxies for the investments those mutual funds usually make (focused on international/emerging markets, smallcaps, largecaps, or cash/bonds). That is why I have such a short list of ETFs - each represents a different type of "mutual fund" available to me through my 401k.

cwn6161
40 posts
msg #93693
Ignore cwn6161
modified
6/10/2010 2:11:32 PM

Kevin, did you end up staying in IWM so far? I made a mistake and used an older filter at the end of the month to calculate the rankings, and it told me to switch in SHY. Kinda glad I did now, but I wonder if I should correct it and switch IWM since that's what the RS filter suggested.

Kevin_in_GA
4,599 posts
msg #93710
Ignore Kevin_in_GA
6/11/2010 8:33:12 AM

I have stayed in IWM - been a bit of a rough ride over the past few weeks. The SHY RS63 has moved above IWM as of the beginning of this month, but the month is young. This may play out like last July - the first ten days or so were rough, then a big move up.

Or it could go down.

Or it could chop ...

Whatever happens, I am sticking with this system for managing one of my accounts, I have a second similar sized account being professionally managed, and I have my trading account which has been all cash from mid-April (thankfully). I'll most likely be using Connors ETF trading strategies on the last account, and see at the end of the year which of the three approached works best.

bka58
49 posts
msg #94229
Ignore bka58
6/23/2010 6:51:05 PM

I love the work you have done here. I was wondering about a small tweak. I’m sure we each need to modify the symbol list to correspond to the choices in your particular 401K
Is there a way to add a comment column that allows you to provide a name that is meaningful to your 401K? For instance, the comment column might contain ‘Fixed Income’ for SHY and IEI and ‘Large Cap Value’ for VTV.

Just a little something to make the relationship quicker to identify.

Thanks for your efforts and sharing.


StockFetcher Forums · Filter Exchange · PORTFOLIO SELECTION AND MANAGEMENT USING RISK/REWARD RATIOS<< 1 ... 11 12 13 14 15 ... 65 >>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.