StockFetcher Forums · Filter Exchange · PORTFOLIO SELECTION AND MANAGEMENT USING RISK/REWARD RATIOS<< 1 ... 26 27 28 29 30 ... 65 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #102345
Ignore Kevin_in_GA
8/18/2011 3:46:34 PM

The filter I am using is as follows:

Fetcher[

set{var1,WEEKLY ROC(14,1)}
set{var1a, IND(SPY, var1)}
set{var1b, IND(IWM, var1)}
set{var1c, IND(EFA, var1)}
set{var1d, IND(BND, var1)}

ADD COLUMN WEEKLY ROC(14,1) {14 week performance}

SET{RANK1A, COUNT(var1 is above var1a,1)}
SET{RANK1B, COUNT(var1 is above var1b,1)}
SET{RANK1C, COUNT(var1 is above var1c,1)}
SET{RANK1D, COUNT(var1 is above var1d,1)}
SET{RANK1E, RANK1A + RANK1B}
SET{RANK1F, RANK1C + RANK1D}
SET{RANK1G, RANK1E + RANK1F}
SET{RANK, 4 - RANK1G}
ADD COLUMN RANK {current rank}


SYMLIST(IWM,EFA,SPY,BND)
ADD COLUMN SEPARATOR
SORT ON COLUMN 5 DESCENDING
chart-display is weekly
CHART-TIME IS 26 WEEKS
]



Note that you can substitute other ETFs instead of these (e.g., GLD would be a candidate). The basic premise is what is really important. Feel free to trade this as you like. I'll stick with the settings and ETF list above for now.

jackmack
334 posts
msg #102349
Ignore jackmack
8/18/2011 4:17:21 PM

Kevin - perfect - Thank you for all you have done here.

Kevin_in_GA
4,599 posts
msg #102364
Ignore Kevin_in_GA
8/19/2011 7:50:28 AM

Here is a slightly more detailed version - the same code and ranking, but this also calculates the Sharpe ratio for each asset class.

Fetcher[

/*14 WEEK PERFORMANCE AS RANK VARIABLE*/

SET{perf, weekly roc(14,1)}
SET{perf2, perf/100}
SET{rfr, ind(^irx,close)}
SET{RISKFREERETURN, rfr/100}
SET{perf14, perf - RISKFREERETURN}
SET{STD14, CSTDDEV(weekly CLOSE,14)}
SET{VOL14, STD14 / weekly MA(14)}

/*CALCULATION OF SHARPE RATIO - ANNUALIZED*/
SET{SHARPE14a, perf2 / VOL14}
set{sharpe14, sharpe14a * 0.5189}

set{var1,WEEKLY ROC(14,1)}
set{var1a, IND(SPY, var1)}
set{var1b, IND(IWM, var1)}
set{var1c, IND(EFA, var1)}
set{var1d, IND(BND, var1)}

SET{RANK1A, COUNT(var1 is above var1a,1)}
SET{RANK1B, COUNT(var1 is above var1b,1)}
SET{RANK1C, COUNT(var1 is above var1c,1)}
SET{RANK1D, COUNT(var1 is above var1d,1)}
SET{RANK1E, RANK1A + RANK1B}
SET{RANK1F, RANK1C + RANK1D}
SET{RANK1G, RANK1E + RANK1F}
SET{RANK, 4 - RANK1G}

ADD COLUMN SEPARATOR
ADD COLUMN RANK {current rank}
ADD COLUMN SEPARATOR
ADD COLUMN WEEKLY ROC(14,1) {14 week performance}
add column sharpe14 {sharpe ratio}
add column corr(^spx,70, close) {correlation to S&P 500}

SYMLIST(IWM,EFA,SPY,BND)
SORT ON COLUMN 6 ASCENDING
chart-display is weekly
CHART-TIME IS 26 WEEKS

]



jackmack
334 posts
msg #102376
Ignore jackmack
8/19/2011 2:33:35 PM

Kevin - again great work.
I have a question that has had me stumped and was wondering if you might be able to help.
As one asset class moves out of favor and another moves in is there any way to get a graph or chart ("The Big Picture") of
how they are beginning to move relative to one another? I am not looking to jump from one to the other (catching tops or bottoms) but just wanting some type of graph or chart that has them in relation to one another at any given point in time.
Is that possible? Are you able to show that?
Thank you


03bsbme
20 posts
msg #102397
Ignore 03bsbme
8/22/2011 12:40:58 AM

Kevin, in the most recent filter you posted on this page are you evaluating these on a weekly, monthly, or quarterly basis?

Kevin_in_GA
4,599 posts
msg #102398
Ignore Kevin_in_GA
8/22/2011 7:48:02 AM

Weekly, with any reallocation decisions made on Friday. If the leader has changed during the week I'll usually make the reallocation by noon.

03bsbme
20 posts
msg #102410
Ignore 03bsbme
8/22/2011 10:24:17 PM

So you would typically run the filter sometime Friday morning after the open and make the decision then? I'm probably incorrect here, but I thought that the weekly data from SF was only valid after the Friday close.

Any thoughts on stops? Perhaps an ATR trailing stop. This may be useful to prevent drawdown, but may also hurt returns if the ETF rebounds. My thinking is that the ETF may be the highest ranked, but still dropping albeit not as quickly as the others. The problem (or possibly good thing) if your stop gets hit is that you may not have any holdings for a while if you do this. And when do you jump back in? Wait for another ETF to pass it or buy it again if you believe the selloff is over? Anyone have ideas on this?

Of course the system as is seems to work great. I'm just curious about ways to improve it if possible.

glgene
613 posts
msg #102430
Ignore glgene
8/23/2011 8:46:26 PM

Kevin,

You are simply amazing! You win the Gold Star award, wrapped in gold!

Keep up the great SF coding, and being so kind to share it.

Gene in OH



Kevin_in_GA
4,599 posts
msg #102437
Ignore Kevin_in_GA
8/24/2011 8:35:30 AM

So you would typically run the filter sometime Friday morning after the open and make the decision then? I'm probably incorrect here, but I thought that the weekly data from SF was only valid after the Friday close.

True, but what drives the decision is the ranking, not necessarily the close price. In most cases the ranking leadership changes mid-week, and by Friday it is pretty much set. I deviate occasionally (recently EFA passed BND to assume the top spot, but I stayed in bonds because of the obvious issues in Europe - good call since EFA dropped out of the top spot and BND was once again the leader by the end of the next week).

I also look at the volatility and Sharpe ratio. If the difference in 14 week performance between say, SPY and BND is less than a percent, I would likely stay in BND if I were there already even if the signal said to go into equities. Just being honest here - the system is mechanical, but I am not always going to agree with the call.

Any thoughts on stops? Perhaps an ATR trailing stop. This may be useful to prevent drawdown, but may also hurt returns if the ETF rebounds. My thinking is that the ETF may be the highest ranked, but still dropping albeit not as quickly as the others. The problem (or possibly good thing) if your stop gets hit is that you may not have any holdings for a while if you do this. And when do you jump back in? Wait for another ETF to pass it or buy it again if you believe the selloff is over? Anyone have ideas on this?

The system does not use stops. I have played with this, but it really did not improve performance. Also, stop thinking about these as ETFs - the ETFs are simply the proxies for the underlying asset class. It is the asset class into which you are investing as much as it is the specific ETF.

Kevin

mahkoh
1,065 posts
msg #102448
Ignore mahkoh
8/24/2011 5:58:32 PM

Kevin, if I still want to use the 8 etf's you were using earlier in the thread would this be correct?

Fetcher[

/*14 WEEK PERFORMANCE AS RANK VARIABLE*/

SET{perf, weekly roc(14,1)}
SET{perf2, perf/100}
SET{rfr, ind(^irx,close)}
SET{RISKFREERETURN, rfr/100}
SET{perf14, perf - RISKFREERETURN}
SET{STD14, CSTDDEV(weekly CLOSE,14)}
SET{VOL14, STD14 / weekly MA(14)}

/*CALCULATION OF SHARPE RATIO - ANNUALIZED*/
SET{SHARPE14a, perf2 / VOL14}
set{sharpe14, sharpe14a * 0.5189}

set{var1,WEEKLY ROC(14,1)}
set{var1a, IND(VWO, var1)}
set{var1b, IND(IWM, var1)}
set{var1c, IND(VNQ, var1)}
set{var1d, IND(TLT, var1)}
set{var1e, IND(GLD, var1)}
set{var1f, IND(UUP, var1)}
set{var1g, IND(MOO, var1)}
set{var1h, IND(AGG, var1)}


SET{RANK1A, COUNT(var1 is above var1a,1)}
SET{RANK1B, COUNT(var1 is above var1b,1)}
SET{RANK1C, COUNT(var1 is above var1c,1)}
SET{RANK1D, COUNT(var1 is above var1d,1)}
SET{RANK1E, COUNT(var1 is above var1e,1)}
SET{RANK1F, COUNT(var1 is above var1f,1)}
SET{RANK1G, COUNT(var1 is above var1g,1)}
SET{RANK1H, COUNT(var1 is above var1h,1)}

SET{RANK1EE, RANK1A + RANK1B}
SET{RANK1FF, RANK1C + RANK1D}
SET{RANK1GG, RANK1E + RANK1F}
SET{RANK1HH, RANK1G + RANK1H}
SET{RANK, 8 - RANK1HH}

ADD COLUMN SEPARATOR
ADD COLUMN RANK {current rank}
ADD COLUMN SEPARATOR
ADD COLUMN WEEKLY ROC(14,1) {14 week performance}
add column sharpe14 {sharpe ratio}
add column corr(^spx,70, close) {correlation to S&P 500}

SYMLIST(IWM,VWO,VNQ,MOO,AGG,TLT,UUP,GLD)
SORT ON COLUMN 6 ASCENDING
chart-display is weekly
CHART-TIME IS 26 WEEKS
]




StockFetcher Forums · Filter Exchange · PORTFOLIO SELECTION AND MANAGEMENT USING RISK/REWARD RATIOS<< 1 ... 26 27 28 29 30 ... 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.