Let's looks at the following scan.....
SET(V#1, LRS) AND SET(V#2, CL-LO)
In this scan, we will be using the SET operator to set the values of the V#1 and V#2 custom data columns. Let's use a periodicity of Daily again for the scan, and choose an appropriate input quotepage on which to run the scan. The ".All Symbols" quotepage contains all the symbols defined in your system. If you are just getting started, you may want to select this one.
There are 20 available custom data columns which can be added to quotepages. These are columns that can be set to whatever the user chooses. The syntax of the SET operation is rather basic:
SET(property, expression)
Where the property is a property of an instrument that you would like to set, in our case, a custom quotepage data column, and expression is simply the value to which you would like to set it.
Now let's take a closer look at our scan expression. The first SET command will set the value of V#1 to LRS. LRS is a technical indicator representing the Linear Regression Slope, or the slope of the linear regression line. For the LRS Preferences, let's just use a Simple 10-Period Smoothing of the Close, and a Regression Period of 14. For additional information on the LRS indicator, click here. The SET command will set the V#1 value for all the instruments in the input quotepage to the current value of LRS. Similarly, the second SET command will set the data column V#2 to the difference or spread between the current price and the low of the day. At the instant this scan is executed, all the instruments in the quotepage will be assigned the appropriate values in the V#1 and V#2 data columns. These columns can be added to the quotepage on which the scan was run to view their results. The scan can be run as often as needed, or can be set to run periodically with AutoScan.
Each SET command results in a value of TRUE. Therefore, the result of the scan above would show an output quotepage of all instruments in the input quotepage. If you would like to prevent a resulting quotepage from appearing, you can accomplish this by simply using the NOT operator, or '!". In other words, change your scan to the following:
!(SET(V#1, LRS) AND SET(V#2, CL-LO))
Other uses of the SET command include setting the Previous Close value (PREV)....
SET(PREV, CL1)
...or setting the Volume Alarm and Volume Alarm Step values, and turning the volume alarm on....
SET(VOLALARM, 2*AVGVOL) AND SET(VOSTEP, AVGVOL/4) AND SET(MON, ALARM_VOL)
VOLALARM represents the volume alarm level. AVGVOL represents the 20 day average volume. VOSTEP represents the volume alarm step value. MON represents a monitoring flag ALARM_VOL is the component of MON regarding whether or not the volume alarm is turned on. By issuing the SET(MON, ALARM_VOL) command, we are turning on volume alarms for all the instruments in the input quotepage. In other words, we are checking the Volume checkbox in the Alarms windows for those instruments. Similarly if you would like to turn on the Intraday monitoring option for all instruments in your quotepage...
SET(MON, MON_INTRA)
Similarly, if you would like to turn off Intraday monitoring, simply put a minus sign in front of the MON_INTRA token...
SET(MON, -MON_INTRA)
Another useful SET operation is setting a custom column to the Tick Velocity (TV). The tick velocity represents the number of ticks per unit time based on the preferences you specify. You can run a scan like the following to set your custom data column...
SET(V#3, TV)
The SET command gives the user the power to set values for a group of instruments with one quick scan.
Now, let's look at a scan that will require the renaming of tokens...