Stock Screener – Example 2: Multiple Time-Frame (“Set periodicity to…”)

This is an example of an optimized scan that demonstrates the enhanced “Set periodicity to…” function; it can replace the need for writing several scans (as was required in the older versions of ChartAlert); this functionality for the Advanced Scanner will be introduced in October 2023

3 minutes

This functionality will be 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 now replaces the need for writing three separate scans (for daily, weekly and monthly time-frames) as was required in the previous versions of ChartAlert.

[BEGIN RSI(14) crossed above 70 - Interval]

Set OptVar Interval = Daily, Weekly, Monthly

List symbols where RSI(14) crossed above 70

Add Column Close
Add Column RSI(14) chart

Apply to NIFTY500

Set periodicity to Interval

[END]

Below is a breakdown of the scan presented in a step-by-step manner.


Purpose of the Scan

  1. To generate a list of symbols where RSI(14) or the 14-bar Relative Strength Index has just crossed above the 70 threshold across three time-frames: daily, weekly and monthly.
  2. To display the values of the latest Close and the 14-bar RSI indicator in the scan results report.
  3. To scan the components of the following index: Nifty500.

Let’s go!


Line 1

[BEGIN RSI(14) crossed above 70 - Interval]

The optimized scan procedure starts with a “BEGIN” command.

The text “RSI(14) crossed above 70 – Interval” that comes after the “BEGIN” command serves as the designated heading for the scan results that will be showcased in the scan report.

The term “Interval” functions as a temporary marker or placeholder within the scan heading and will be substituted with terms like “Daily,” “Weekly,” or “Monthly,” in the scan report.

You can customize the term “Interval” with anything of your choosing . . . For example, you can globally replace the term “Interval” with (say) “TF” in the scan, and the scan results will still be the same.

“RSI(14) crossed above 70 – Interval” is designed to work like this: RSI(14) crossed above 70 – Weekly


Line 2

Set OptVar Interval = Daily, Weekly, Monthly

We are configuring or setting an optimized variable (“Set OptVar” ) that will be referred to as “Interval” .

Remember, you can customize the term “Interval” with anything of your choosing.

This variable “Interval” will encompass distinct time-frames, namely “Daily,” “Weekly” and “Monthly”.

In essence, upon execution, this scanning process will sequentially navigate through daily, weekly and monthly time-frames.


Line 3

List symbols where RSI(14) crossed above 70

This scan will generate a list of symbols where the value of “RSI(14)” has recently crossed above the “70” threshold.

The scan will navigate across the mentioned time-frames (Daily, Weekly and Monthly) looking for symbols where this specific condition has been met.

Here, “RSI(14)” refers to the RSI indicator with a setting of 14-bars . . . In the context of daily, weekly and monthly time-frames, this would mean 14-days, 14-weeks and 14-months, respectively.


Line 4 and 5

Add Column Close
Add Column RSI(14) chart

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 two columns: the latest closing value, and the latest value of the RSI indicator.

These columns will be titled “Close” and “RSI(14)”, respectively.

The function “chart” will simply plot the mentioned indicator on the chart of the resultant symbol in ChartAlert.


Line 6

Apply to NIFTY500

The “Apply to…” function applies the scanning process to a segment defined in the scan . . . In this particular context, the scan will effectively examine all constituent elements of the Nifty500 Index.


Line 7

Set periodicity to Interval

The “Set periodicity to…” function applies the scanning process to the periodicity of the date being examined.

As mentioned earlier, “Interval” represents an optimized variable, and is designed to indicate 3 time-frames, namely Daily, Weekly and Monthly.

In other words, the scan will effectively examine all the constituent elements of the Nifty500 Index across these 3 mentioned time-frames.


Line 8

[END]

The optimized scan code concludes with an “END” statement.


The Scan Report in ChartAlert

%d bloggers like this: