This functionality was introduced in October 2023 (Version 23.10.1)
Below is an illustration of an optimized scan that can be created using the Advanced Scanner in ChartAlert.
This one enhanced scan, wherein a parameter can now accept multiple values/ inputs for scanning, now replaces the need for writing atleast four separate scans as was required in the previous versions of ChartAlert.
ATTN: This scan is similar to an earlier scan (refer to Example 8: Multiple Parameters Multiple Inputs; Yearly Price Performance (“Set report type to…”)), with the exception of certain filters being applied and 3 month price performance being scanned.
[BEGIN 3moPP chg1%-chg2%] Set OptVar chg1 = -90, 0, 25, 50 Set OptVar chg2 = 0, 25, 50, 1000 List symbols where Chg%(cl, cl 3 months ago) >= chg1 and Chg%(cl, cl 3 months ago) < chg2 and close > 100 and volume > 100000 and trades > 1000 Add Column Chg%(cl, cl 3 months ago) as chg% Sort on Column chg% desc Add Column volume Add Column TRADES Apply to NIFTYTOTAL [END] set reporttype to summary
Below is a breakdown of the scan presented in a step-by-step manner.
Purpose of the Scan
- To generate a list of symbols where the latest Close, when compared to the Close 3-months ago, has moved between -90% and +1000%, and further categorize the scan results into four groups such as -90%-0%, 0%-25%, 25%-50% and 50%-1000%.
- To sort in a descending order and display the 3-month percentage change based on the latest closing price in the scan results report.
- To also display the day’s traded volume and the number of trades of that day in the report.
- To scan the components of the following index: NIFTYTOTAL
- To list the scan results as a summary report: the scan output will be listed as the number of qualifying symbols under each NSE Index available in ChartAlert.
[BEGIN 3moPP chg1%-chg2%]
The optimized scan procedure starts with a “BEGIN” command.
The text “3moPP chg1%-chg2%” that comes after the “BEGIN” command serves as the designated heading for the scan results that will be displayed in the scan report.
See Lines 2 and 3 below to know how how “chg1” and “chg2” will get used in the scan.
Lines 2 and 3
Set OptVar chg1 = -90, 0, 25, 50 Set OptVar chg2 = 0, 25, 50, 1000
We are configuring or setting multiple optimized variables (“Set OptVar”) that will be referred to as “chg1” and “chg2”.
The variable “chg1” will function as a temporary marker or placeholder within the scan heading and will be substituted with terms like “-90,” “0,” “25” and “50” in the scan report.
Similarly, the variable “chg2” will also function as a temporary marker or placeholder within the scan heading and will be substituted with terms like “0,” “25,” “50” and “1000” in the scan report.
The number of inputs each variable can accept should be identical . . . in the current scan context, both the variables “chg1” and “chg2” accept four inputs each.
You can customize both the terms “chg1” and “chg2” with anything of your choosing . . . Just remember to globally replace them for the scan to work.
See the section below to know how “chg1” and “chg2” get used in the scan.
Lines 4 through 9
List symbols where Chg%(cl, cl 3 months ago) >= chg1 and Chg%(cl, cl 3 months ago) < chg2 and close > 100 and volume > 100000 and trades > 1000
This scan has two primary conditions at its core, “Chg%(cl, cl 3 months ago) >= chg1” and “Chg%(cl, cl 3 months ago) < chg2”, and it will generate a list of symbols where both the conditions have been met.
Thus, this scan will look for symbols where the change (“Chg%()”) in close (“cl”) over the past 3-months (“cl 3 months ago”) in percentage terms is greater than “chg1” percent, AND where the change (“Chg%()”) in close (“cl”) over the past 3-months (“cl 3 months ago”) in percentage terms is less than “chg2” percent.
The parameters/ variables “chg1” and “chg2” will encompass four settings each. With reference to the previous section, in essence, upon execution, this scan code will sequentially use “-90%-0%,” “0%-25%,” “25%-50%” and “50%-1000%” as input to look for symbols where the above mentioned specific conditions have been met.
The scan also has three secondary conditions, the closing price of a symbol is greater than Rs100 (“close > 100”), the traded volume is greater than one lakh of shares (“volume > 100000”) AND the number of trades executed to trade the day’s volumes is greater than 1000 (“trades > 1000”).
Thus, this scan code will generate a list of symbols where all the above five conditions have been met.
Lines 10 through 13
Add Column Chg%(cl, cl 3 months ago) as chg% Sort on Column chg% desc Add Column volume Add Column TRADES
In this scan, the function “Add Column…” serves the purpose of displaying additional columns within a scan report.
In this case, the scanning report will display three columns, the change in close over the past 3-months in percentage terms (“Chg%(cl, cl 3 months ago)”), the traded volume of the day (“volume”), and the number of trades of the day (“TRADES”).
These columns will be titled “chg%” (a customizable name), “volume” (default name) and “TRADES” (default name), respectively.
The column titled “chg%” will also be sorted in a descending order (“Sort on Column chg% desc”).
Apply to NIFTYTOTAL
The “Apply to…” function applies the scanning process to the “NIFTYTOTAL” Index, and the scan will effectively examine all the constituent elements of NIFTYTOTAL.
The optimized scan code concludes with an “END” statement.
set reporttype to summary
The “Set report type to…” function will empower users to determine the manner in which the scan results will be displayed.
Choosing the “summary” option presents the scan results in a summarized/ concise report format.
This summary report categorizes and lists the eligible ‘number of qualifying symbols’ under each official NSE Index available in ChartAlert . . . To explore further, you can click on the mentioned ‘number’ to view the specific list of symbols identified by that NSE Index.