Using equations in a screener lets you create highly specific filtering criteria that can allow you to implement sophisticated screening matching criteria. In an equation, you can use numbers, arithmetic operators (+ – * /), comparison symbols (>, <, >=, <=, !=, =), Boolean operators (e.g. and, or), functions, and parenthesis for proper nesting.
Note that Boolean operators and functions must be specified in lower case.
The following list of functions (which is the same list that is available when you create Custom Metrics) can be found here.
You can also screen on historical data, by incorporating historical results in a formula. For example, last year’s sales or EPS from 5 quarters ago.
Note: To help you learn more about using Custom Metrics in Equation Screeners, we have created a guide for creating Custom Metrics. It is available in PDF and Word format.
Note: Equation Screeners are available in Premium Plus only.
To create a screener using equations, first open the screener manager and click ‘Add Freeform Equation’, highlighted by the box in the screenshot below.
You will then see the following equation editor:
To add a metric to the equation, simply begin typing the metric in Quick Search box and it will display a list of dynamic search results, as seen below.
Another option is to turn on Auto Search and then start typing directly into the equation editor and it will bring up the dynamic list under the Search box as seen below.
If you select a metric, it will be added to the equation editor. If you have selected a metric with historical data, it will default to the current value, but if you click next to the metric you will see the metric in the box above the equation editor.
When the button is clicked, it will give you different historical options to choose from as seen below.
Please note if you have multiple historical metrics you will want to click into the metric to get the correct button to appear at the top of the equation editor.
From here, you can use arithmetic operators (+,-,*,/), the pow() and exp() functions for powers and exponents, comparison symbols (<, >, <=, >=, !=, =), parenthesis, and Boolean operators (“and”, “or”) to create an equation. A comparison symbol is necessary to make an equation valid.
You can enter numerical values into the equation, use any other metric, or use any supported historical data. As seen in the screenshot below there is additional help available when clicking the Help button above the equation editor.
Once the equation is completed you can click ‘OK’. This will bring you back to the screener window.
If your equation is not entered correctly, you will receive an error message saying that the equation is invalid. See the next section to learn how to test your equation to make sure that it is valid.
Testing and Saving Equations
You can test any equation to make sure it is valid simply by clicking the button that says ‘Test’ at the top of the equation editor.
As called out in red above, you will see a message that tells you whether or not the equation is valid and, if it is valid, how many stocks pass the filter.
As seen in the screenshot below there is also the Sample Values box. Here you’ll see sample values for the metrics included in the equation (in the image above, the sample values shown are for IBM). You can change the sample ticker using the search form.
If at any time you make edits that you want to reverse, you can click the ‘Undo’ button to reverse each change made, one by one. To go in the other direction and restore changes after using the ‘Undo’ button, click on the ‘Redo’ button as needed. Both buttons are highlighted below.
Click ‘OK’ when you are finished editing an equation, and the equation will added be to the criteria box, with the number of passing stocks listed just below.
Please note the following limitations of screener equations:
Currently screener equations are used strictly as filtering criteria and cannot be weighted using the ranking feature. However, you can use equations and ranking on non-equation criteria in the same screener.
Listed below are three examples of using equations in the Stock Rover Screener. Note that the tag inside the brackets indicates the time period to use for each metric in the expression. For example, Now refers to the most current trailing twelve month period. TTM1 refers to the trailing twelve month period one year ago, so 12 month prior to the Now period. Likewise TTM2 refers to the trailing twelve month period two years ago. Y2, which is used in the second example refers to the calendar year two years ago.
Ensure ROIC Improvement
( “ROIC [Now] ” > “ROIC [TTM1] ” ) and ( “ROIC [TTM1] ” > “ROIC [TTM2] “)
Ensure Share Count Not Growing Too Fast
“Diluted Shares [Now] ” <= ( "Diluted Shares [Y2] " * 1.02)
Ensure Debt Reduction
( “Long Term Debt [Now] ” <= "Long Term Debt [TTM1] " ) and ( "Long Term Debt [TTM1] " < "Long Term Debt [TTM2] ")
To learn more about equation screeners, please visit our equations screener examples page.