I took another look at the code above and noticed that daily data is enough to test it, so I quickly coded it up along with the edge test and ran it on SP futures continuous contract data.
I've got the following edge test results:
1983 15%
1984 97%
1985 96%
1986 64%
1987 64%
1988 68%
1989 62%
1990 78%
1991 77%
1992 61%
1993 86%
1994 91%
1995 14%
1996 37%
1997 81%
1998 64%
1999 87%
2000 95%
2001 95%
2002 83%
2003 42%
2004 57%
2005 28%
2006 79%
2007 71%
2008 57%
2009 43%
2010 52%
2011 73%
2012 78%
2013 24%
2014 38%
2015 55%
2016 40%
2017 27%
2018 57%
2019 76%
2020 45%
Please note that the code was posted by acrary on May 5th 2003 so I am considering everything up to year 2003 as in sample and everything after as out of sample test.
The average edge in the period of 1983-2002 is 70.7% (73.6% if 1983 excluded).
However for the period of 2003-2020 (out of sample) it is just 52.3% meaning the outcome is random.
You could say it is a day trading system and was not meant to work for 18 years. OK, let's just take the first 3 years of out of sample (2003-2005) - 42%, worse than random. 5 years (2003-2007) - 55%, nothing interesting either.
The Sharpe ratio (annualised) for in sample period (1983 March - 2003 April) is 1.19 which is nice.
But in out of sample period (2003 May - 2021 May) it's only 0.62 (for the first 5 years of out of sample it's even worse, ranging from -0.45 to +0.45).
The above results are with no trading costs and slippage included.
I found that for every 0.1 point of cost per trade about 0.07 of Sharpe ratio is lost.
So for example if you estimate your cost as 0.25 points per trade, then you'd lose about 0.175 of Sharpe ratio. On the out of sample period you're left with just 0.45
I also tried the edge test on DAX futures but the results were even worse than on SP (63.7% average in sample, 44.8% average out of sample).
In short, it all points to overfitting.