Operators

Operators are mathematically inspired calculations of properties. They can be anything from the Change of a property over a certain number of days to the absolute value of a calculation, or even the exponential moving average of any criteria.

Operators tell screeners what to do with the data you select. The data may be properties in the stock records, constants that are typically numbers you type in like the “10” in the “PE” test, or variables you calculate and name. You will learn about variables later. Operators are the verbs in the screener. Properties, constants, and variables are commonly the nouns.
Click here for a full list of our Operators!

You can think about operators belonging to categories like active, conditional, and implied. Operators such as “add” and “divide” are active—they command that a calculation be made. Operators such as “<” or “=” test a condition or relationship between two numbers. For implied we call them “Booleans” or “True/False” operators. For example, “if this is true, then select the stock.” Operators such as “and” and “or” control how the various tests in a screener connect or how they stand alone.

If you’ve worked with other programming languages or other stock screeners, many of the commands will be familiar. What may amaze you, if you have previously been restricted to a screener where everything had to fit in a pre-defined matrix, is how easily you can create much richer and more precise tests with Equihack. In addition, Equihack has nearly 70 unique commands. Only the basic ones are mentioned here. You can see the whole list by clicking on the Tools tab and clicking the Gear icon to the right of the Filter by the box. Operators are shown in purple as seen in the picture below.

First, let’s look at how operators create empty boxes in screeners. Different operators lay things out differently depending on their needs.You can have more than one operator on a line. You can nest operators. You can have operators to the left of a true/false test, or to the right. This is why we recommend placing the operators on a line first. Even though your “English language” statement probably starts with a property name.

Unless you are building code to calculate a variable or a formula (neither of which we have studied yet), each line of your code will have a true/false test somewhere in it. “Is this equal to that?” “Is this greater than that?” Straight logic questions as laid out by the English Mathematician George Boole in 1854. As we saw in the first lesson, when you put a true/false operator in an empty box, two empty boxes populate on either side of it.

(Say you start a line of code with a property rather than a true/false operator. Equihack will automatically add a “>” and an empty box. This is a reminder of the order things need to be. You can easily change the “>” to any other true/false operator, though.)

Adding an operator by typing

Begin typing the desired operator and it will auto-complete. You can press the up and down arrow keys to select the appropriate object. When the focus is on the desired option, press enter

Adding an operator by mouse

Click on an empty or filled box, click on “Add Operator”.

The Tool tab will open at the bottom of the program. Click on an operator, and it will be inserted into the empty box.

You can also click and drag an operator from the Tools Tab into a box.

Click here for a list of supported operators!