What is a definition of a 'perfect security'? If looking to be long, a security that is going up consistently could be a definition. Higher Highs, Higher Lows, Higher Opens, and Higher Closes certainly would be a really good thing for a 'perfect security'. If looking to for a short, one may look at reversing those Highers to Lowers. Lower Highs, Lower Lows, Lower Opens, and Lower Closes.
How can you find such instances? On StockCharts.com Scan Workbench they have two Technical Indicators filters called Count Up and Count Down. You can use these to count the number of instances that something moved Up or moved Down over a user specified period of time. Pick your desired thing to count, pick the period, pick a threshold you desire and the scan will return the securities that fit that description from your Universe scanned.
The default scan language for the Count Up indicator is
and [Count Up(20, close) > 10]
This scan line is looking at the daily closing price and will return those that have a higher close in at least 11 of the last 20 days.
You can change the 20 to any period of time. You can change the close to be pretty much any appropriate term or indicator available in the drop downs. You can change the threshold to be any number you want.
You can choose, open, high, low, close. You can choose OBV or PPO or Middle Price Channel or SCTR. You can choose pretty much anything appropriate to being counted in the parameter.
You can also use it in the Rank By statement to see what is counting highest or lowest.
Rank By [Count Up(20, Upper Price Chan(20))] will sort the scan by the number of times the 20 period Upper Price Channel has moved UP in the last 20 days.
You can even combine them in your Rank by. Moving back to the question at the beginning of this post. You can
rank by [weekly Count Up(5,weekly high) + weekly Count Up(5,weekly low) + weekly Count Up(5,weekly open) + weekly Count Up(5,weekly close)] for example. So the max of the total UP of the 'perfect security' would be 20 based on 4 distinct criteria and 5 periods as the max. The rank by would tell you how close to 'perfect' the results are.
Once you get the hang of using the Count Up and Count Down, you may find it to be a valuable addition to your analysis. Although it is tough to accurately quantify, I believe it is also good with the PctRelative count as well.
There is also a Streak Up and Streak Down function that looks at an uninterrupted movement in a row. This basically like asking the Count up to be at 100% Streak Up(5, close) is essentially the same as Count Up(5,close > 4
https://support.stockcharts.com/doku.php?id=scans:functions
Comments
At least in theory, you could have a ranging stock that has mostly up closes but a few sharper down closes, or vice versa.
The Kaufman Efficiency Ratio indicator seems to be the ideal for this approach
https://help.tc2000.com/m/69404/l/749623-kaufman-efficiency-ratio
but SC doesn't offer it.
Your method, with start/end percent change or maybe slope component, would probably be a good substitute.
I got thinking about the Count filter after watching a video about a PnF indicator that also isn't on StockCharts.com. The indicator counts the number of X's and subtracts the number of O's over a variable number of columns. This gives an indication of intermediate to longer term trend strength. I use MA's on the PnF chart to indicate the trend. You can't scan on that either. Not even the default Trend lines are available.
You can't scan on several useful things on the PnF chart on StockCharts.com. Hopefully they will be adding in some of the suggestions I've made over the years but.... not gonna expect it. If Definedge.com ever adds in the US markets, that would be phenomenal. Quite an amazing package they offer. If you trade India Market, it's probably a great investment tool to use. Definedge is the company created by Prashant Shah, author of a great PnF book if anyone is interested in learning PnF. He does great twitter threads and had great educational blogs on his website as well.