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


Investment Strategies / Mechanical Investing
Unthreaded | Threaded | Whole Thread (23) |
Author: Aussi   😊 😞
Number: of 3958 
Subject: Re: Technical Indicators & Market Timing
Date: 02/09/2023 10:14 AM
Post New | Post Reply | Report Post | Recommend It!
No. of Recommendations: 13
From GTR for Dummies

The steps for counting the number of new Highs are:
step0: dspo >= 252 only stocks listed for at least 1 year (needed to find High for the year)
step1: excd.a = 3 only Nasdaq stocks
step2: styp.a = 10!11 restrict to ordinary stocks (US listed and foreign listed)
step3: ratio(gprc(0), hgprc(1,251)) > 1 discussed below

Note that you need to use g-prices to compensate for splits. Also note that this is an approximation because dividends are included in g-prices, and strictly speaking, a new High is typically based on the closing price (adjusted for splits, but not for dividends), or the intraday High. Stated another way, there is no universal agreement on how a new High (or Low) is calculated, so take care in comparing GTR1 new High/new Low signals to another source 'disagreements are normal. See post 258804 for a good discussion on this subject.

step3 takes last posted g-price(lag = 0) and divides by the highest g-price with a lag of 1, and going back 251 days beyond the last posted day (a year is 252 days). If last g-price is higher than the highest g-price of the 251 days prior to the last posted day (lag=1), then the result of step3 will be >1, implying a new 252-day high has been established.
Finally we need a way to count the stocks passing step3. We get this by using the sum function.

Field Label: Expression is:
CountofHighs: sum(1,1,step4) (step references must be lower case)
This function will count the number of stocks entering step4 (the next step from the prior list of steps). For now, ignore the two '1's'.

As the final step, it can be anything involving the term CountofHighs (if CountofHighs is not referenced in at least one step, an error message occurs). For example, make step4 anything that results in no stocks passing.
step4: CountofHighs = -1
Put these steps into GTR1 and run the backtest. You will get:
http://gtr1.net/2013/?h1::dspo:al252:excd.a:et3:st...
Post New | Post Reply | Report Post | Recommend It!
Print the post
Unthreaded | Threaded | Whole Thread (23) |


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