##### Sections
You are here: Home Complex Terms

# Complex Terms

Describes how to create more complex Equihack terms

You have been encouraged to create your terms from the “middle out.” You do this by entering all the needed operators first. This creates a framework where you can then fill in needed properties and constants. Hopefully you are now comfortable with that. If so, let’s explore different ways to enter term lines.

### Type the entire term it at once

Open a new Stock Screener page. It shows one empty box. Enter the following in the box while carefully observing the use of capital letters and spaces: PE<10 and mc>7b. Press return. Almost everything we spent the whole first lesson entering pops up on the screen. Wow, you say!

Note that there are no spaces in the conditions that go on a line but there is a space surrounding the word “and” when entering the shortcut.

So let’s enter the second lesson’s screener: isp/iss>5 and clo*isp>40000. Press return and the whole second lesson pops up. Or does it? Look more closely and you see that the “is” family brings up both “insiders” and “institutions.” The program picked the top choice: insiders. You can still be ahead of the game by quickly clicking on them and picking the correct choice.

This super shortcut is for more advanced players, obviously. Some short property names like PE get tangled up with operators like percentile—there aren’t enough letters for the program to pick correctly, but capital PE gives it no choice. Likewise Close works if you type clo but gives you classify if you just type cl.

Have fun; play with the super shortcut when you know the shortcut names for the properties you are working with and you will save a lot of time.

### Constructing Terms in stages

Next, say you are hell-bent to enter your term’s arguments from left to right. Or even more challenging, say you want to expand an existing argument with some sort of calculation that needs boxes for properties and operators. You can, but let’s go through what you will see and what the rules are.

A firm grasp of the rules of Equihack grammar will keep you out of trouble. You already know all the basic players and rules, but now you will be asking them to find their seats at the table a different way. Think of it as constructing a building. Up to now we have been working from an architect’s plan. What follows is like adding a room on the back of the building, redesigning rooms inside the building and in some cases, replacing the foundation of the building. Do it with an understanding of the rules of the game: no problem. Do it sloppily: the building may collapse.

The basics: Equihack consists of numbers and instructions. The numbers come from stock records or constants you enter. The instructions come from a list of 70 or so choices. The numbers, whether called a property, constant, variable, formula or period of time, hover around the instructions that tell them what to do. We call the instructions “operators”—the wheeler-dealers that lay out the rules of the game.

The 70 or so operators are all listed together in alphabetical order. Like a meeting of staff in a hospital, some have long white coats on, others are dressed in multicolored jackets, others are in scrubs and some have ties on. So it is with Equihack’s operators. Some are like labor and some are like management. The labor takes action like adding numbers together. The management defines strategy and tactics such as sizing up relative values and making decisions.

Let’s breakdown the operators into these groups:

• Arithmetical: add, subtract, multiply and divide. They are laid out on the screen as number-operator-number in most situations. When they are called to action, they produce a single number (named a variable or formula in some cases as you shall see).
• Boolean: greater than, less than, equal to and not greater, less or equal. They are at the heart of a term and are surrounded by simple numbers or complex calculations on each side of them.
• Connectors: “and” and “or”. They define how multiple terms are resolved—everything must agree or just one thing is needed. A master connector is usually in place for all arguments that follow, but they can be scattered among the arguments, too.
• Complex connectors: Like the “and” and “or” above, some operators can reside in the top tab and dictate the work done by all the terms below. “Count” and “Sum” are just two examples. More about this later…

There is no problem replacing an arithmetical operator with another arithmetical operator, or a basic Boolean with another basic Boolean, or a connector with another connector. However, things need to be restructured when you try to cross-replace operators—you don’t replace a surgeon with a financial officer in a hospital. If you need a new space for the financial officer, you want to change the layout of the hospital to not disrupt the operating room. So it is with Equihack’s layout.

If you are already a multi-lingual computer geek, this is all pretty obvious. If you are an expert using other stock screeners where the arguments must fit into an existing grid, this flexibility never came up. Because Equihack falls in the middle, you have to be careful when asking it to restructure an existing term that has already been approved. Learn to do it correctly and you will have no problems. Let’s dive in.

As you have seen, there is no problem replacing most properties with another property. This also applies to all the numerical values whether they are called constants or variables or formulas.

An exception to all this is made in order to let you add more fields to a term. You type over a numerical property with an operator. On the face of it, it is like putting a chainsaw in the chair reserved for a person. But Equihack accepts it and will call in the construction team to expand the layout of the argument to make everything work.

Here is one scenario from the second lesson’s basic screener: “purchased/sold > 5” as you may remember. On a new Stock Screener page enter isp in the blank box and select the institutions choice. The program automatically gives you three items: the Market Cap property, a > Boolean and a new empty box. The > Boolean and empty box were gifts from Equihack to form a valid term—a complete sentence with a subject, verb and object.

You are permitted to expand this simple term. The first change needed is to add a divide operator between the Institutions Shares Purchased property and the > Boolean >. You want to work on the numerical field, not the Boolean. You want to increase the length of the numerical property by adding a divide operator and the name of another property to be the divisor. This is easy to do, but the first time through may worry you.

Left click the box showing Market Cap and enter a /. The property name will disappear. Not to worry. Press return and you will see three new elements (Market_Cap / a blank box).

Now you can enter is in the new blank box and select Shares sold to correctly state the calculation you want.

You can split and expand any numerical value this way to create a new calculated value in the screener line. Don’t worry when your work disappears momentarily while the new structure is being created.

You accomplished this by “typing over” the original number’s name with an operator. You could have taken the drop down menu choice of “insert > insert operator” which would have moved your focus and cursor to the Find by box on top of a list of all operators in the bottom half of your screen. This allows you to search for and double-click on the operator you want or to drag it to the box in your term that you are expanding. In this case, these results are the same as simply typing over the property with your desired operator.

Let’s do it again. Let’s multiply everything by 2. Click on the Purchased value you see you can add an * and a 2 in the empty boxes provided. Equihack magically surrounds the equations with parentheses in exactly the correct place.

An option that may help: you can drag a property from a full box to an empty box. This is helpful if the shown numerator should be the denominator or you want to expand a term to the left. Dragging may bounce back unless you place it carefully in the empty box.

While on the one hand you may not feel you have gotten very far with all these lessons, be assured that you have. We are almost ready to give you the keys to the car (or perhaps the motor scooter). Before we finish we trust you will be ready to fly away in the plane parked on your desk. The first lesson showed you how to create a basic two-line screener. The second lesson showed you how to analyze and change the results you are getting. Then you were shown how to create more complex terms. Next we will do battle with mixing ands and ors, another way to expand your terms.

#### Mixing Ands and Ors.

A “term” is normally another line of tests and values in your screener. “Arguments” are all the details in the “term”—the properties, operators, contants, and, most importantly, child terms. If you click the circled green plus icon to the right of the top tab called “Stock Screener,” you will add another “term”.  You saw all this in the first two lessons.

Most terms are connected together with either “and” or “or”. When connected with “ands” all the terms must be true for the screener to select a particular stock. If connected together with “ors”, stocks will be selected if any of the terms are true.

Click the purple “Match all the following” words at the top. Normally it will open a box with “and” in it. Should you want to connect your terms with an “or”, this is the place to type it. The description will change to “Match any of the following”.

Suppose you want to mix your “ands” and “ors”? You set the top value to one of the words and insert the other choice line-by-line as needed. This lesson will show you how. If you don’t follow the rules carefully, Equihack may get confused and treat your request harshly.

An aside: you may already know it, but if you don’t like what is created, enter Ctl+Z to undo your last step. You can undo multiple times working back in history. There are even deeper backup options standing by ready to help you. We’ll go there a little later.

Another aside: You will see that it is possible to have several terms on one line of screener code or the same thing can be accomplished if each term is on a separate line. Don’t worry, Equihack controls that housekeeping issue—your display may switch from one line to multiple lines for clarity, but the tests are the same.

Let’s get to work by entering a rather simple-minded two-line screener:

Market_Cap > 30b

PE > 75

Equihack will default to connecting these two tests together with “and” shown at the top. Click GO to see the results. OK, that tells you something.

Now what if we want stocks with a very high PEG of 3 too. You could replace the first test with the PEG test, run it again and combine the results with the PE test by hand. Don’t do that. Instead add the PEG test following an “or”; the best of both worlds.

Left click the > Boolean operator in PE > 75. Follow these choices in the pop-down boxes: insert … and … a or b. Click on the “a or b” choice.

Your original PE > 75 is now enclosed in parentheses, a purple “or” has been inserted followed by a blank box where you can build the PEG test: (PE_to_EPS_Growth > 3).

Let’s talk about “inserting” and “typing-over”. We have been using the word “insert” to enter properties and commands into blank boxes, boxes with question marks and to replace something that is already there. There is a difference between using “insert” to replace a number (properties and constants) in a box and the more powerful “insert” an operator, because operators add more boxes to the term.

To use “insert” an operator that will create more boxes on the line, do it by:

• selecting the correct choice on the “insert” drop down menu, or
• clicking Editor … edit term … (+) add argument, or
• entering Shift-Control-A, or
• pressing the Insert key.

In this case we see the word “argument” being used to add an “operator” in a line. The “argument” being added may result in a new line if your cursor is at the end of the line being worked on--adding a “condition”. The results are the same.

If you just “type over” the existing comparison Boolean with an “and” or “or” Connector, you won’t get the right results.

## Complex Term Reference

### Type the entire term it at once

Our program allows you to type your entire term in at once than enter it in.

In the Editor we will type " close / open > 1"

### The "Add another condition" button

becomes:

CONTROL + SHIFT + A - Adds another Operator

## Variables and Tabs

The "New Tab" icon in the bottom right of the Editor will create an extra tab and you will be asked to name it.

After you create a new tab you can enter it into the main editor as a variable

## Cutting and Pasting

We support normal cut/paste operations using the normal keyboard short cuts as well as menu items.

We also  support cutting  multiple term  in a row and then pasting  them in a row.

OR

Cut a Tab and paste it into the main editor