|
Navigation: ScanExpert Wizard > Conditions and Alerts Conditions and Alerts |
Top Previous Next |
The ScanExpert Wizard module can be used to create user-defined conditions and these conditions can then be implemented as alerts and/or displayed as columns in the ScanExpert Viewer Grid. You can add up to 20 conditions for each individual script.
Note: Filters have their own alerts system and Filter alerts are completely independent from any alert conditions that you include in your scripts.
Creating Conditions
| • | To create conditions, you must first select some studies and add them into the Layout Grid in the ScanExpert Wizard (see Creating a New Script). Once you have set up your columns, right-click in the Conditions Grid in the Wizard and select the Add new Condition option from the pop-up menu. The Add/Edit Conditions dialog will be displayed. |

Right-click in the Conditions Grid to display the Add/Edit Conditions dialog
| • | You can use the Add/Edit Conditions dialog to type in one or more conditions from scratch. Once you become familiar with the ScanExpert scripting language this may become your preferred method. However the easiest way to create a new condition is with the Expression Builder dialog. Click on the Expression Builder button at the top-right of your screen to launch this dialog. |

Expression Builder dialog
The Expression Builder uses a point and click approach to create one or more conditions. First you select a Logical Expression Type and then you select the sources for the condition. You can repeat this process and build complex expressions by using the AND and OR operators. Let's walk through an example.
| • | For this particular script we want to build a condition that will evaluate to true whenever the Close is above the LSMA and the Close is also above the Close of two bars ago. So this alert will have two conditions: |
| 1. | Close > LSMA; and |
| 2. | Close > Close[2] |
| • | To get started with the first condition, click on the Select Logical Expression Type field and select the ValueA > ValueB option. We will select the Source for ValueA as the Close and the Source for ValueB as the LSMA. Our screen now looks like this: |

Use the drop-down edit fields to build your conditions
Note: The available sources for any condition include all of the studies currently defined in the Layout Grid (see Wizard Screen Layout) as well the standard data points (i.e., Open, High, Low, Close, HL/2, HLC/3, OHLC/4, and Volume).
| • | Our first condition is complete so we will click on the AND button. This tells Expression Builder that we have another condition that we wish to enter. To enter the second condition we will repeat the process. We will select ValueA > ValueB as the Logical Expression Type. For Source for ValueA we will select Close and for Source for ValueB we will also select Close. In the Select Bar Offset field for ValueB, we will change the 0 to a 2 because we want to compare the current close (in ValueA) to the close of 2 bars ago (in ValueB). Our screen now looks like this: |

Use the AND and OR buttons to create complex conditions
| • | If needed, we could continue this process, using AND or OR to join the additional conditions. |
| • | We are done with our condition definition so we will click on the Done button which will return us to the Add/Edit Conditions dialog. Our condition logic has automatically been added into the Expression Edit area. If needed, we could manually edit the condition logic from here. |
| • | If we want to implement this condition as an alert, all that is left is to check the Alert box and type in some alert text. This is the message that will be displayed in the ScanExpert Viewer whenever this alert is triggered (if the Enable Visual Alerts option is currently toggled on in the Grid Options menu). We will check the Alert box and type in "Bullish Price" for the alert text. |

Check the Alert box and type in the alert text.
| • | Now click on the Syntax Check button to check our work. |

Run a syntax check to check your work
| • | There are no errors so we can click on the Done button and return to the ScanExpert Wizard, where our new condition is now displayed in the Conditions Grid. |

Completed condition is displayed in the Conditions Grid
| • | The condition we just created is configured to generate an alert whenever the condition evaluates to true. The alert associated with this condition can be turned off at any time just by un-checking the Alert checkbox in the Conditions Grid. |
Note: To edit an existing condition, just double-click on that condition in the Conditions Grid, or right-click in the grid and select the Edit Selected Condition option from the menu. To delete a condition, select that condition in the Conditions Grid and then right-click and select the Delete Selected Condition option from the menu.
| • | From here we can repeat the process to create additional conditions or just save our script. Here is the condition that we created as it is defined in the actual script that was generated by the Wizard. You can see that a function was generated for the actual condition and a separate function was created for the alert which, in turn, calls the conditon function: |

Alert condition as seen in the ScanExpert Editor
| • | Each time the script is called it will check for our condition (i.e., is the current Close price greater than the value of the LSMA AND is the current Close price greater than the value of the Close two bars ago). If the condition evaluates to true (and since we have specified this to be an alert condition), an alert will be generated in the ScanExpert Viewer Grid. At that point, the alert will be reset and will not be generated again until the condition is NOT true for at least one cycle and then becomes true again. This logic prevents alerts from repeatedly triggering if they remain true. |
| • | The results of a condition can also be displayed in the ScanExpert Viewer Grid. By default, a condition will return the text string "True" if the condition evaluates to true, and return nothing if the condition evaluates to false. |
To display the results of a condition in the ScanExpert Viewer Grid:
| • | You must first create one or more conditions as per the steps outlined above. |
| • | Add a user condition item into the Layout Grid. |

| • | Double-click on that user condition item and select the condition that will be displayed in this column. |

| • | Adjust the Title text and repeat the process for as many conditions as you want to display in the grid. |
Controlling Alerts
Whether or not alerts (audible and/or visual) are actually generated in the ScanExpert Viewer Grid is controlled by the current settings in the Grid Options menu (see ScanExpert Viewer Toolbar).
| • | If Enable Audible Alerts is checked in the Grid Options menu then a WAV file will be played each time an alert is generated in the Grid. The specific WAV file that will be played is selected on the Options page of the Configuration Manager. |
| • | If Enable Visual Alerts is checked in the Grid Options menu then a visual alert will be displayed each time an alert is generated in the Grid. |
| • | If neither option is checked then no alerts will be generated (i.e., alerts will be processed silently in the background). |
See also: