Navigation: ScanExpert Wizard > Conditions and Alerts > Add/Edit Conditions Dialog

Add/Edit Conditions Dialog

Top  Previous  Next

The Add/Edit Conditions dialog is one of two methods that you can use to add conditions (and alerts) to your script. The other method is to use the Expression Builder dialog. You can use either approach and ultimately they both accomplish the same task. The difference between the two is as follows:

 

Add/Edit Conditions

Select the studies to be included in the condition from a list and type the actual  condition logic. You are responsible for all formatting. Very complex conditions will need to be created using this method.

Expression Builder

Create an condition using a point-and-click approach. Expression Builder takes care of all formatting. This method should be suitable for creating most conditions that you are likely to need.

 

This Add/Edit Conditions dialog is comprised of  3 sections:

 

Available Studies List

 

Alerts_AddEdit1

Available Studies list in the Add/Edit Conditions dialog

 

Situated on the left side of the Add/Edit Conditions screen, the Available Studies list contains a list of all of the studies that are available to be used within any condition that you create. This list is comprised of all of the studies you added into the Layout Grid as well as the standard data points (i.e., Open, High, Low, Close, HL/2, HLC3/, OHLC/4, and Volume). This list is divided into two columns. The column on the left displays the internal name of the study (i.e., the name actually used by the condition) while the column on the right displays the common name, which helps you to identify the study.

 

For example, the Close data point has a common name of "close" while the internal name is "Symbol.close". When using Close in any conditions you define you would use the internal name of "Symbol.close". Any studies that you added to your Layout Grid will have an internal name that references their row location in the Layout Grid.

 

For example, the LSMA study that you can see in the snapshot above has a common name of "leastSquaresMA" while the internal name is "Study04". When using this LSMA in any conditions you would use the internal name of "Study04".

 

To select an item from the Available Studies list, just double-click on that item and it will be moved over to the Expression Edit area.

 

 

Expression Edit Area

 

Alerts_AddEdit2

The editor in the Add/Edit Conditions dialog where you can type in your conditions

 

Situated just to the right of the Available Studies list, the Expression Edit area is a small text editor in which you can type your conditions. Typically you would select all of the items from the Available Studies list that you intend to use in your condition and then type in any additional logic and operators that are required in the Expression Edit area.

 

The available conditional operators are:

 

>

Greater than. For example: Symbol.close.getValue(0) > Symbol.close.getValue(-1) which stipulates that the current Close must be greater than the Close of the prior bar.

>=

Greater than or equal to. For example: Symbol.close.getValue(0) >= Symbol.close.getValue(-1) which stipulates that the current Close must be greater than or equal to the Close of the prior bar

<

Less than. For example: Symbol.close.getValue(0) < Symbol.close.getValue(-1) which stipulates that the current Close must be less than the Close of the prior bar.

<=

Less than or equal to. For example: Symbol.close.getValue(0) <= Symbol.close.getValue(-1) which stipulates that the current Close must be less than or equal to the Close of the prior bar

=

Equal to. For example: Symbol.close.getValue(0) = Symbol.close.getValue(-1) which stipulates that the current Close must be equal to the Close of the prior bar.

AND

Used to combine conditions. For example: (Symbol.close.getValue(0) = Symbol.close.getValue(-1)) AND (Symbol.close.getValue(0) >Symbol.close.getValue(-2)) which stipulates that the current Close must be equal to the Close of the prior bar AND the current Close must be greater than the Close of two bars ago. Both conditions must be true to satisfy the statement. Typically you would use parentheses to enclose both conditions.

OR

Used to combine conditions. For example: (Symbol.close.getValue(0) = Symbol.close.getValue(-1)) OR (Symbol.close.getValue(0) >Symbol.close.getValue(-2)) which stipulates that the current Close must be equal to the Close of the prior bar OR the current Close must be greater than the Close of two bars ago. Either condition can be true to satisfy the statement. Typically you would use parentheses to enclose both conditions.

 

You can also use standard mathematical operators in conjunction with the operators discussed above to create more complex conditions. Make sure that you use parentheses liberally to enclose and clearly define each condition. So, for example, you could create a condition such as:

 

(Symbol.close.getValue(0) + Symbol.close.getValue(-1)) < (Study04.getValue(0) * Study06.getValue(0)) which stipulates that current Close plus the prior Close must be less than the value of Study4 multiplied by the value of Study6.

 

 

Note: Whenever you type in a new condition or modify an existing condition, always click on the Syntax Check button to proof your work. Any logic or structure errors will be identified for you.

 

 

 

Alert Text Edit Area

 

Alerts_AddEdit3

The editor in the Add/Edit Conditions dialog where you can type in your alert text

 

Situated just below the Expression Edit area, the Alert Text Edit area is where you designate a condition as an alert condition (check the Alert? checkbox) and then type in the descriptive alert text that will be displayed whenever this particular alert is triggered. Just click in the edit window and type in any text that you want. You can use HTML formatting codes to enhance the alert text if desired.

 

For example: <b>Bullish Price!</b> would format the alert text "Bullish Price!" in bold whenever it is displayed in an alert window.

 

Once you have finished entering your condition(s) as well as your optional alert text, click on the Syntax Check button to check your work. The click on the Done button to close the Add/Edit Conditions dialog and return to the ScanExpert Wizard.

 

See also:

 

Expression Builder Dialog

Viewing Alerts