StockFetcher Forums · Filter Exchange · IWP IWS TLT 1X Filter<< >>Post Follow-up
davesaint86
725 posts
msg #139714
Ignore davesaint86
12/1/2017 2:17:06 PM

Below are the results for a filter that I've testing via ETFReplay and Portfolio Visualizer. I modified one of Kevin's Sharpe Allocation filters to build it. The strategy consists of buying either IWP or IWS on a quarterly basis based on the 5-Mth R/S. The sell signal is a price cross below MA(84) which you would buy TLT. Of course you could play the shorter trend within the longer trend and buy and sell the current selection. Below are the annual returns for this strategy. Not bad for a 1X ETF strategy.

Year Timing Return
2003 42.91%
2004 22.98%
2005 14.88%
2006 19.21%
2007 9.01%
2008 33.93%
2009 32.75%
2010 18.10%
2011 43.87%
2012 9.05%
2013 37.00%
2014 14.44%
2015 8.46%
2016 25.37%
2017 17.37%



Fetcher[symlist(iws,iwp,tlt)
SET{perf1A, ma(3) 105 days ago}
SET{perf1b, MA(3) / perf1a}
SET{perf, perf1b - 1}
SET{var1, perf*105}
SET{rfr, ind(^irx,close)}
SET{RISKFREERETURN, rfr/105}
SET{perf105, perf - RISKFREERETURN}
SET{STD105, CSTDDEV(CLOSE,105)}
SET{VOL105a, STD105 / MA(105)}
SET{vol105, vol105a * 100}
/*CALCULATION OF SHARPE RATIO - ANNUALIZED*/
set{sharpe, Sharpe Ratio(105) * 0.5}
set{var1a, IND(iws, var1)}
set{var1b, IND(iwp, var1)}
set{var1c, IND(tlt, 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, RANK1A + RANK1B}
SET{RANK1E, RANK1C + RANK1D}
SET{RANK, 3 - RANK1E}
set{var2a, IND(iws, sharpe)}
set{var2b, IND(iwp, sharpe)}
set{var2c, IND(tlt, sharpe)}


SET{var3a, COUNT(var2a is above 0,1)}
SET{var3b, COUNT(var2b is above 0,1)}
SET{var3c, COUNT(var2c is above 0,1)}
SET{var4a, var2A * var3a}
SET{var4b, var2b * var3b}
SET{var4c, var2c * var3c}
set{var5a, var4a + var4b}
set{var5b, var4c}
set{var5c, var5a + var5b}
SET{allocation1, sharpe / var5c}
set{allocation2, allocation1 * count(sharpe above 0,1)}
set{allocation, allocation2 *100}

and draw Slow Stochastic(14,3) Fast %K line at 20.00 and draw Slow Stochastic(14,3) Fast %K line at 80.00
and draw Slow Stochastic(14,3) Fast %K line at 50.00
and draw Slow Stochastic(5,1) Fast %K line at 20.00 and draw Slow Stochastic(5,1) Fast %K line at 80.00 and draw Slow Stochastic(5,1) Fast %K line at 50.00

set{E3, TSI(5,5,9) - Smoothed TSI(5,5,9)}
set{TDLongposition, count(E3 > 0,1)}
set{TDShortposition, count(E3 < 0,1)}
SET{TDTRIGGER,0}
draw TSI(5,5,9)

set{E9, close above ma(84)}
set{DLongposition, count(E9 > 0,1)}
set{DShortposition, count(E9 < 0,1)}
SET{DTRIGGER,0}


set{vmult, atr(10) * 1.5}
set{vstopu1a, low 5 day low + vmult}
set{vstopu2a, close + vmult}
set{vstop, min(vstopu1a 1 day ago,vstopu2a)}

draw vstop on plot price
set{E11, close is above vstop}
set{VLongposition, count(E11 > 0,1)}
set{VShortposition, count(E11< 0,1)}

SET{VTRIGGER,0}

set{CRS1, rsi(4),1)}
set{CRS2, rsi(9),1)}
set{CRS3, rsi(30),1)}
set{CCRS1, CRS1 + CRS2}
set{CCRS2, CCRS1 + CRS3}
set{CCRS3, CCRS2 /3}


set{CRS4, weekly rsi(4),1)}
set{CRS5, weekly rsi(9),1)}
set{CRS6, weekly rsi(30),1)}

set{WCRS1, CRS4 + CRS5}
set{WCRS2, WCRS1 + CRS6}
set{WCRS3, WCRS2 /3}

set{CWRSI1, CCRS3 + WCRS3}
set{C-RSI, CWRSI1 /2}
set{RSI30, RSI(30) - 50}
set{CRSI_Bar, RSI30}
draw CRSI_Bar
PlotType{CRSI_Bar,zerobar}
set{RSI9, RSI(9) - 50}
set{RSI9_line, RSI9}
draw RSI9 on plot CRSI_Bar
set{RSI4, RSI(4) - 50}
set{RSI4_line, RSI4}
draw RSI4 on plot CRSI_Bar

set{drsilong1, count(rsi(30) above 5, 1)}
set{drsilong2, count(rsi(4) above rsi(30), 1)}
set{drsilong3, count(rsi(9) above rsi(30), 1)}
set{drsilong4, drsilong1 + drsilong2}
set{drsilong5, drsilong4 + drsilong3}
set{drsilong, count(drsilong5 equals 3, 1)}
set{drsishort, count(drsilong5 less than 3, 1)}
SET{DRSITRIGGER,0}
draw drsilong on plot trigger
draw drsishort on plot trigger
set{IFT_Bar,IFT(4,1)}
draw IFT_Bar
PlotType{IFT_Bar,zerobar}
DRAW IFT(4,1)
DRAW IFT(4,1) LINE AT .50
DRAW IFT(4,1) LINE AT -.50
DRAW IFT(4,1) LINE AT 0
draw weekly TSI(5,5,9)
set{wrsi1, weekly rsi(4)}
set{wrsi2, weekly rsi(30)}
set{wrsi3, count(wrsi1 > wrsi2,1)}
set{wrsilong, count(wrsi3 equals 1, 1)}
set{wrsishort, count(wrsi3 less than 1, 1)}
SET{wrsitrigger,0}
draw wrsilong on plot trigger
draw wrsishort on plot trigger

set{WRSI30, weekly RSI(30) - 50}
set{WRSI_Bar, WRSI30}
draw WRSI_Bar
PlotType{WRSI_Bar,zerobar}
set{WRSI9, Weekly RSI(9) - 50}
set{WRSI9_line, WRSI9}
draw WRSI9 on plot WRSI_Bar
set{WRSI4, Weekly RSI(4) - 50}
set{WRSI4_line, WRSI4}
draw WRSI4 on plot WRSI_Bar
and draw weekly Slow Stochastic(14,3) Fast %K line at 20.00 and draw weekly Slow Stochastic(14,3) Fast %K line at 80.00 and draw weekly Slow Stochastic(14,3) Fast %K line at 50.00
and draw weekly Slow Stochastic(5,1) Fast %K line at 20.00 and draw weekly Slow Stochastic(5,1) Fast %K line at 80.00 and draw weekly Slow Stochastic(5,1) Fast %K line at 50.00
set{CRS21, ROC(21,1)}
set{CRS63, ROC(63,1)}
set{CRS126, ROC(126,1)}
set{CR1, CRS21 + CRS63}
set{C-RS, CR1 + CRS126}

set{wsto, weekly Slow Stochastics(14,3)}
set{dsto, Slow Stochastics(14,3)}
set{wdsto, wsto + dsto}
set{CSTO, wdsto / 2}
set{TWRSI4, weekly RSI(4)}
set{TWRSI9, weekly RSI(9)}
set{TWRSI30, weekly RSI(30)}
set{TWRSI1, TWRSI4 + TWRSI9}
set{TWRSI2, TWRSI1 + TWRSI30}
set{A-WRSI, TWRSI2 / 3}

set{TDRSI4, RSI(4)}
set{TDRSI9, RSI(9)}
set{TDRSI30, RSI(30)}
set{TDRSI1, TDRSI4 + TDRSI9}
set{TDRSI2, TDRSI1 + TDRSI30}
set{A-DRSI, TDRSI2 / 3}

set{WIFT_Bar,weekly IFT(4,1)}
draw WIFT_Bar
PlotType{WIFT_Bar,zerobar}

DRAW weekly IFT(4,1)
DRAW weekly IFT(4,1) LINE AT .50
DRAW weekly IFT(4,1) LINE AT -.50
DRAW weekly IFT(4,1) LINE AT 0

draw Bollinger Bands(18,2)
set{E10, close above Upper Bollinger Bands(18,2)}
set{BBLongposition, count(E10 > 0,1)}
set{BBShortposition, count(E10 < 0,1)}
SET{BBTRIGGER,0}

set{var,ind(^vix,close)}
set{var10,ind(^vxv,close)}
set{ratio,var/var10}

ADD COLUMN SEPARATOR
ADD COLUMN RANK {Rank}
ADD COLUMN SEPARATOR
add column Sharpe Ratio(10) {Sharpe}
add column separator
add column allocation {Alloc %}
add column separator
add column vstop
add column separator
add column Vlongposition {VBuy}
add column separator
add column BBLongposition{BBSell}
add column separator
add column DLongposition {MA84}
add column separator
add column TDLongposition{DTSI}
add column separator
add column drsilong {DRSI}
add column separator
add column wrsilong {WRSI}
add column separator
ADD COLUMN ROC(105,1) {5 mth %}
add column separator
ADD COLUMN ROC(63,1) {3 mth %}
add column separator
ADD COLUMN ROC(21,1) {1 mth %}
add column separator
add column C-RS
add column separator
add column Upper Bollinger Bands(18.2) {Up-BB}
add column separator
add column lower Bollinger Bands(18.2) {Low-BB}
ADD COLUMN SEPARATOR
add column weekly Slow Stochastics(14,3){wSto}
ADD COLUMN SEPARATOR
add column Slow Stochastics(14,3){dSto}
ADD COLUMN SEPARATOR
add column csto
ADD COLUMN SEPARATOR
add column A-WRSI
ADD COLUMN SEPARATOR
add column A-DRSI
ADD COLUMN SEPARATOR
add column c-rsi
ADD COLUMN SEPARATOR
add column IFT(4,1) {dift}
add column separator
add column weekly IFT(4,1) {wift}
add column separator

add column rsi(4){drsi4}
add column separator
add column rsi(9){drsi9}
add column separator
add column rsi(30){drsi30}
add column separator
add column RSI(2)
add column separator
add column ratio
add column separator
draw ma(3)
draw ma(18)
draw ma(84)



do not draw MACD(12,26)
do not drawn line 0
do not draw MA(250)
do not draw MA(50)
do not draw EMA(250)

SORT COLUMN 6 ASCENDING
chart-time is 75 days

]



StockFetcher Forums · Filter Exchange · IWP IWS TLT 1X Filter<< >>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.