novacane32000 331 posts msg #147925 - Ignore novacane32000 |
5/25/2019 6:29:05 PM
Need help backtesting this filter.
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
Now, where I need help and where all can benefit, is finding a way to automate this backtest so we can try different combinations of the MA. I did it the hard way, I looked at the chart and entered the buy and sell price of every SPY trade in an excel sheet and then had my data.
Does anyone have a better idea?
Here is the filter.
/* code by Kevin_in_GA */
/*TRENDSUM*/
/*1. IS THE MA(3) ABOVE THE MA(6)? +1 FOR YES, -1 FOR NO*/
|
graftonian 1,089 posts msg #147942 - Ignore graftonian |
5/28/2019 8:33:58 AM
By tweaking the parameters for PSAR achieves a very close correlation to the trend filter. Try (0.01, 0.03).
An interesting site for excel nerds:
www.tradinformed.com/2015/01/21/calculate-psar-indicator-revised/
|
novacane32000 331 posts msg #147943 - Ignore novacane32000 |
5/28/2019 9:54:13 AM
Thanks
That is the type of backtesting I want to do. Tweak the parameters to see how they work in different markets but my manual process just takes too long.
Thanks for the link , very helpful.
|
graftonian 1,089 posts msg #148085 - Ignore graftonian |
6/8/2019 3:27:10 PM
Thinking about adding the following to Kevins "supertrend" filter.
/* 8. IS THE VOLUME MORE THAN 25% ABOVE 30 DAY AVG?
/*vol_pct*/
set{vp1, Average Volume(3) - Average Volume(30)}
set{vp2, vp1 / Average Volume(30)}
set{vol_pct, vp2 * 100}
set{var8, count(vol_pct > 25, 1)}
Question: How much of a volume increase would warrant another point in
"trendsum"?
And, since volume increase is a positive in a short situation, how to have a volume increase be a -1 where warranted?
Any other indicators you would like to see added to Kevins work?
Thanx, Graf
|
nibor100 1,044 posts msg #148087 - Ignore nibor100 |
6/8/2019 8:24:52 PM
Perhaps, if you have a way to indicate the Short situation, then using logic in your filter you could either multiply 1 by -1, when the appropriate volume situation is indicated or use Min(1,-1)
Ed S.
|
novacane32000 331 posts msg #148088 - Ignore novacane32000 |
6/8/2019 10:01:08 PM
Thanks, Graf
I added the volume and it did make some small adjustments but what I would really like to see is a modification to eliminate some more of the whiplash.
I realize the tradeoff would be staying in downtrends a bit longer and not catching the rallies quite as soon but I am okay with that as I'm trying to find a filter to help me with my 401K management.
|
shillllihs 6,046 posts msg #148089 - Ignore shillllihs |
6/8/2019 11:03:21 PM
Can somebody alter this where there is a negative tremdsum but a big green volume spike, seems very interesting for a long trend.
|
shillllihs 6,046 posts msg #148093 - Ignore shillllihs modified |
6/9/2019 7:07:49 PM
Yeah the kind of setup like
EXC on December 21, 2018, where that positive volume towers above all while trendsum is below 0.
Show me that filter. Looks golden.
|
roca1018 163 posts msg #148094 - Ignore roca1018 |
6/9/2019 8:31:33 PM
I apologize if I missed something but when does the buy signal get initiated?
Rich
|
Village Elder 231 posts msg #148098 - Ignore Village Elder |
6/10/2019 9:11:47 AM
Looking at this filter I'm not sure if a BUY signal is generated, versus it being an assessment of a direction and strength. I get that each of these filter components is often used as a direction or trending indicator. I'm guessing that the sum of these is designed to provide a broad assessment of the current trend.
One could scale in and out based on signal strength. Backtesting that would be a serious pain, though.
|