Hi, Shrewd!        Login  
Shrewd'm.com 
A merry & shrewd investing community
Best Of MI | Best Of | Favourites & Replies | All Boards | Post of the Week! | How To Invest
Search MI
Shrewd'm.com Merry shrewd investors
Best Of MI | Best Of | Favourites & Replies | All Boards | Post of the Week! | How To Invest
Search MI


Investment Strategies / Mechanical Investing
Unthreaded | Threaded | Whole Thread (6) |
Post New
Author: rayvt 🐝  😊 😞
Number: of 5822 
Subject: Overlaps GTR1 backtest is flawed.
Date: 06/16/26 2:40 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
Overlaps GTR1 backtest is flawed.

I believe the "overlaps" backtest as linked in post #5663 is wrong.

The idea is to invest monthly in the stocks that are common between the top 5 picks of two related Nasdaq 100 screens. The screens are "9-month Relative strength" and "price/(52-wk high + 52-wk low)" top 5.
The holding period in all these screens is 20 market days.
There can be anywhere between 0 and 5 stocks in the overlap screen, depending on the stocks in the top 5 of both screens. 0 if no stocks are in common, 5 if the same stocks are in common.

I downloaded the daily screen values and the stocks count and lined up the values with the counts.

The problems are:
1) The number of overlap stocks changes from day to day, even though the picks are made on the first day of the holding period.
2) The portfolio daily values change even when the overlap screen has 0 (zero) stocks.

Ex 1:
Date    Cycle       value     Day return          Date      Count
19851021 0 1.28 -1.47% 19851021 2
19851022 1 1.29 1.04% 19851022 3
19851023 2 1.32 1.73% 19851023 2
19851024 3 1.35 2.34% 19851024 3
19851025 4 1.35 -0.08% 19851025 2
19851028 5 1.33 -1.16% 19851028 2
19851029 6 1.35 1.36% 19851029 2
19851030 7 1.34 -0.53% 19851030 2
19851031 8 1.33 -0.96% 19851031 2
19851101 9 1.35 1.61% 19851101 3
19851104 10 1.34 -0.35% 19851104 3
19851105 11 1.34 -0.18% 19851105 3
19851106 12 1.35 0.25% 19851106 4
19851107 13 1.35 0.00% 19851107 4
19851108 14 1.36 0.99% 19851108 2
19851111 15 1.39 2.40% 19851111 3
19851112 16 1.38 -0.58% 19851112 3
19851113 17 1.35 -2.19% 19851113 3
19851114 18 1.34 -0.88% 19851114 2
19851115 19 1.34 -0.39% 19851115 3

Ex 2:
Date    Cycle       value     Day return          Date      Count     CNT == 0?
20220125 0 47,964.74 -6.22% 20220125 1
20220126 1 47,648.43 -0.66% 20220126 1
20220127 2 47,397.14 -0.53% 20220127 0 zero
20220128 3 49,583.18 4.61% 20220128 0 zero
20220131 4 52,233.15 5.34% 20220131 0 zero
20220201 5 53,101.24 1.66% 20220201 0 zero
20220202 6 54,454.34 2.55% 20220202 0 zero
20220203 7 52,190.98 4.16% 20220203 0 zero
20220204 8 55,236.33 5.84% 20220204 0 zero
20220207 9 53,986.91 -2.26% 20220207 1
20220208 10 55,329.46 2.49% 20220208 1
20220209 11 57,961.86 4.76% 20220209 1

The screen: http://gtr1.net/2013/?~Nas100_Mom9_PHL252_OverlapT...

I am not sure how to fix this overlap backtest. It appears that maybe the stocks in the source screens are not nailed down on the first day of the holding period, but are re-evaluated every day. I am not conversant enough in GTR1 to check or correct this.
Print the post


Author: Aussi   😊 😞
Number: of 5822 
Subject: Re: Overlaps GTR1 backtest is flawed.
Date: 06/16/26 4:09 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 6
RayVt

I think it is working as expected.

If you download the daily values and look at cycle 2 on 20220127 it has a value of 11200.67. For the next 20 days it increases by a few cents each day as the cycle is invested in T-Bills(??? not sure if that is correct but some short term instrument) as the stock total was zero.

On 20220128 cycle 3 goes to cash etc. up to cycle 8. Cycle 9 does not go to cash.

Regarding the number of overlaps changing each day, the overlaps are calculated for the cycle trade day. On 19851024, cycle 3 is calculated and there are 3 overlaps. These stocks are held for 20 days. On 19851025, cycle 4 is calculated and there are 2 overlaps. These are held for the next 20 days in cycle 4.

Aussi
Print the post


Author: rayvt 🐝  😊 😞
Number: of 5822 
Subject: Re: Overlaps GTR1 backtest is flawed.
Date: 06/16/26 6:46 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
I think it is working as expected.
...

Regarding the number of overlaps changing each day, the overlaps are calculated for the cycle trade day. On 19851024, cycle 3 is calculated and there are 3 overlaps. These stocks are held for 20 days. On 19851025, cycle 4 is calculated and there are 2 overlaps. These are held for the next 20 days in cycle 4.


Ah, that could explain it. It's all very confusing.

You've have to look down the 1st column to get a start date & cycle, then across to get the column for that cycle, then go down that column for values for correct 20 days. Or something like that. Ugh. That's starting to sound like work. ;-)

Not sure how confident I am about these backtest results.
31% CAGR is hard to believe. Like, why have none of the big players glommed onto this?

**edit**
Looked at a few Count 0's
A few seemed to be close the the 1-yr Tbill rate for that month.
A few didn't.
Real PITA to do manually, I don't have high confidence in what I did.

To do a good cross-check you'd also need to look at a few of the 5 count months. The gain of each of the three backtests should be the same, as they would all have been invested in the same 5 stocks.
122 0's and 612 5's
Doable, but to do it right you'd need to automate it all in a spreadsheet or two. Maybe if I get bored enough....

I'll have to think about it.
Print the post


Author: lizgdal   😊 😞
Number: of 5822 
Subject: Re: Overlaps GTR1 backtest is flawed.
Date: 06/16/26 7:37 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
The screen in question {Nas100_Mom9_PHL252_OverlapTest} finds the overlap between the 2 screens {Mom9Top5} and {PHL252Top5}. Similar results can be obtained through a single screen that combines the criteria {Mom9Top5_PHL252Top5}. Results from 19850201 to 20251128:

            Screen              CAGR   GSD  MDD  Sharpe
Nas100_Mom9_PHL252_OverlapTest 31.33 48 -76 0.80
Mom9Top5_PHL252Top5 31.29 48 -76 0.80
Mom9Top5 28.07 42 -73 0.79
PHL252Top5 29.53 39 -72 0.86


=== links ===

https://gtr1.net/2013/?~Nas100_Mom9_PHL252_Overlap...

https://gtr1.net/2013/?~Mom9Top5:s19850201e2025112...

https://gtr1.net/2013/?~PHL252Top5:s19850201e20251...

https://gtr1.net/2013/?~Mom9Top5_PHL252Top5:s19850...


=== Command Translation ===
Define {Mom9Top5_PHL252Top5}

Create [Mom9m]: [Total Return Multiplier over 189 days]

Create [PHL252]: [[Closing g-price]/[[Lowest closing g-price over 252 days] + [Highest closing g-price over 252 days]]]

Create [rankMom9]: [Rank by [Mom9m] (Desc) at step2]
Create [rankPHL]: [Rank by [PHL252] (Desc) at step2]

step0: [NASDAQ 100 Member] == 1
step1: [Mkt Days Since Security Opened] >= 252
step2: [rankPHL] <= 5
step3: [rankMom9] <= 5; Cash When None
Print the post


Author: Aussi   😊 😞
Number: of 5822 
Subject: Re: Overlaps GTR1 backtest is flawed.
Date: 06/16/26 7:38 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
In GTR1 for Dummies, it mentions that the backtest results using picktally may not exactly match. So it may be difficult to cross check. The difference mentioned is up to a couple of percent.

For the "t bill" rate, I think it was like overnight or 3 month. You could check the return by putting in a step that never selects a stock and set a short timeframe and see what is the return. Say stock universe {^S5T} and a step tr(1,10) > 1000



Aussi
Print the post


Author: rayvt 🐝  😊 😞
Number: of 5822 
Subject: Re: Overlaps GTR1 backtest is flawed.
Date: 06/17/26 11:07 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
I realize that it was simpler if I preprocessed the GTR1 data.

There were 56 holding period with 0 stocks held.
The gains of those periods ranged from 0.000017 to 0.005907, average 0.002565768
That would be an average annual return of about 4.68%.
Right in the range of 1 year Tbills.

There were 531 holding period with 5 stocks held.
The gains of those periods ranged from -0.411386 to 0.005907, average 0.009678855
That would be an average annual return of about 17.66%.

Number with negative gain: 227. Positive: 304

Average of the positive periods: 0.080548464
That would be an average annual return of about 147.00%.

Average of the negative (loss) periods: -0.085230225

Note: to get the average annual return accurately you'd have to compute the weighted average instead of the simple average. These are the simple average.


The weighted average number of stocks held was 3.2 stocks.

------------------------------------------------------
Compare the common periods where the overlap was 5 stocks, to
the overlap screen and the RS-only version of the overlap screen.
If the supposition is correct, then the holding period return of each such date will be the same, because the same 5 stocks are in each of the three screens.

There were 528 5-stock periods.
The differences ranged from -0.009651000 to 0.000075000, average -0.000166063.

Annualizing to 0.30% average difference.

Conclusion: Overlaps screen as backtested CONFIRMED.

========================================================

Here are the statistics for each of the screens.
Overlap   Avg       Min       Max
CAGR: 31.21 26.84 37.44
TR: 9,233,258 1,638,552 43,318,768
MDD: -75.80 -86.89 -60.25
UI(20): 26.45 21.07 32.21

RS only Avg Min Max
CAGR: 27.47 26.14 29.99
TR: 2,114,014 1,308,032 4,461,812
MDD: -73.07 -81.88 -63.65
UI(20): 24.25 20.19 29.71

HL52 only Avg Min Max
CAGR: 28.80 26.76 31.18
TR: 3,303,037 1,596,815 6,461,678
MDD: -71.93 -84.21 -58.27
UI(20): 21.86 17.68 27.42

The "only" screens were done by changing the overlaps rule from one each to both the same.
Print the post


Post New
Unthreaded | Threaded | Whole Thread (6) |


Announcements
Mechanical Investing FAQ
Contact Shrewd'm
Contact the developer of these message boards.

Best Of MI | Best Of | Favourites & Replies | All Boards | Followed Shrewds