Creating Advanced Stock Screens Using the “Or” Function and ParenthesesDownload printable PDF
Stock screening is the process of applying a set of quantifiable criteria to a universe of stocks to isolate those stocks that match the criteria. Programs such as Stock Investor Pro perform this task by using filters which are a collection of comparison statements that are applied to the entire universe of stocks or a subset such as a portfolio. Arguably the most difficult task for new users of Stock Investor Pro is setting up a custom stock screen with their own filters. This issue of Stock Investor News finishes our discussion on creating stock screens by applying two advanced features: the “or” function and parentheses.
Using “Or” and Parentheses
Perhaps two of the most underutilized or misused functions in Stock Investor Pro’s Screen Editor are the “or” statement and the parentheses. If used properly, these functions can save you from having to repeat expressions in your screen, thus making the screen less cumbersome. However, if used incorrectly, they can have an adverse effect, leading to incorrect and perhaps misleading screening results.
Share this article
The best way to illustrate the use of these functions is by looking at an example. Sample Screen 1 looks for those companies in relatively similar industries (electric utilities and natural gas utilities) so that you are comparing apples to apples. To create these first two lines, simply select Industry from within the Company Information category for the field cell, Equals for the Operator cell, and choose the appropriate industry in the Compare to cell. Note that an “or” connector separates the two industries. By default, “And” appears in the Conn column, so you will need to click on “And” and change it to “Or.”
Additionally, we want those companies whose price-earnings multiple has not outpaced the sum of its earnings per share growth rate and its dividend yield. This figure is an indication of the valuation by the market relative to a company’s historical earnings growth and dividend yield. In other words, we are searching for companies that have gotten cheaper relative to their dividend-adjusted earnings growth over the past five years. For this criteria, we select PE to Div adj EPS growth 5yr for the Field cell, the less than symbol for the Operator cell and 1 for the Compare to cell. Lastly, we are looking for those companies that rank among the top 10% of all the companies contained within the database in terms of dividend growth over the last five years (% Rank-Dividend-Growth 5yr >= 90).
Sample Screen 1 uncovered 110 companies (as of January 20, 2012). Upon further investigation, however, you may question the fact that the number of companies that did pass (110) is over 65% of the maximum number that could pass. We know this because the screen editor shows in the Count On column that there are 168 (108 + 60) companies in the electric and natural gas utilities industries combined. Realizing that there may be a problem, we need to look at why the screen produced these results.
The Screen Editor looks at all expressions before an “or” statement and performs a screen. The results of that sub-screen are then set aside, and the editor continues on, screening those expressions that contain the “or” statement and all those thereafter. If there are additional “or” statements contained within the screen, it will perform additional sub-screens and set the results aside. When the entire screen has been performed, the Screen Editor then combines together those companies that passed each of the sub-screens to arrive at the total number of passing companies.
Referring back to the first criterion statement in Sample Screen 1, 108 companies are part of the electric utilities industry. Since it is before an expression with an “or” statement, this result is set aside. At this point, therefore, 108 companies will pass the entire screen. Two companies pass the portion of the screen after the “or” connector: natural gas utilities with a low PE to earnings growth and that rank high in dividend growth. Adding the 108 companies that passed the first portion of the screen to the two that passed the second, we arrive at the 110 companies that pass the entire screen. An adjustment needs to be made to the screen so that all electric and natural gas utilities are filtered against the final two criteria. This is where parentheses come in.
The idea behind the use of parentheses in the Screen Editor is the same one you may have learned in a basic algebra class. Just as in a mathematical expression, the items contained within the parentheses are evaluated first. Those companies passing the screen contained within the parentheses are then screened against the remaining criteria. Typically, you will use parentheses in conjunction with “or” statements.
Sample Screen 2 shows parentheses around the expressions using the “or” statement. The result is that we see a dramatic drop in the screen outcome: Only 20 companies pass the screen. Using the logic discussed above, the Screen Editor will first perform the screen on the expressions within the parentheses, screening for those companies in the electric or natural gas industries. The 168 companies that remain (those that are either in the electric utilities or natural gas utilities industries) are then screened against the last two expressions, with 20 remaining when the screen is complete. This is the intended result.