Print Page  
MISC / UTILITY
SetVar(@myvar,expression)
Full Description

SetVar, ShowVar, and the : operator define new variables that can then be used in subsequent rules. In addition, ShowVar and the : operator will add columns to the screener report so you can see and download the values.

@name:formula or @name:(formula)
Defines variable @name and sets it to the value of formula, where available. The operator binds to the nearest element to its right or the contents of parentheses if used. It is lower in precedence only to the power operator, ^.
The operator returns the value of the formula, which could be 0 or NA.

SetVar(@name, formula)
Defines variable @name and sets it to the value of formula.
SetVar always returns TRUE.

ShowVar(@name, formula)
Defines variable @name and sets it to the value of formula, where available. When used in the Screener, it adds a column to the report called @name.
ShowVar always returns TRUE.

Use Cases

ShowVar & SetVar are typically used to set variable names that are used in subsequent rules. Since they always return TRUE, they never screen out any stocks.

ShowVar and the : operator can be used to inspect values returned from functions in screen reports and downloads.

The : operator is a convenient option for showing the values of components of a formula as they can be easily slipstreamed.

Examples

Set the variable to the 1 Week return and use it for screening. If used in the screener, no column is created in a screen report.

SetVar(@1wkRet, Ret%Chg(5))
@1wkRet > 10

Screen for stocks whose MktCap is greater than the median MktCap and show the median in a screen report.

MktCap > @med:FMedian("MktCap")