Navigation: Introduction > Developing Study Formulas

Developing Study Formulas

Top  Previous  Next

Developing a new ScanExpert study formula involves several steps:

 

Spell out the requirements of your new study formula on paper and determine:

 

what calculations need to be performed;
what input parameters will be required, and of what type;
how many input streams will be required;

 

Review the functionsSystem.pas study configuration file to see if you can possibly derive your new study formula from study declarations that already exist in that file. If not, then determine how many study formulas you will need to deliver all of the information. A ScanExpert study formula returns a single TEStream object. If you are developing a technical analysis indicator that returns multiple values then you will need to create a study formula for each value returned (see the dsBollinger study formulas in the Studies folder for an example of this, or review the Wilder section in the functionsSystem.pas file).

 

Search through the existing study formulas (in the ScanExpert Studies folder) for one that is as close a match as possible for the new study formula that you want to create. Using an existing study formula as a template should save you a lot of time when it comes to testing and debugging.

 

Write the study formula logic (or preferably use an existing study formula as a template) and save it as a Pascal source file (.pas) in the ScanExpert Studies folder. Be sure to give your file a descriptive and unique name. Use a file name prefix, if possible, so that you can quickly identify your custom study formula files in the future. See Anatomy of a Study Formula.

 

Edit the custom study configuration file to add a declaration for your new study (i.e., register the study formula with the ScanExpert system). This file is called functionsUser.pas and can be found in the ScanExpert Studies folder. See Register a Study Formula.

 

Edit the custom study help file (optional) to add parameter and usage information that will be displayed in the Wizard when your new study is selected. This file is called studyInfoUser.txt and can be found in the ScanExpert Studies folder. See Add Parameter and Usage Information.

 

Test your new study by using the Wizard to create a small script calling just your study formula and then loading this script into the ScanExpert Viewer along with a very small portfolio of symbols.

 

 

Anatomy of a Study Formula

Register a Study Formula

Add Parameter and Usage Information

Importing Study Formulas