StockFetcher Forums · Filter Exchange · Super Trend Filter<< 1 2 >>Post Follow-up
novacane32000
331 posts
msg #148104
Ignore novacane32000
6/10/2019 8:13:48 PM

Yes, it is a pain but I did backtest SPY from June 2016 thru May 2019.

Whenever the trend changed I went long or short the next day at the open.

Long: 31 Wins and 39 losses. As you would suspect, every trade of 5 days or less was a loser of which there were 30. Overall Long trades had a net win .3% /trade.

Short: 14 Wins and 56 Loses. The only winners were trades that trended 7 days or longer with one exception. Overall, Short trades had a net loss .2%/trade.

As it stands, a very slight edge going long unless someone can eliminate the whipsaws.

novacane32000
331 posts
msg #148112
Ignore novacane32000
6/11/2019 1:15:04 PM

Made some tweaks and eliminated a lot of the whipsawing.

Some beautiful curve fitting if I dont say so myself :)

Fetcher[set{var1a, count(ma(3) above ma(6), 1)}
set{var1b, count(ma(3) below ma(6), 1)}
set{var1, var1a - var1b}

/*2. IS THE CLOSE ABOVE THE MA(3)? +1 FOR YES, -1 FOR NO*/
set{var2a, count(close above ma(3), 5)}
set{var2b, count(close below ma(3), 5)}
set{var2, var2a - var2b}

/*3. IS THE CLOSE ABOVE THE MA(6)? +1 FOR YES, -1 FOR NO*/
set{var3a, count(close above ma(6), 1)}
set{var3b, count(close below ma(6), 1)}
set{var3, var3a - var3b}

/*4. IS THE SLOPE OF MA(3) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var4a, count(ma(3) above ma(3) 1 day ago, 1)}
set{var4b, count(ma(3) below ma(3) 1 day ago, 1)}
set{var4, var4a - var4b}

/*5. IS THE SLOPE OF MA(6) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var5a, count(ma(6) above ma(6) 1 day ago, 3)}
set{var5b, count(ma(6) below ma(6) 1 day ago, 3)}
set{var5, var5a - var5b}

/*6. IS THE CLOSE ABOVE THE PARABOLIC SAR? +1 FOR YES, -1 FOR NO*/
set{var6a, count(close above Parabolic SAR(0.02,0.2), 7)}
set{var6b, count(close below Parabolic SAR(0.02,0.2), 7)}
set{var6, var6a - var6b}

/*7. IS THE +DI(14) ABOVE THE -DI(14)? +1 FOR YES, -1 FOR NO*/
set{var7a, count(PDI above MDI, 1)}
set{var7b, count(PDI below MDI, 1)}
set{var7, var7a - var7b}

/*SUMMING THE INDIVIDUAL INDICATORS INTO THE TRENDSUM*/
set{sum1, var1 + var2}
set{sum2, sum1 + var3}
set{sum3, sum2 + var4}
set{sum4, sum3 + var5}
set{sum5, sum4 + var6}
set{trendsum, sum5 + var7}
SYMLIST(SPY)

ADD COLUMN TRENDSUM
DRAW MA(3)
DRAW MA(6)
DRAW PARABOLIC SAR
DRAW TRENDSUM
PLOTTYPE{TRENDSUM, ZEROBAR}
DRAW ADX
]



chi-town
44 posts
msg #148117
Ignore chi-town
6/11/2019 5:09:27 PM

Very Nice!

snappyfrog
721 posts
msg #148118
Ignore snappyfrog
6/11/2019 7:20:38 PM

I believe simple is better. This is not to take away from the work done in this thread, but it seems using one simple oscillator can perform the same swings at tops and bottoms. I have added the following line and see where it crosses the 20 line or slow line for a buy and the 80 line or slow line for a sell at the end of the filter.

draw Stochastic %K(20,20,2)


Fetcher[set{var1a, count(ma(3) above ma(6), 1)}
set{var1b, count(ma(3) below ma(6), 1)}
set{var1, var1a - var1b}

/*2. IS THE CLOSE ABOVE THE MA(3)? +1 FOR YES, -1 FOR NO*/
set{var2a, count(close above ma(3), 5)}
set{var2b, count(close below ma(3), 5)}
set{var2, var2a - var2b}

/*3. IS THE CLOSE ABOVE THE MA(6)? +1 FOR YES, -1 FOR NO*/
set{var3a, count(close above ma(6), 1)}
set{var3b, count(close below ma(6), 1)}
set{var3, var3a - var3b}

/*4. IS THE SLOPE OF MA(3) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var4a, count(ma(3) above ma(3) 1 day ago, 1)}
set{var4b, count(ma(3) below ma(3) 1 day ago, 1)}
set{var4, var4a - var4b}

/*5. IS THE SLOPE OF MA(6) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var5a, count(ma(6) above ma(6) 1 day ago, 3)}
set{var5b, count(ma(6) below ma(6) 1 day ago, 3)}
set{var5, var5a - var5b}

/*6. IS THE CLOSE ABOVE THE PARABOLIC SAR? +1 FOR YES, -1 FOR NO*/
set{var6a, count(close above Parabolic SAR(0.02,0.2), 7)}
set{var6b, count(close below Parabolic SAR(0.02,0.2), 7)}
set{var6, var6a - var6b}

/*7. IS THE +DI(14) ABOVE THE -DI(14)? +1 FOR YES, -1 FOR NO*/
set{var7a, count(PDI above MDI, 1)}
set{var7b, count(PDI below MDI, 1)}
set{var7, var7a - var7b}

/*SUMMING THE INDIVIDUAL INDICATORS INTO THE TRENDSUM*/
set{sum1, var1 + var2}
set{sum2, sum1 + var3}
set{sum3, sum2 + var4}
set{sum4, sum3 + var5}
set{sum5, sum4 + var6}
set{trendsum, sum5 + var7}
SYMLIST(SPY)

ADD COLUMN TRENDSUM
DRAW MA(3)
DRAW MA(6)
DRAW PARABOLIC SAR
DRAW TRENDSUM
PLOTTYPE{TRENDSUM, ZEROBAR}
draw Stochastic %K(20,20,2)
]



nibor100
1,031 posts
msg #148148
Ignore nibor100
6/14/2019 3:36:30 PM

@novacane32000,

1. Regarding the excerpts below from 2 of your prior posts in this thread, could you clarify:

a. Did you run 2 separate backtests using the same set of signals on SPY based on the very 1st filter you posted?

b. Are these 2 backtest results based on 2 different versions of your/Kevin's filter?

c. Why is one traded on day of signal and the other on the Open the day after the signal?

2. Regarding 401K mgmt, are you limited by how frequently you can move in and out of stocks/funds? If so, you might want to try filters that trigger signals with that same order of frequency, weekly, monthly, quarterly, etc.

Thanks,
Ed S.



"I dug up this filter from Kevin and then manually backtested it on excel going long or short on every trend change the same day it occurs for the sake of ease on the backtest.

Trading SPY
From June 2016 to the present day your account would have grown 20.2% taking all the long trades and exciting when the trend changed on 70 trend changes. Short trades lost 13.6% also on about 70 trades. This makes sense since the market trended up during this time.

From the last qtr of 2017 to present day the filter actually beats the market going long and also makes a profit going short. Prior to that, it underperformed"

"Yes, it is a pain but I did backtest SPY from June 2016 thru May 2019.

Whenever the trend changed I went long or short the next day at the open.

Long: 31 Wins and 39 losses. As you would suspect, every trade of 5 days or less was a loser of which there were 30. Overall Long trades had a net win .3% /trade.

Short: 14 Wins and 56 Loses. The only winners were trades that trended 7 days or longer with one exception. Overall, Short trades had a net loss .2%/trade."


shillllihs
6,044 posts
msg #148151
Ignore shillllihs
6/14/2019 3:53:56 PM

No surprises here, this guys systems all turned out to be losers. I think you guys are in love with the concept but the results blow.

novacane32000
331 posts
msg #148158
Ignore novacane32000
modified
6/14/2019 10:46:53 PM

Let me clarify.
Both backtest I mentioned are actually the same backtest and are from the first filter I posted which is the Kevin original.

The stats are correct in both mentions but the signal was taken at the close on the day of the trend change and not the open of the next day as previously mentioned. Apologies for the confusion there.

The 2nd filter I posted was tweaked by me and I did not discuss results but here they are.
It is a little slower with the trend change so instead of 70 trend changes, you only have 32 trend changes over a 3 year period.
The 2nd filter also performed better (long) over the entire 3 years but it did so because of the smooth uptrend in SPY from mid-2016 thru the start of 2018 which helped the results.

The 1st filter performed very well in 2018 when the market zigged and zagged more.

Thanks for asking @nibor100 as you made me look a little deeper at my results.

Conclusion:

The 1st filter works well in a range bound market and actually works great going both long and short in 2018. It does not perform very well with the market trending.

The 2nd filter works well in a trending market but is too slow in a range bound market resulting in too many whipsaws.

As many on here have figured out by now, there is no holy grail filter but there are certain filters that work very well during certain market conditions.



nibor100
1,031 posts
msg #148166
Ignore nibor100
6/16/2019 2:39:02 AM

@novacane32000.

1. Thanks for the clarifications.

2. In the filter posted below, I separated out your individual signals that make up the final TrendSum from your 1st filter using ADX's of different signal lengths, to get an idea of how fast the long signals were changing for each one. I thought it might tweak some ideas for additional analysis.

3. Then I chose your variable "6a, count(close above Parabolic SAR(0.02,0.2), 1)" to run my own long backtest on the SPY from 7/1/16 to this past Friday, buying and selling on the close, as you did in your backtests.

a. There were 31 Long signals/trades, of which 6 were losers, largest loser being -1.36%, and 25 winners largest being +9.02%. Appears to be about 81% win rate.

b. Starting with $1,000 it would grow to $1,691 for about a 69% compounded return over that 3 year period just using that particular Parabolic SAR indicator.

Seems to have some lower risk profit potential,
Ed S.

Fetcher[
set{var1a, count(ma(3) above ma(6), 1)}
set{var1b, count(ma(3) below ma(6), 1)}
set{var1, var1a - var1b}

/*2. IS THE CLOSE ABOVE THE MA(3)? +1 FOR YES, -1 FOR NO*/
set{var2a, count(close above ma(3), 1)}
set{var2b, count(close below ma(3), 1)}
set{var2, var2a - var2b}

/*3. IS THE CLOSE ABOVE THE MA(6)? +1 FOR YES, -1 FOR NO*/
set{var3a, count(close above ma(6), 1)}
set{var3b, count(close below ma(6), 1)}
set{var3, var3a - var3b}

/*4. IS THE SLOPE OF MA(3) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var4a, count(ma(3) above ma(3) 1 day ago, 1)}
set{var4b, count(ma(3) below ma(3) 1 day ago, 1)}
set{var4, var4a - var4b}

/*5. IS THE SLOPE OF MA(6) POSITIVE? +1 FOR YES, -1 FOR NO*/
set{var5a, count(ma(6) above ma(6) 1 day ago, 1)}
set{var5b, count(ma(6) below ma(6) 1 day ago, 1)}
set{var5, var5a - var5b}

/*6. IS THE CLOSE ABOVE THE PARABOLIC SAR? +1 FOR YES, -1 FOR NO*/
set{var6a, count(close above Parabolic SAR(0.02,0.2), 1)}
set{var6b, count(close below Parabolic SAR(0.02,0.2), 1)}
set{var6, var6a - var6b}

/*7. IS THE +DI(14) ABOVE THE -DI(14)? +1 FOR YES, -1 FOR NO*/
set{var7a, count(PDI above MDI, 1)}
set{var7b, count(PDI below MDI, 1)}
set{var7, var7a - var7b}

/*SUMMING THE INDIVIDUAL INDICATORS INTO THE TRENDSUM*/
set{sum1, var1 + var2}
set{sum2, sum1 + var3}
set{sum3, sum2 + var4}
set{sum4, sum3 + var5}
set{sum5, sum4 + var6}
set{trendsum, sum5 + var7}
SYMLIST(SPY)

ADD COLUMN TRENDSUM
DRAW MA(3) DRAW var4a DRAW var4b DRAW var2a DRAW var2b DRAW var1a DRAW var1b DRAW ADX(3,3) DRAW var3a DRAW var3b DRAW var5a
DRAW MA(6) DRAW var5b DRAW ADX(6,6) DRAW var6a DRAW var6b DRAW ADX DRAW PARABOLIC SAR DRAW var7a DRAW var7b

DRAW TRENDSUM
PLOTTYPE{TRENDSUM, ZEROBAR}
]



novacane32000
331 posts
msg #148175
Ignore novacane32000
6/16/2019 8:35:15 PM

@nibor100

I ran your filter using var6a as the trend change signal. To avoid anticipating a signal as the market winds down for the day, I waited until the end of day signal was confirmed and then bought or sold at the open of the following day.

Results are still good but you basically enter a day late and exit a day late every trade. More of a real-life scenario for the working man that may have a hard time committing to watching every market close near 4pm.

Here are my results with first trade on 7/5/16 and last trade closing on 5/24/19

Compound Return = 31.6%
SPY return during same time period = 36.4 %

Great returns when you consider most do not beat the market anyways.

I can see this filter as a legit market indicator. Will have to monitor going forward.

Thanks for the input Ed.

StockFetcher Forums · Filter Exchange · Super Trend Filter<< 1 2 >>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.