Stock FilterLet's create a custom quote page of Nasdaq stock symbols which match the following criteria:
Last of all, sort the list by volume in descending order. Several power ESPL functions make this a fairly easy task. We are having these lessons because an example is a great teacher. Once you see how the script is written, it is hoped you can adapt it to serve your specific interests. Cut the script from this page and paste it in the ESPL Script Editor window. Click on button #5 on the script editor to execute. var i: integer; Notes: The test of who=5 causes this script to execute when the #5 button is clicked. The Find(eNasdaq) repeat...until statements cycle through every symbol in the Nasdaq database. The Filter function implements the three tests in our criteria. The writeln statement prints the symbols and the volume aligned in columns in the Output window. The Output(eSort function sorts the data by volume in descending order. The Ouput(eSave writes the data to a file, but we still need to strip off the volume information. Therefore, the file is read into a string list so it can be manipulated. The for loop extracts just the symbol portion of each line, and the string list is resaved to the file. The Quote function will load and display our sorted custom quote list. If you do not understand a particular function, then please consult the ESPL Help documentation for the function. The basics of what is being done for the database scan is discussed in greater detail in the documentation as 'Writing a Database Scan' example. |