StockFetcher Forums · Filter Exchange · Correction/Bear market<< 1 2 3 >>Post Follow-up
snappyfrog
653 posts
msg #158749
Ignore snappyfrog
3/8/2022 10:43:03 AM

xarlar,

Nice concept and filter.

glgene
613 posts
msg #158753
Ignore glgene
3/8/2022 12:28:02 PM

Snappy — In addition to the Sort column ranking of “Price/ 52-week High” I also use the RMA (Relative Moving Average) approach with the 50-day MA column. Sort on that column and it displays “a relative” moving average of all stocks. For example, with the Dow 30 stocks, it shows that only 6 of the 30 stocks have a positive score, that is, over 100. And it shows them in order (best to worst, if you click on that column header). 100 = Price exactly matches the 50-day MA; that’s a push. You want to be higher than 100.

Gene in FL





snappyfrog
653 posts
msg #158755
Ignore snappyfrog
3/8/2022 3:32:17 PM

Maybe add a line where the RMA > 100 ??

glgene
613 posts
msg #158757
Ignore glgene
3/8/2022 3:57:29 PM

Snappy … That's certainly doable. But the main thrust of the script is to rank the stocks by their primary sort (Price/ 52-week high), where I want to see all. The 50-MA column is extra info. Clicking on the 50-MA column header let's me rank them that way, if I so desire. Thanks for your feedback!

Gene in FL

nibor100
1,010 posts
msg #158764
Ignore nibor100
3/9/2022 12:46:09 PM

@glgene,

1. It appears you took out 2 of the chart indicators that were in Xarlor's original filter, and I don't believe that adding them back in affects your column displays at all.

2. Its a small point but I believe the SF Price variable is the Close and you are dividing it by the 52 week high of the HIGH, so you'll probably very rarely get the value of 100.

3. For you RMA calculation is there a specific reason you picked the 50 day for the longer moving avg as opposed to the 20 day or the 13 day?

Thanks,
Ed S.



glgene
613 posts
msg #158765
Ignore glgene
3/9/2022 1:48:26 PM

Ed (aka NIBOR) — 1) Yes, I’ll probably put back in those 2 graphic displays (for Correction & Bull).
2) You get 100.00 at a stock’s peak (a ‘new’ 52-week high). I scripted it that way. I have seen it a few times in my exploration.
3) I am using 50-day MA only because it’s an institutional figure. I often use 20-day MA as my trigger point. You could also create an RMA column, such as EMA(13) crossing +/- EMA(48). I read once (about 3 years ago), that the 13/48 …cross is an optimal cross (but I don’t know if that has been tested only on broad market indexes, or whatever.?).

————————————————-
Set{1348, EMA(13) / EMA(48)}
Set{1348b, 1348 multiplied by 100}
Add column 1348b{13/48e}
Draw EMA(13)
Draw EMA(48)
— or —
Draw 1348b
———————————————-—

Thanks for all your help, Ed. Glad I personally know you.

Gene in FL

nibor100
1,010 posts
msg #158768
Ignore nibor100
3/10/2022 3:17:23 AM

@glgene,

I'm not sure you are following my point 2 about the "High 52 week high" being different from the "Price 52 week high being equal to the "Close 52 week high" ; effectively preventing the 100 score from occurring on many stocks on the day they hit a new High 52 week high, so I added 3 columns to your filter, that show up right after your sort column, and limited the symlist to 2 symbols that demonstrate my point.

The first column I added counts the number of days since the latest High 52 week high, which is 44 days for those 2 symbols
2nd column I added shows the High from 44 days ago, note it matches your column after the industry column
3rd column is your ph100 score 44 days ago, note it does not equal 100 because the High that day was greater than the Closing Price that day.

Note that the ph100 values in the 3rd column are different for the 2 stocks because the closing prices for each are different distances from the High prices on that day 44 days ago. Which means on days where the new high 52 week high is the Open price on a large down day that ph100 value could be even further away from 100.

Thanks,
Ed S.

Fetcher[
/* --- Decide below your choice for running the script --- */

symlist(SPY,VTI)

/*dow 30*/

/*sp500*/

/*nasdaq 100*/

/*russell 2000*/

/*NYSE*/

/* --- Some personal watchlists below --- */

/*apply to watchlist(11sectors)*/

/*apply to watchlist(55ETFs)*/

/*apply to watchlist(holdings)*/

/* ---------------------------------------------- */

add column separator
add column sector
add column industry
add column separator
add column high 52 week high
set{h, high 52 week high}
set{ph, price/h}
set{ph100, ph multiplied by 100}

/*--- Triple separators frame the sort column ---*/
add column separator
add column separator
add column separator

add column ph100{price/_52-wk.high: ... 100.00=new_high; 90.00=corr.; 80.00=bear}

add column separator
add column separator
add column separator
draw ph100
add column days(high equals high 52 week high,100)
add column high 44 days ago
add column ph100 44 days ago
set{correction,high 52 week high * .90}
set{bear,high 52 week high * .80}
draw price line at high 52 week high
draw price line at correction
draw price line at bear

/*set{Correction_,count(close < correction,1)}
set{Bear_,count(close < bear,1)}
correction_ > -1
bear_ > -1*/

add column correction{correction-level_10%}
add column bear{bear-level_20%}
add column separator

set{50, price/ma(50)}
add column 50 multiplied by 100{pr/ma(50) base=100.00}
add column separator
draw ma(50)

add column roc(5){roc_5 days}
add column roc(21){1 mo.}
add column roc(63){3 mo.}
add column roc(126){6 mo.}
add column roc(189){9 mo.}
add column roc(252){12 mo.}
add column separator

draw avgvol(50)

sort on column 13 descending{best to worst}
chart-time 1 year
]



glgene
613 posts
msg #158769
Ignore glgene
3/10/2022 4:46:35 AM

Ed,

Are you saying that my script includes only End-of-day highs in the 52-week lookback, whereas your version includes Intraday highs in the 52-week lookback calculation? Or am I missing something from your message? I intended to compute EOD. ??

Thanks, Ed.

Gene in FL

davesaint86
725 posts
msg #158772
Ignore davesaint86
3/10/2022 9:21:51 AM

Fetcher[

symlist(SPY,QQQ,DIA,IWM,SGOL,PSLV,DBC)
set{correction,high 52 week high * .90}
set{bear,high 52 week high * .80}
draw price line at high 52 week high
draw price line at correction
draw price line at bear

set{Correction_,count(close < correction,1)}
set{Bear_,count(close < bear,1)}
correction_ > -1
bear_ > -1

set{E15, ema(13) - ema(48)}
set{EMA13/48Longposition, count(E15 > 0,1)}
set{EMA13/48Shortposition, count(E15 < 0,1)}
draw EMA13/48Longposition on plot
draw EMA13/48Shortposition on plot
add column EMA13/48Longposition {EMA 13/48}
add column high 52 week high
add column correction
add column bear
chart-time 6 months

draw ema(13)
draw ema(48)
]



nibor100
1,010 posts
msg #158773
Ignore nibor100
3/10/2022 9:52:01 AM

Gene,

Both of our scripts are using the EOD High for the 52 week high.

You need to focus on your numerator for your "ph" calculation as it affects the result of "ph100"

Your numerator is Price which SF interprets as EOD Closing Price so basically you are dividing an Apple by an Orange.
Apple = EOD Close
Orange = EOD High

Which means the ph calculation can only be a 1, thereby making ph100 a 100, only if the EOD Close is the exact same value as the EOD High, for the stock on the actual day of the High 52 week high.

I even found a stock where your ph100 calculation is lower than 80,the bear market line, on the same day as the High 52 week high. NNMXD on Jan 4.

Hope this helps,
Ed S.


StockFetcher Forums · Filter Exchange · Correction/Bear market<< 1 2 3 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.