|
Navigation: Function Reference > User Script Functions User Script Functions |
Top Previous Next |
Each user script that you create has two ScanExpert objects associated with it. Those are Symbol and Grid. The Symbol object allows you to access information from the underlying symbol that is being processed at the time your user script is called and the Grid object allows you to pass information back to the ScanExpert Viewer Grid. While it is certainly possible for you to write user scripts from scratch using the Editor, it is recommended that you use the Wizard to create all user scripts and then, if necessary, use the Editor to customize the user script to add features that are not possible via the Wizard.
A user script is broken down into the following sections:
| • | Initialization Section: This consists of the Initialize procedure that you will see at the top of each user script. This Initialize procedure is only run once, when the script is first processed by ScanExpert. There are only a handful of procedures that can be used from within the Initialize procedure, such as setColumnTitle() and addInterval(). |
| • | Global Variable Declaration Section: This is the section where all of the script global variables will be declared. These variables will span script iterations. Most of the variables declared in this section will be TEStream variables used to hold pointers to the various data streams (i.e., data points such as open, high, low, close as well as the output of study formulas) that are driving the grid. |
| • | Conditions Section: This is optional and is where any conditional functions are placed. |
| • | Alerts Section: This is optional and is where any alert functions are place. |
| • | Script Body: This is the main part of any user script and is where all of the variables are initialized, processed, and returned to the ScanExpert Viewer grid for display. |
A user script is called by ScanExpert each time any new data comes in for any of the Symbol/Interval combinations that may be driving the script.
The Symbol and Grid object methods that are available for use from within any user script are described in this section.