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


Halls of Shrewd'm / Atheist Shrewds
Unthreaded | Threaded | Whole Thread (40) |
Post New
Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 836 
Subject: My new Program
Date: 01/20/26 5:04 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 13
According to my new program to produce the BCC signals, NHNL went negative today setting the BCC signal to 5. It is going to be interesting to see how it predicts in the future.

Larry
Print the post


Author: mungofitch 🐝🐝 SILVER
SHREWD
  😊 😞

Number: of 19827 
Subject: Re: My new Program
Date: 01/21/26 6:58 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 10
Do you use any smoothing? It looks to have been pretty strongly positive for all but one of the last 11-or-so days, depending on your data source of course, and yesterday wasn't strongly negative. I can't imagine what smoothing would have that negative now?

My reading of current market conditions is "Sane people should be scared witless about tail risks and valuations, but it still seems to be an ongoing bull, so it's likely we'll see the always-buy-on-dips crowd active for some time yet"

Jim
Print the post


Author: elann 🐝 GOLD
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/21/26 3:41 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 6
According to my new program to produce the BCC signals, NHNL went negative today setting the BCC signal to 5. It is going to be interesting to see how it predicts in the future.

That's strange. MY NHNL read looks quite strongly positive.

https://stockcharts.com/sc3/ui/?s=%24NAHL&p=d&yr=0...

Elan
Print the post


Author: Baltassar   😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/21/26 4:37 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
That's strange. MY NHNL read looks quite strongly positive.

Barcharts, using the 9 day WMA, is also firmly positive:

https://tinyurl.com/2z8fvspe

NHNL can vary a lot based on how it (and where) is calculated.

I see that you prefer 13d to 9d. Was that based on a back-tested result?

Baltassar
Print the post


Author: elann 🐝 GOLD
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/21/26 6:16 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
I see that you prefer 13d to 9d. Was that based on a back-tested result?

It's the mungofitch way.

Elan
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/21/26 7:12 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 6
Elan,

My attempt at getting BCC signals is based on SPY and on the 20th there were 816 new highs and 2150 new lows according to BarChart. Your numbers are from the NASDAQ. Quite a difference. Robbie's URL which gets the signals from GTR1 indicates it is based on SPY. I am a novice when it comes to the Stock Market and I am open to suggestions for how to approach this problem. My strength (what little there is) is in the "scraping" of web pages and the programming. I need someone who really knows the market to lay out methods and free sources of information so that I get on the best track.

Jim,

I recognize a need for soothing in what I am trying to do with NH-NL but I need suggestions on how to approach it. I guess it is smoothing that Robbie does with the simple moving average when he calculate the SMAdiff as the difference between today's SMA and the SMA from ten days ago. Would something like that work?

Larry

Print the post


Author: FlyingCircus   😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/21/26 8:54 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 6
The raw daily number dropped to -25 yesterday (1/20), and is back to 203 today, but that is not the basis for the signal. The basis is supposed to be the EMA(9) of the daily number - which is currently 157.2.

FC
Print the post


Author: zeelotes 🐝🐝  😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 12:10 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 13
The #2 bear catcher was first shared on the MI Board by myself. It is based on the Nasdaq and not the S&UP 500 or SPY. It uses a 9-Day Weighted Moving Average (WMA). The thresholds for turning to bearish or back to bullish are not a fixed zero per my own backtests of what is optimal. I suggest anyone using it to do the same sort of testing to arrive at what they consider optimal.

The reason the Nasdaq Composite is used is because of its propensity to lead when drawdowns commence.
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 2:57 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
zeelottes,

When you say the "2nd bear catcher" are you referring to part that Robbie calls the SMA or the part he call NHNL? I think of the SMA as the first part of the BCC signal, NHNL as the second part and DBE as the third part. Also when you say "9-Day Weighted Moving Average (WMA)" are you referring to the what Flying Circus called the EMA(9)? The appear to be different calculations but both have to do with moving averages (as in the first bear catcher). As far as your use of the Nasdaq, I am certainly early enough in my thinking to is use instead of SPY.

For what it is worth, I am attaching so thinking I have done on Robbies work. Any suggestions you may have will helpful.

Larry

Attached:
Robbie starts with this user defined universe:
https://gtr1.net/2013/?~gSPY:lf-1lp-1h1::pref(sp500.a,sp90.a)et1:rank(class.a,permco.a,step1)et1:MktCapWt:gt0:MktCapWt:product(aprc,ifet(styp.a,30!31,sho.a,cso.a)):wtf:MktCapWt
When run in the screener this URL produces a list of 501 stocks as of 1/22/26

He then uses that universe to create the BCC signal URL:
http://gtr1.net/2013/?lf-1lp-1h1::BCC:gt0:SMADiff:...

This URL defines three variables SMAdiff, NHNLdiff, and DBE which are used to calculate the BCC.
Each of the three SMAdiff, NHNLdiff, and DBE can have only values of 0 or 1 and when combined as as a binary number BCC only has values 0 through 7.

SMAdiff is defined by the import: lf-1lp-1h1::SMADiff:gt0:SMADiff:linear(1,sma(1,200),-1,sma(11,200))
My interpretation of this is that if today's SMA(200) (200 day simple moving average) is greater than or equal to the SMA(200) of the one 10 days ago then the SMA signal will be a 1 else it will be a zero.

NHNLdiff is defined by the import: lf-1lp-1h1::iflt(linear(1,ord(1),-1,date2ord(19731217)),0,3,excd.a)et3:styp.a:et10!11!18!48:dspo(1)al252:rank(class.a,permco.a,step3)et1:NHNLDiff:et-999999:StockCount:sum(1,1,step4):PcntNHC252:linear(100,ratio(sum(ifgt(ratio(gprc(1),hgprc(2,251)),1,1,0),1,step4),StockCount)):PcntNLC252:linear(100,ratio(sum(iflt(ratio(gprc(1),lgprc(2,251)),1,1,0),1,step4),StockCount)):PcntNHC252WMA9:ratio(sgwsum(PcntNHC252,0,9,8,7,6,5,4,3,2,1),sgwsum(linear(1,1),0,9,8,7,6,5,4,3,2,1)):PcntNLC252WMA9:ratio(sgwsum(PcntNLC252,0,9,8,7,6,5,4,3,2,1),sgwsum(linear(1,1),0,9,8,7,6,5,4,3,2,1)):NHNLDiff:linear(1,PcntNHC252WMA9,-1,PcntNLC252WMA9)
I don't know how to interpret this. My gut feeling is that NHNL is 1 or 0 depending on whether the number stocks making new highs in this past year is greater (1) or less than the number of stocks making new lows this past year (0). His actual work appears to use ratios and percents however to accomplish some kind of smoothing. Would this seem possible for some simple smoothing - If an existing NH>NL (1) exists, then it does not change to a 0 until a fixed number of NH<NLs have happened and vice versa. (How many days?)

DBE is defined by the import: lf-1lp-1h1::DBE:et1:DBE:sgmax(ifgt(ratio(gprc(1),hgprc(2,98)),1,1,0),0,99)
Here my interpretation is that the DBE does not flip from 1 to 0 as long as within the last 99 days the NHNLdiff has been 0 the whole time.
Print the post


Author: RAMc   😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 4:10 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 6
From Archive of Robbie’s old notes dated 11/1/2012;
Counting Nasdaq New Highs and New Lows

The above description of the imports and importf functions isn`t likely to be understood on first reading by anyone, so here I will start a detailed example of the construction of a market timing signal and its use in a backtest.

First, here is a screen that picks Nasdaq stocks that are at new highs:

http://backtest.org/gtr1/2011/?dspo:al252:excd.a:e...:...
Translation:
step0: [mkt Days Since security Opened for purchase] >= 252
step1: [Exchange Code; lag=1 days] == 3
step2: [Security Type; lag=1 days] == 10,11
step3: [[g-price; quote_lag=0 days]/[High g-price over 251 days; lag=1 days]] > 1; Long, Cash When None

Step 0 keeps only stocks with at least 252 market days of pricing history within the GTR1 universe.
Step 1 keeps only Nasdaq stocks.
Step 2 keeps only US corporations (i.e., it excludes all ADRs, companies incorporated outside the US, unit trusts, closed-end funds, REITs and ETFs).
Step 3 keeps only stocks that are at a new 252-day high. I.e., it ensures that current g-price (gprc(0)) is greater than the highest g-price over the previous 251 market dates (hgprc(1,251)).

The screen that picks Nasdaq stocks at new lows is very similar:

http://backtest.org/gtr1/2011/?dspo:al252:excd.a:e...:...
Translation:
step0: [mkt Days Since security Opened for purchase] >= 252
step1: [Exchange Code; lag=1 days] == 3
step2: [Security Type; lag=1 days] == 10,11
step3: [[g-price; quote_lag=0 days]/[Low g-price over 251 days; lag=1 days]] < 1; Long, Cash When None

These two backtests are nothing new with this update, and anyone could have constructed Nasdaq NH-NL signals by running these two backtests in counting mode and downloading the spreadsheets with daily statistics. What is new is that the backtester now allows you to build the signal within a backtest and use it with any screen.

The next step is to generate counts of these new highs and new lows as fields. This is done as follows:

(0) http://backtest.org/gtr1/2011/?dspo:al252:excd.a:e...:...
Translation:
Create [CountOfHighs]: [# Eligible at step4]
step0: [mkt Days Since security Opened for purchase] >= 252
step1: [Exchange Code; lag=1 days] == 3
step2: [Security Type; lag=1 days] == 10,11
step3: [[g-price; quote_lag=0 days]/[High g-price over 251 days; lag=1 days]] > 1
step4: [CountOfHighs] == -1; Long, Cash When None

Here I have created a field labeled "CountOfHighs" using the field function sum. This field consists of the summation of the number 1 among all stocks eligible for step 4, i.e., all stocks passing step 3, which is simply a count of the number of stocks passing step 3, i.e., those at new highs. Since every field defined must be used in some step, I have also added step 4 that uses this new field, [CountOfHighs]. Since it doesn`t matter what this step is for our purposes (we don`t actually care about this backtest--we are simply using it to create a field we are going to import into another backtest), I have made it a step that is guaranteed to not select any stocks in order to improve execution speed and save Jamie some electricity.

Likewise, the screen that counts the number of stocks at new lows is as follows:

(1) http://backtest.org/gtr1/2011/?dspo:al252:excd.a:e...:...
Translation:
Create [CountOfLows]: [# Eligible at step4]
step0: [mkt Days Since security Opened for purchase] >= 252
step1: [Exchange Code; lag=1 days] == 3
step2: [Security Type; lag=1 days] == 10,11
step3: [[g-price; quote_lag=0 days]/[Low g-price over 251 days; lag=1 days]] < 1
step4: [CountOfLows] == -1; Long, Cash When None

Note that for both of these screens, the holding period is irrelevant for the purpose here, so I have left both at the default value of 20.


Creating a Nasdaq NH-NL Signal

The next step is to bring the count of new highs and the count of new lows together in one backtest so that a Nasdaq NH-NL signal can be created. An example of such a backtest is the following:

http://backtest.org/gtr1/2011/?NHNLDiff:gt0:aprc:t......

To construct this backtest, I have started with a blank form at backtest.org/gtr1/2011. I have copied the "count of highs" URL from above (labeled (0)) and pasted it in the box for screen reference 0. I have copied the "count of lows" URL from above (labeled (1)) and pasted it in the box for screen reference 1. I have then defined two labeled fields, "CountOfHighs" and "CountOfLows", where the first imports the field labeled "CountOfHighs" from screen 0 and the second imports the field labeled "CountOfLows" from screen 1.

I should point out that while I have labeled my imported fields with the same labels used in the screens I`ve imported them from, this is completely unnecessary. I could just as easily have labeled the expression "imports(0,CountOfHighs,0,0)" as "CountHighs" or anything else, or not labeled it at all and used it directly within a step.

It`s critical to note that I have used the field function imports, not importf, to import the count of highs and count of lows, thereby ensuring that the counts are imported for every single stock in the GTR1 universe. If I had used the field function importf instead, only the same stocks that passed the step in the source screen where the counts were made would have counts imported; all other stocks would be assigned default values of 0 by the import. For market timing signals, we want the field populated with the same value for all stocks.

The first step of this screen (step 0) allows stocks to pass only if [CountOfHighs] is greater than [CountOfLows]. Since these fields have the same values for all stocks, either all stocks will pass step 0, or none will, which is what we want from a market timing signal.

The second (and final) step of this screen (step 1) takes the top 10 stocks by aprc (actual price). The holding period is 20 market days. (The holding periods of the source screens are usually irrelevant, and can therefore differ from the holding period of the importing screen. There are exceptions, such as if the field function dsp is used in the source screen.)

In other words, the backtest simulates a trading strategy that involves portfolio updates every 20 market days. If the count of Nasdaq stocks at new highs is greater than the count of Nasdaq stocks at new lows, then the portfolio is filled with the 10 highest-priced stocks in equal dollar value and held for 20 market days; otherwise, any stocks already held are sold and the portfolio consists of cash for the next 20 market days.

The version of the Nasdaq NH-NL signal I have constructed is far from optimal, and using it every 20 market days is even less optimal. However, using the signal in this fashion does improve results, depending on one`s assumptions about trading costs. Without the signal, the backtest results for this screen (which I call "Buffet and Friends"),

http://backtest.org/gtr1/2011/?aprc:tn10

are an average CAGR of 12.9, an average GSD(20) of 18.3 and an average maximum drawdown of -58%. With the signal, the results are improved to an average CAGR of 14.2, an average GSD(20) of 12.5 and an average maximum drawdown of -23%. The only metric not improved is annual turnover, which rises from about 1.4 to 2.3.


A Smoother NHNL Signal

I`ve barely begun using these new functions myself, so I have no idea what the best signals based on new highs and new lows might look like, but here I present a signal along the same lines that improves results, but more importantly for this post, demonstrates the capabilities of the GTR1 backtester for exploring new signals.

Anyone developing a market timing signal will be looking for ways to reduce whipsaws, or smoothen out the signal. One way to do that is to use weighted moving averages of a base signal. Once a base signal has been constructed, it can be imported with varying values specified by lag_days to get the base signal`s values over an interval, which can then be averaged or summed. I use this technique in the construction of this signal:

(3) http://backtest.org/gtr1/2011/?NHNLRatio:et-1:Weig......

In this screen, I make repeated use of the same [CountOfHighs] and [CountOfLows] fields constructed previously, importing them with different lags. The URLs for their source screens are in the Screen References form next to "0" and "1", respectively.

I have used the field function linear to create a weighted sum, labeled [WeightedCountOfHighs], of the number of new highs over the nine market dates through the present. The current market date is given a weight of 9, the previous market date is given a weight of 8, and so on, down to a weight of 1 for the CountOfHighs with a lag of eight market days. I have likewise created a weighted moving sum of [WeightedCountOfLows] over the same nine market days.

Instead of calculating a difference, I have calculated a ratio in the field labeled [NHNLRatio], which consists of [WeightedCountOfHighs] divided by [WeightedCountOfLows]. Division by zero is not a concern, because while [CountOfLows] is sometimes zero, it has never been zero nine market days in a row, so [WeightedCountOfLows] is never zero.

Note that this screen only has one step, which requires that [NHNLRatio] equal -1. This never happens, so the screen never picks any stocks (the results you seen when you click "Run Backtest" are for a cash-only portfolio). The screen itself is irrelevant--we are only interested in importing [NHNLRatio] from it to be used in other backtests. As before, I have therefore used a step that ensures that no stocks are selected in order to speed up execution time.

If you wish to see the daily signals that this screen produces, simply change the first step to something like NHNLRatio > 1, run the backtest in counting mode and download the spreadsheet, which will show when stocks pass this step (either all stocks will pass it, or none will).


Improving a Simple WER Screen

I`ve chosen a WER screen to demonstrate the benefits of this signal because so far I`m finding that technically-based screens with high turnover (such as the weekly WER list) have the most to gain from Nasdaq NHNL market timing. The WER screen I`m testing is as follows:

http://backtest.org/gtr1/2011/?pe.w:gt0:pe.w:bn10
Translation:
step0: [WER P/E; lag=1 days] > 0
step1: [WER P/E; lag=1 days] Bottom param0; Long, Cash When Fewer
Holding period = 20 mkt days; Fully rebalance every 1 periods

19920103-20121031
Avg Min Max SD
CAGR: 29.78 25.33 35.23 2.73
TR: 24341.04 10707.84 52260.16 11000.98
GSD(20): 30.51 29.16 33.21 0.96
DD(20): 17.89 16.88 19.54 0.77
MDD: -54.92 -63.97 -40.89 5.80
UI(20): 15.84 11.16 22.23 3.21
Sharpe(20): 1.01 0.88 1.16 0.08
Beta(20): 0.98 0.93 1.05 0.03
TI(20): 27.38 23.75 31.68 2.34
AT: 7.41 7.21 7.59 0.12

To add my smoothed NHNL market timing signal to this screen, I start at the above link, switch to "Free-Form" and insert the step "NHNLRatio > 1" at the top (for step 0). I then copy and paste the URL for my smoothed NHNL signal (labeled (3) above) into the box for Screen Reference 0. I must also add a labeled field expression, "NHNLRatio: imports(0,NHNLRatio,0,0)". To get maximum benefit from the signal (i.e., enable the screen to respond to a signal change on any market day), I set the holding period to 1 market day. Finally, to cut down on turnover (both from frequent signal changes and from weekly changes in screen picks), I set the rebalancing frequency to every 20 market days and add an HTD condition that causes a stock to be held if the NHNLRatio is still greater than 0.9 and the stock has been held for less than 20 market days. The result of these changes is this:

http://backtest.org/gtr1/2011/?h1r20::NHNLRatio:gt......
Translation:
step0: [NHNLRatio] > 1
step1: [WER P/E; lag=1 days] > 0
step2: [WER P/E; lag=1 days] Bottom 10; Long, Cash When Fewer
Hold long while [[NHNLRatio] > 0.9 ? [[mkt Days Since Purchase] < 20 ? 1 : 0] : 0] > 0
Holding period = 1 mkt days; Fully rebalance every 20 periods

19920103-20121031
Avg Min Max SD
CAGR: 33.47 33.47 33.47 0.00
TR: 39793.17 39793.17 39793.17 0.00
GSD(20): 22.90 22.90 22.90 0.00
DD(20): 9.77 9.77 9.77 0.00
MDD: -25.26 -25.26 -25.26 0.00
UI(20): 5.19 5.19 5.19 0.00
Sharpe(20): 1.31 1.31 1.31 0.00
Beta(20): 0.51 0.51 0.51 0.00
TI(20): 56.28 56.28 56.28 0.00
AT: 7.94 7.94 7.94 0.00

The results speak for themselves. With only slightly greater annual turnover (7.94 versus 7.41), Sharpe ratio is raised from 1.01 to 1.31, and every other metric is improved, some quite dramatically (such as maximum drawdown, reduced from -55% to -25%). (Note that the Min and Max are identical, and the Standard Deviation is 0 for each metric because there is only one trading cycle when the holding period is set to 1.)


A Caution about Over-Fitting

One of the GTR1 backtester`s main advantages (and in fact its original reason for existing) is the ability to combat excessive curve-fitting by forcing all screens to make selections on every market day in the backtest (as opposed to once per month or once per week) and averaging results over all trading cycles. If market timing is to be used optimally, the holding period must be set to 1 and HTD conditions must be used to extend the holding period for stocks to reduce turnover. With a holding period of 1 market day, the advantage just mentioned is completely lost, and we are back to the same level of statistical noise that we find in monthly data backtests and the same amount of freedom for curve-fitting. This is unavoidable. Market timing calls for trading on certain days (when there are signal changes), which means any backtest of market timing must throw out a lot of market days where a screen`s selection criteria could otherwise be put to the test.

Thus, be extremely cautious about tuning a market timing signal to specific screens.


Copying and Pasting URLs with Field/Signal Imports

The user interface encodes referenced screens for imports within braces ({ and }). While braces are perfectly legitimate characters in URLs, unfortunately fool.com`s message boards break URLs at the first brace. To get around this problem (which I regard as a bug), I have manually replaced braces in URLs with their ASCII codes (%7b for `{` and %7d for `}`).

Another issue to keep in mind is that URLs with screen references can get very long. That last link I posted above is 1,182 characters long. Internet Explorer cannot handle URLs over 2,000 characters. Firefox has a much higher limit, but Jamie`s server (running Apache) limits URLs to 8,000 characters, though Jamie has told me he can increase that limit if need be.
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 4:57 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
Clicking through to the gtr1 Command Translation is helpful.
[PcntNHC252] is the percent of stocks with a new high price.
[PcntNHC252WMA9] is the weighted average over 9 days (daily weights=9,8,7,6,5,4,3,2,1).

[NHNLDiff] is [PcntNHC252WMA9] minus [PcntNLC252WMA9]

===================
[NHNLDiff] gtr1 Command Translation:

Create [StockCount]: [# Eligible at step4]

Create [PcntNHC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]] > 1 ? 1 : 0] at step4]/[StockCount]]]

Create [PcntNHC252WMA9]: [[Weighted Sum of [PcntNHC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]

Create [PcntNLC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Lowest closing g-price over 251 days; lag=1 days]] < 1 ? 1 : 0] at step4]/[StockCount]]]

Create [PcntNLC252WMA9]: [[Weighted Sum of [PcntNLC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]

Create [NHNLDiff]: [1*[PcntNHC252WMA9] - 1*[PcntNLC252WMA9]]

step0: listed on Nasdaq exchange
step1: oridinary stock or REIT
step2: no IPOs
step3: only one ticker per company

https://gtr1.net/2013/?lf-1lp-1h1::iflt%28linear%2...
Print the post


Author: RAMc   😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 5:00 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 7
Has BCC helped a well-known screen? I believe this is Borris’s version of ROE_Cash with 21 hold 15 till drop 20?
http://gtr1.net/2013/?~ROE_Cash2020_Boris_279314_h...
19870302 to 20251128
CAGR 19.3, Safe Annual Withdrawal 10.9%, MDD -47.8, Ulcer Index 13.6, Annual Turnover 1.4

Same Screen but with BCC = 0
CAGR 19.1, Safe Annual Withdrawal 11.05%, MDD -39.7, Ulcer Index 12.6, Annual Turnover 1.8


http://gtr1.net/2013/?~ROE_Cash2020_Boris_279314_h...

This was put together rather quickly and it only compares one screen. Before making any conclusions check another couple of screens and check to see if I’ve made any mistakes.

I’ve spent a portion of the last 40 years of investing lusting for a market timing signal that will hold up post discovery.




Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 5:13 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
RAMc,

I marvel at how you and some others on this board have the ability to dredge up old information like this. I'm sure I must have read it because I have always read what Robbie writes. I just can't say I often understand it and I have never developed a cataloging system to help remember it. I just hope I can understand it now.

Thanks,

Larry
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 5:33 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
lizgdal,

Clicking through to the gtr1 Command Translation is helpful.

Another great bit of advice. Thanks lizgdal!

Larry
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 6:05 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 9
The adept RAMc wrote: Has BCC helped a well-known screen?

I expect adding BCC to a screen will lower both CAGR and GSD, with high GSD screens showing the biggest change. To test my expectations, I looked at results for 3 screens and 3 indexes. Selling when BCC=0 had these effects:

Risk measures (GSD, LDDD3, MDD, UI) were all improved.
5 out of 6 CAGRs were improved slightly.
SAWR and Sharpe were all improved slightly.
On average, all metrics improved except there was slightly higher turnover (AT).

   Screen     CAGR  SAWR  GSD   LDDD3  MDD   UI   Sharpe  Beta   TI   AT
average 18.8 8.2 26.6 12 -60 15.1 0.65 1.05 16.0 4.0
average_BCC0 19.8 9.6 24.0 10 -48 12.5 0.75 0.81 20.6 4.3


I don't see any relation between a screen's GSD and the change in GSD with BCC timing. The 3 indexes showed the largest changes in GSD, but had lower GSDs than the 3 screens. I will have to review my expectations, but have continued confidence in BCC=0 timing.

        Screen          CAGR  SAWR  GSD   LDDD3  MDD   UI   Sharpe  Beta    TI    AT     From       To
SP500MktCapWeight 10.9 6.6 16.6 10 -54 11.5 0.48 1.00 7.3 0.2 19570301 20251128
SP500EqualWeight 12.0 8.0 19.1 10 -60 10.5 0.50 1.07 8.0 0.3 19570301 20251128
SP1500EqualWeight 12.0 8.4 20.2 10 -60 10.6 0.49 1.10 8.0 0.3 19570301 20251128
Gentle_Screamers 16.4 4.9 28.0 14 -60 21.1 0.62 0.82 18.6 10.5 19870302 20251128
VG_Horse 35.7 10.6 33.7 10 -52 13.3 1.09 0.91 35.2 8.5 19870302 20251128
Nas100Momentum 25.8 10.7 42.1 17 -74 23.8 0.74 1.40 18.7 4.2 19850201 20251128
average 18.8 8.2 26.6 12 -60 15.1 0.65 1.05 16.0 4.0

SP500MktCapWeight_BCC0 12.4 8.5 13.8 7 -34 7.0 0.65 0.72 11.5 0.9 19570301 20251128
SP500EqualWeight_BCC0 13.4 9.9 15.7 7 -39 7.3 0.65 0.77 12.2 0.9 19570301 20251128
SP1500EqualWeight_BCC0 13.3 9.3 16.8 8 -42 8.0 0.62 0.79 12.0 1.0 19570301 20251128
Gentle_Screamers_BCC0 17.4 5.5 26.7 12 -57 18.6 0.68 0.71 22.4 10.2 19870302 20251128
VG_Horse_BCC0 34.6 11.5 31.1 9 -51 12.5 1.11 0.73 42.3 8.3 19870302 20251128
Nas100Momentum_BCC0 27.5 12.8 39.8 14 -66 21.4 0.80 1.17 23.1 4.3 19850201 20251128
average_BCC0 19.8 9.6 24.0 10 -48 12.5 0.75 0.81 20.6 4.3

chg_SP500MktCapWeight 1.5 1.9 -2.8 -3 21 -4.5 0.17 -0.28 4.2 0.7
chg_SP500EqualWeight 1.4 1.8 -3.4 -3 21 -3.2 0.15 -0.30 4.2 0.6
chg_SP1500EqualWeight 1.3 0.9 -3.4 -3 18 -2.7 0.13 -0.31 4.0 0.6
chg_Gentle_Screamers 1.0 0.6 -1.3 -1 3 -2.5 0.05 -0.11 3.8 -0.3
chg_VG_Horse -1.1 0.9 -2.6 -0.4 1 -0.8 0.02 -0.18 7.1 -0.2
chg_Nas100Momentum 1.7 2.0 -2.3 -3 7 -2.4 0.06 -0.23 4.4 0.1
chg_average 1.0 1.3 -2.6 -2 12 -2.7 0.10 -0.24 4.6 0.3

Print the post


Author: RAMc   😊 😞
Number: of 75974 
Subject: Re: My new Program
Date: 01/22/26 9:18 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
Lizgdal; “I will have to review my expectations, but have continued confidence in BCC=0 timing.”

I believe rgearyiii first defined “Bear Catchers Combined (BCC)” in his post “GTR1 and Bear Catchers”
On 9/13/2013: https://yorickm.com/Message.php?pid=30893319

What results do you get post 2013? The problem with that question is we only have 13 relatively good years post discovery with only one short covid bump in the data.

BCC was developed to work for previous Bear markets especially 2008. Any test using data before 2013 is not post discovery. All three seem to likely have some value but I’m one of those old guys that have seen so many market timers do well for a while then fall flat over time. I personally have a little more confidence using a consensus of several systems over on Allocate Smartly. But all their systems have the same problem, they were all developed after all the previous bear markets. None have been tested in the next one.

Print the post


Author: rayvt   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/22/26 10:04 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
10 month (200 day, 43 week) Simple Moving Average of the S&P500 has been backtested to 1950.

As has GTT (Growth and Trend Timing).

If you are trying to find a timing scheme that will work to slide over every little drop, you are doomed to failure. That's why "so many market timers do well for a while then fall flat over time".

Trying to a consensus of several systems is futile. It has the same problem of deciding which of dozens or hundreds of systems to use. You've just traded tde decision of which system to use for the decision of which set of systems to use. It's the same problem, just one step deeper.

You can't make a silk purse out of sow's ears, no matter how many sow's ears you use.


"The moving average timing strategy makes the majority of its money by avoiding large, sustained market downturns. To be able to avoid those downturns, it has to accept a large number of small losses associated with switches that prove to be unnecessary."

"We don't need to be perfect, we only need to be Good Enough."
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/22/26 10:30 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
What results do you get post 2013?

Since 2013, BCC=0 timing was a wash, with not much change in the metrics.

  Screen     CAGR  SAWR  GSD   LDDD3  MDD    UI   Sharpe    From       To
chg_average 1.0 1.3 -2.6 -2.2 11.8 -2.7 0.10 19850201 20251128
chg_average 0.6 0.4 -1.3 -0.7 1.2 -1.5 0.03 20130913 20251128


I attribute this to the absence of a major bear market. BCC timing will be most effective during major bear markets like 2008, 2002, and 1974. But these infrequent events make backtesting difficult. Bear markets since 1950 (gtr1 cycle returns using 25% Peaks and -20% Troughs):

endDate   Drop
20090309 -55
20021009 -47
19741003 -45
20200323 -34
19871204 -33
19700526 -33
19620626 -27
20221012 -24
19661007 -21
19571022 -20


Results from 20130913 to 20251128:

        Screen          CAGR  SAWR  GSD   LDDD3   MDD    UI   Sharpe
SP500MktCapWeight 14.2 11.8 16.5 6.2 -34 5.8 0.85
SP500EqualWeight 11.3 9.4 18.3 6.7 -39 6.0 0.64
SP1500EqualWeight 10.1 8.1 21.9 8.7 -42 7.8 0.51
Gentle_Screamers 0.1 -1.3 27.4 18.2 -60 31.5 0.05
VG_Horse 9.8 6.7 30.5 13.4 -49 18.7 0.41
Nas100Momentum 23.1 11.1 38.3 15.9 -58 23.2 0.75
average 11.4 7.6 25.5 11.5 -47.0 15.5 0.53

Screen CAGR SAWR GSD LDDD3 MDD UI Sharpe
SP500MktCapWeight_BCC0 14.0 11.6 15.3 5.8 -34 5.6 0.89
SP500EqualWeight_BCC0 10.5 8.7 17.0 6.9 -39 6.2 0.62
SP1500EqualWeight_BCC0 9.2 7.4 20.5 8.9 -42 8.1 0.49
Gentle_Screamers_BCC0 2.1 0.7 26.0 16.3 -57 26.7 0.12
VG_Horse_BCC0 11.8 8.0 29.2 12.2 -47 15.8 0.49
Nas100Momentum_BCC0 24.6 11.9 37.1 14.9 -55 21.8 0.80
average_BCC0 12.0 8.1 24.2 10.8 -45.8 14.0 0.57

Screen CAGR SAWR GSD LDDD3 MDD UI Sharpe
chg_SP500MktCapWeight -0.2 -0.2 -1.2 -0.3 0.0 -0.2 0.04
chg_SP500EqualWeight -0.8 -0.7 -1.3 0.1 0.0 0.2 -0.01
chg_SP1500EqualWeight -0.9 -0.7 -1.4 0.1 0.0 0.3 -0.02
chg_Gentle_Screamers 1.9 2.0 -1.4 -2.0 3.0 -4.7 0.08
chg_VG_Horse 2.0 1.3 -1.3 -1.2 1.5 -2.9 0.08
chg_Nas100Momentum 1.4 0.8 -1.2 -1.0 2.7 -1.5 0.05
chg_average 0.6 0.4 -1.3 -0.7 1.2 -1.5 0.03



VG_Horse discovery was 5-May-2013.
Nas100Momentum discovery was either 30-Oct-2019 or 7-Nov-2021.

Author: rgearyiii
Subject: The GTR1 Hacktester
Date: 10/30/2019
"Nas100Momentum, as defined in the sample data, refers to a simple screen that buys the top 5 NASDAQ 100 stocks by one-year total return and holds for 252 market days."
https://yorickm.com/Message.php?pid=34330952

Author: borisnand
Subject: Re: The GTR1 Hacktester
Date: 11/7/2021
"Buy 5 Nasdaq-100 stocks with the highest 1-year total return. Monthly trading improves results significantly in a backtest from 1985 to 2021."
https://yorickm.com/Message.php?pid=34973261

SPY-COMP on AllocateSmartly, Published by Paul on April 25, 2020
"To know when to switch between them, SPY-COMP monitors 6 different economic indicators. When no indicators are signaling recession, the strategy remains long SPY, regardless of what price is telling us. If any one of those indicators is signaling a potential recession then it defers to trend-following to confirm, either going long SPY if the trend in equities is up, or IEF if the trend is down."
https://investingforaliving.us/2020/04/25/spy-comp...
https://allocatesmartly.com/paul-novells-flagship-...
Print the post


Author: RAMc   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/22/26 11:37 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 5
Rayvt; “Trying to a consensus of several systems is futile. It has the same problem of deciding which of dozens or hundreds of systems to use. It's the same problem, just one step deeper.”

I’m going to respectively disagree with you on this one. If you carefully choose three or more different systems that are each based on different fundamental characteristics and have had positive non correlated results then you are much more likely to have a future outperformance. The 200 day you mention is one of the oldest discoveries that has held up post discovery. GTT by Philosophical economics which you like also appears to have a good fundamental basis. Another one based on value vs price Risk Premium Value is another example. Turns out that all three outperform during different market conditions. Putting them together in a backtest doesn’t increase the return so much as it tends to smooth the ride.

Been doing this for several years now and so far, it seems to be working. I absolutely agree with your observation “We don’t need to be perfect; we only need to be Good Enough.”
Print the post


Author: RAMc   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/23/26 12:09 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
Lizdal: “I attribute this to the absence of a major bear market. BCC timing will be most effective during major bear markets like 2008, 2002, and 1974.”

Very true, it would be nice if we had a few hundred years with 50 or more Bull/Bear examples to give us some good statistics but unfortunately, we don’t.

I’m impressed with your organized collection of screens, historical records and obviously good script to run a collection of backtests. You also reference SPY-COMP Paul Novell’s tweaks in his improved GTT version. Allocate Smartly comment on SPY-COMP “Where it differs from those other strategies is that it considers a much broader array of economic indicators.”
Print the post


Author: mungofitch 🐝🐝 SILVER
SHREWD
  😊 😞

Number: of 19827 
Subject: Re: My new Program
Date: 01/23/26 8:18 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 12
It uses a 9-Day Weighted Moving Average (WMA). The thresholds for turning to bearish or back to bullish are not a fixed zero per my own backtests of what is optimal. I suggest anyone using it to do the same sort of testing to arrive at what they consider optimal.

I'd add to that, if you're going to use a cutoff other than zero, I recommend expressing the NH-NL difference as the percent of issues before comparing to your constant - the number of stocks changes a lot over time, so an absolute ticker count is probably not what you want if you want a long backtest to behave the same way now.

Jim
Print the post


Author: FlyingCircus   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/23/26 9:42 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
At some point in the long past of the 07-09 period, I settled on using just the 9-day SMA of the NH/NL based on contemporary posts from Zee and Jim that danced around that value. It doesn't need smoothing. If the EOD value of that 9 day SMA is above 0 (simple) or -10 (Zee optimized at the time) it's bullish. The SMA itself doesn't need smoothing.

I can't find the original threads on the definition of the signal in Yorick, so here's the current update of the URL I've been using for years at Stockcharts for Nasdaq New Highs/New Lows -

https://stockcharts.com/sc3/ui/?s=%24NAHL&a=149660...

FC
Print the post


Author: rayvt   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/23/26 2:35 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
SPY-COMP on AllocateSmartly, Published by Paul on April 25, 2020
"To know when to switch between them, SPY-COMP monitors 6 different economic indicators. When no indicators are signaling recession, the strategy remains long SPY, regardless of what price is telling us. If any one of those indicators is signaling a potential recession then it defers to trend-following to confirm, either going long SPY if the trend in equities is up, or IEF if the trend is down."


also
we will not be disclosing the specific rules for SPY-COMP

In the description, SPY-COMP is GTT (Growth-Trend Timing) with 4 additional indicators. Which actually makes it more hair-triggered on the sell side.

I get similar results in my GTT backtest as he reports for SPY-COMP. And GTT is disclosed.

More indicators does not necessarily mean better.


---------------------------

Nas100Momentum, as defined in the sample data, refers to a simple screen that buys the top 5 NASDAQ 100 stocks by one-year total return and holds for 252 market days.
...
Monthly trading improves results significantly in a backtest from 1985 to 2021.


GTR1 backtest confirms this screen and shows 1 month to 4 month hold periods are very good, but 1 year is not - 252 days is too long.
Print the post


Author: rayvt   😊 😞
Number: of 19827 
Subject: Re: My new Program
Date: 01/23/26 2:58 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
Turns out that all three outperform during different market conditions. Putting them together in a backtest doesn’t increase the return so much as it tends to smooth the ride.

As for timing, the ONLY market condition to care about is bear markets. Which are long runs of more than 20% down. As opposed to corrections which are short sharp drops that are quickly recovered. Unpleasant as it is, we have to take many 20% drops so that we avoid the grinding 40% drops.

And apparently it is bear market signals when and only when the economy is not doing well, as signalled by a few economic indicators.



Been doing this for several years now and so far, it seems to be working.

Yes. But the problem is that we've been in a bull market since 2009. The best timing strategy since then is buy and hold. All timing schemes had worse return.

S&P500 6/2009 - 3/2024:
B&H CAGR 14.3% MaxDD -32% Sortino 2.48
GTT CAGR 12.5% MaxDD -18% Sortino 2.63
SMA CAGR 8.1 MaxDD -22% Sortino 0.45 (43 week SMA)
Print the post


Author: musselmant   😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/23/26 2:58 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
per philosophicaleconomics the better timing method:
At the close on the last trading day of the month, calculate the year over year change in Real Retail and Food Services Sales (RRSFS, a measure of economic consumption) and the Industrial Production Index (INDPRO, a measure of economic production) as of the end of the previous month. The one month lag is required due to the delay in the reporting of these numbers.
If the YOY change in both indicators is positive, go long the S&P 500 (represented by SPY) at the close. In other words, no recession is signaled, so turn trend-following off.
If the YOY change of either indicator is negative, compare the S&P 500 (SPY) to its 10-month moving average. If the S&P 500 will close above the average, go long SPY at the close, otherwise move to cash. In other words, possible recession is signaled, so rely on price to confirm. Note that this is the same trend-following rule used in Meb Faber’s classic GTAA.
Hold positions until the final trading day of the following month
Print the post


Author: rayvt   😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/23/26 3:14 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 1
Allocate Smartly comment on SPY-COMP “Where it differs from those other strategies is that it considers a much broader array of economic indicators.”


Which probably are not necessary. Notwithstanding that they don't say what those indicators are.

The "out" signal gate is when ANY of the indicators turns down.
But two things.
If you are told once, you don't need to be told 3 or 4 or 6 times. One is enough.
The more indicators, the more likely it is that you will get more "out" signals. But most of the signals are false, so you will be getting out more often which means more whipsaws and more times out than optimal.

Actually, with 6 indicators out of many dozen possible, the risk is that the choice of the 6 was just curve-fitting.

But since SPY-COMP is a black box, we cannot evaluate it so we can't have any confidence on its correctness and robustness.

Print the post


Author: musselmant   😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/23/26 4:18 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
the 2 indices were up on an annual basis all last year so you never would have moved to cash even though the S&P was below its MA200 sometimes
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 9:54 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 3
Can anyone who is still following this thread translate this expression from GTR1 into plain english?

Create [PcntNHC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]] > 1 ? 1 : 0] at step4]/[StockCount]]]

I get the "[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]" but what gets summed and what gets divided by [StockCount]? Also what is the meaning of " > 1 ? 1 : 0]"

Thanks for any help you can give,
Larry



Print the post


Author: bacon   😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 10:09 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 1
I think what's happening is IFF today's g-price is greater than the highest g-price over the last year, ending yesterday, is greater than one, then add one to the count, otherwise don't add one, add zero instead. The use of "?" is new to me, but in that context, I think it's an If/Else symbol.

Eric Hines
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 12:25 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 8
For each stock, return 1 if at a new high. This can be written in 2 equivalent ways:

[A>1 ? 1 : 0]

If A>1 then 1 else 0

Each stock gets a 1 or 0 depending on if it is at a new high. Sum up all these values to get a count of the stocks at new highs.

======= more details ============

[PcntNHC252]: [100*[

[Sum [[[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]] > 1 ? 1 : 0] at step4]

/[StockCount]]]


1. For each stock, calculate the ration of the current price to the highest price over the previous 251 market days.

PriceToHighPriceRatio = [[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]]

2. If this is a new high price, set B=1.

if (PriceToHighPriceRatio > 1) then B=1 else B=0

3. Add up all the B's for the stocks eligible at step4.

SumB = Sum of B for stocks at step4

4. Divide by StockCount.

[PcntNHC252] = 100 * SumB / StockCount


Calculation #2 above can also be written as:

B = (PriceToHighPriceRatio > 1) ? 1 : 0
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 2:09 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 1
lizgdal,

1. For each stock, calculate the ratio of the current price to the highest price over the previous 251 market days.


I hate to be so dense but this whole calculation is not about a bunch of stocks. I am trying to do a calculation based on a single stock (SPY) on a single date. I can calculate PriceToHighPriceRatio for SPY on a given date and I can decide whether to give B a value of 0 or 1 but that gives me one B value. There is nothing for me to sum up unless I take the previous date and calculate a second B value based on that date and the high price on the previous 251 days. Then do that again for all 251 previous days thus ending up with 251 B values to sum up. Is that what Robbie is doing?

Larry
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 5:35 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
NHNL is the number of Nasdaq stocks making new highs minus those making new lows. It has nothing to do with SPY.

The other 2 Bear Catchers (SMAslope and DBE) use ^GSPC. ^GSPC is a price index, not a total return index, and does not include dividends. SPY unadjusted price might be similar.

"The New High / New Low ratio is a simple interpretation of the Nasdaq New Highs to Lows index - $NAHL on Stockcharts. $NAHL is a measure of the net number of Nasdaq stocks making new highs to those making new lows."
http://mechinvesting.wikidot.com/newhighstonewlows
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 1171 
Subject: Re: My new Program
Date: 01/24/26 5:38 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 0
lizgdal and bacon,

I just woke up from a nap during which I had a revelation. The question I should have been asking first is: What constitutes a new high? I googled it and decided that Robbie is looking at SPY from the present date back 251 days from the day in question and if SPY is the highest it has been over that interval it gets marked with a 1 else it gets marked with a 0. A years worth of zeros and ones are then averaged to calculate a percentage number. Another percentage number is similarly calculated for new lows and the difference in those two percentage numbers, if positive makes the NHNL signal itself 1 and if negative 0.

Please correct me if I'm wrong.

Larry
Print the post


Author: lohill HONORARY
SHREWD
  😊 😞

Number: of 836 
Subject: Re: My new Program
Date: 01/24/26 6:01 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 0
lizgdal,

We must be talking about two different things. I'm not interested in that Nasdaq graph. I am trying to reconstruct Robbie's BCC signal which clearly is derived from SPY closing prices. I am currently working on the part that has to do with New Highs and New Lows which GTR1 shows as:

Create [PcntNHC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]] > 1 ? 1 : 0] at step4]/[StockCount]]]
Create [PcntNHC252WMA9]: [[Weighted Sum of [PcntNHC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]
Create [PcntNLC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Lowest closing g-price over 251 days; lag=1 days]] < 1 ? 1 : 0] at step4]/[StockCount]]]
Create [PcntNLC252WMA9]: [[Weighted Sum of [PcntNLC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]
Create [NHNLDiff]: [1*[PcntNHC252WMA9] - 1*[PcntNLC252WMA9]]

I see I still have to bring the part about [PcntNHC252WMA9] so my nap time revelation as I described earlier is not quite complete.

Larry
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 836 
Subject: Re: My new Program
Date: 01/24/26 6:58 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 10
I am trying to reconstruct Robbie's BCC signal which clearly is derived from SPY closing prices.

Bear Catcher II (NH/NL) does not use SPY closing prices. Bear Catcher II (NH/NL) uses "the count of new highs and the count of new lows together in one backtest so that a Nasdaq NH-NL signal can be created."

In some examples, SPY is used as the investment that BCC timing is applied to. But BCC can be applied to any screen. For example:

https://gtr1.net/2013/?!!QlpoMTFBWSZTWcrGjKgAAohfg...

The BCC code does not use SPY. It does use GSPC:

lf-1lp-1h1::BCC:et-999:SMADiff:imports%280,SMADiff,1,0%29:NHNLDiff:imports%281,NHNLDiff,1,0%29:DBE:imports%282,DBE,1,0%29:BCC:linear%281,ifgt%28SMADiff,0,1,0%29,2,ifgt%28NHNLDiff,-0.4,1,0%29,4,DBE%29%7blf-1lp-1h1::SMADiff:gt0:SMADiff:linear%281,sma%281,200%29,-1,sma%2811,200%29%29%7bU:%7b!GSPC%7d%7d%7d%7blf-1lp-1h1::iflt%28linear%281,ord%281%29,-1,date2ord%2819731217%29%29,0,3,excd.a%29et3:styp.a:et10!11!18!48:dspo%281%29al252:rank%28class.a,permco.a,step3%29et1:NHNLDiff:et-999999:StockCount:sum%281,1,step4%29:PcntNHC252:linear%28100,ratio%28sum%28ifgt%28ratio%28gprc%281%29,hgprc%282,251%29%29,1,1,0%29,1,step4%29,StockCount%29%29:PcntNLC252:linear%28100,ratio%28sum%28iflt%28ratio%28gprc%281%29,lgprc%282,251%29%29,1,1,0%29,1,step4%29,StockCount%29%29:PcntNHC252WMA9:ratio%28sgwsum%28PcntNHC252,0,9,8,7,6,5,4,3,2,1%29,sgwsum%28linear%281,1%29,0,9,8,7,6,5,4,3,2,1%29%29:PcntNLC252WMA9:ratio%28sgwsum%28PcntNLC252,0,9,8,7,6,5,4,3,2,1%29,sgwsum%28linear%281,1%29,0,9,8,7,6,5,4,3,2,1%29%29:NHNLDiff:linear%281,PcntNHC252WMA9,-1,PcntNLC252WMA9%29%7d%7blf-1lp-1h1::DBE:et1:DBE:sgmax%28ifgt%28ratio%28gprc%281%29,hgprc%282,98%29%29,1,1,0%29,0,99%29%7bU:%7b!GSPC%7d%7d%7d

The [NHNLDiff] code does not use GSPC or SPY:

https://gtr1.net/2013/?lf-1lp-1h1::iflt%28linear%2...

Note that you can get to these screens by clicking through the links in the gtr1 Results.


=== links ===

Author: rgearyiii
Subject: GTR1 and Bear Catchers
Date: 9/29/2013
Bear Catcher II (NH/NL) Revisited
"I also re-build the NH/NL signal described in http://boards.fool.com/gtr1-and-market-timing-3035... using new field functions that simplify its construction. Finally, I build a signal whose value gives the states of all three Bear Catchers at once and show how to apply it to a basic blend."
https://yorickm.com/Message.php?pid=30893319


Author: rgearyiii
Subject: GTR1 and Market Timing
Date: 11/1/2012
"Counting Nasdaq New Highs and New Lows ...
First, here is a screen that picks Nasdaq stocks that are at new highs: ...
The next step is to bring the count of new highs and the count of new lows together in one backtest so that a Nasdaq NH-NL signal can be created."
https://yorickm.com/Message.php?pid=30354312
http://boards.fool.com/gtr1-and-market-timing-3035...
https://web.archive.org/web/20140502034729/http://...
Print the post


Author: TGMark   😊 😞
Number: of 836 
Subject: Re: My new Program
Date: 01/24/26 9:02 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
https://yorickm.com/Message.php?pid=34281772
Print the post


Author: elann 🐝 GOLD
SHREWD
  😊 😞

Number: of 836 
Subject: Re: My new Program
Date: 01/25/26 9:50 PM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 10
We must be talking about two different things. I'm not interested in that Nasdaq graph. I am trying to reconstruct Robbie's BCC signal which clearly is derived from SPY closing prices. I am currently working on the part that has to do with New Highs and New Lows which GTR1 shows as:

Create [PcntNHC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Highest closing g-price over 251 days; lag=1 days]] > 1 ? 1 : 0] at step4]/[StockCount]]]
Create [PcntNHC252WMA9]: [[Weighted Sum of [PcntNHC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]
Create [PcntNLC252]: [100*[[Sum [[[Closing g-price; quote_lag=0 days]/[Lowest closing g-price over 251 days; lag=1 days]] < 1 ? 1 : 0] at step4]/[StockCount]]]
Create [PcntNLC252WMA9]: [[Weighted Sum of [PcntNLC252] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]/[Weighted Sum of [1] over 9 days (daily weights=9,8,7,6,5,4,3,2,1); lag=0 days]]
Create [NHNLDiff]: [1*[PcntNHC252WMA9] - 1*[PcntNLC252WMA9]]

I see I still have to bring the part about [PcntNHC252WMA9] so my nap time revelation as I described earlier is not quite complete.


Larry, I think you're completely lost.

The signal we're talking about looks at new highs and new lows among all Nasdaq listed stocks, as of the latest market day. If let's say there are currently 3000 Nasdaq stocks, and 300 of them hit a new 52 week high today, and 198 of them hit a new low, then NHNL for the day is 300-198=102. You can go back to previous days with the same calculation, which allows you then to produce any desired moving average, for smoothing purposes.

If the signal threshold is exactly zero, that's all you need to do. But if you're going to choose a non-zero threshold, as Zeelotes does, then the "new high count minus new low count" metric creates a problem. As the total number of Nasdaq listed stocks changes over time, the meaning of e.g. a -10 threshold for the signal changes. -10 out of 3000 stocks is not the same as -10 out of 2000 stocks. That's where the percentage calculation comes in. So, instead of calculating a simple difference, you calculate the percentage difference. i.e. 102/3000=3.4%, which is compared to a threshold of e.g. -10/3000=-0.33%.

Once you've got the threshold defined, and today's percentage of NHNL, and the moving average of your choosing, then you know your signal - bullish or bearish. And you can apply that signal to your investment of choice, in this case it's SPY I suppose.

Elan
Print the post


Author: TGMark   😊 😞
Number: of 836 
Subject: Re: My new Program
Date: 01/26/26 9:13 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 1
The signal we're talking about looks at new highs and new lows among all Nasdaq listed stocks, as of the latest market day.

I have to say that I am confused. My understanding, for all of these years, is exactly as you said.
However, if I look at the GTR1 code, I can't see where the Nasdaq is specified:

lf-1lp-1h1::iflt(linear(1,ord(1),-1,date2ord(19731217)),0,3,excd.a)et3:styp.a:et10!11!18!48:dspo(1)al252:rank(class.a,permco.a,step3)et1:NHNLDiff:et-999999:StockCount:sum(1,1,step4):PcntNHC252:linear(100,ratio(sum(ifgt(ratio(gprc(1),hgprc(2,251)),1,1,0),1,step4),StockCount)):PcntNLC252:linear(100,ratio(sum(iflt(ratio(gprc(1),lgprc(2,251)),1,1,0),1,step4),StockCount)):PcntNHC252WMA9:ratio(sgwsum(PcntNHC252,0,9,8,7,6,5,4,3,2,1),sgwsum(linear(1,1),0,9,8,7,6,5,4,3,2,1)):PcntNLC252WMA9:ratio(sgwsum(PcntNLC252,0,9,8,7,6,5,4,3,2,1),sgwsum(linear(1,1),0,9,8,7,6,5,4,3,2,1)):NHNLDiff:linear(1,PcntNHC252WMA9,-1,PcntNLC252WMA9)

Further, in that post I linked to earlier https://yorickm.com/Message.php?pid=34281772, Robbie seems to say he is using FTSE/Russell eligible stocks.
That would be different than Nasdaq stocks.

Mark
Print the post


Author: lizgdal 🐝  😊 😞
Number: of 836 
Subject: Re: My new Program
Date: 01/26/26 11:47 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 7
Nasdaq is specified by:
iflt(linear(1,ord(1),-1,date2ord(19731217)),0,3,excd.a)et3

[NHNLDiff]
step0 restricts to Nasdaq listed: [Exchange Code] == 3
step1 restricts to "Russell-eligible stocks": [Security Type] == 10,11,18,48

Author: rgearyiii
Subject: Re: Nasdaq NH/NL
Date: 8/26/2019
"... The design is to use the stocks that I use, which happens to be very close to FTSE/Russell-eligible stocks, so I describe them as such for ease of communication. ...
6. Perhaps most importantly, judging by how bullish $NAHL remained through the end of July, I`d say StockCharts is not applying any crap filters to NASDAQ securities because it would have taken an awful lot of new highs from bond-like securities to keep it propped up like that. Using the entire exchange for $NAHL may work fine most of the time, but for now, it`s broken IMO."
https://yorickm.com/Message.php?pid=34281772


Author: rgearyiii
Subject: Russell 2000 Not Torpedoed
Date: 2/19/2014
"1. Preferred stock, structured products, exchange-traded notes, exchange-traded debt, warrants, rights, and OTC pink sheet and bulletin board stocks are all excluded by Russell, and are excluded by definition from the GTR1 universe.

2. Closed-End Funds, Exchange-Traded Funds and Unit Trusts are excluded with styp.a.

3. Russell includes REITs as long as they don`t distribute unrelated business income (a tax nightmare for otherwise tax-exempt investment entities); I simply include all REITs. ..."
https://yorickm.com/Message.php?pid=31125719
https://gtr1.net/2013/?~zgIWM_20140219_rgearyiii:l...


Command Translation [NHNLDiff]
step0: [[1*[Mkt Date as Ordinal; lag=0 days] - 1*[19731217 as market date ordinal 13271]] < 0 ? 3 : [Exchange Code; lag=0 days]] == 3
step1: [Security Type; lag=0 days] == 10,11,18,48
step2: [Mkt Days Since Security Opened; lag=0 days] >= 252
step3: [Rank by [Share Class #; lag=0 days] (Asc), grouped by [Permanent Company ID; lag=0 days], at step3] == 1
https://gtr1.net/2013/?lf-1lp-1h1::iflt%28linear%2...
Print the post


Author: TGMark   😊 😞
Number: of 836 
Subject: Re: My new Program
Date: 01/26/26 11:55 AM
Post Reply | Report Post | Recommend It!
No. of Recommendations: 2
ok thanks, so the exchange code 3 is Nasdaq, cool, I should have known that.
Print the post


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


Announcements
Atheist Shrewds FAQ
Contact Shrewd'm
Contact the developer of these message boards.

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