There are several arithmetic functions that you can use to modify the expressions in your scan. For more information on writing scans using these and other types of scan syntax, please see our Support Center article on Writing Scans.

The Absolute Value of the expression.

**Syntax:**

- AbsVal(exp)

**Parameters:**

- exp - expression

**Example:**

- [AbsVal(MACD Hist(12,26,9)) > 3]

The number of periods in the specified timeframe where the value has decreased for the given expression such as “close”, “volume” or “rsi(14)”.

**Syntax:**

- [Count Down(nPeriods, exp)]

**Parameters:**

- nPeriods - Number of periods in the timeframe
- exp - Values to be used in the calculation; default is Close

**Operators:**

- =, !=, >, >=, ⇐, <, x, is, is not

**Example:**

- [Count Down(20, close) > 10]

The number of periods in the specified timeframe where the value has increased for the given expression such as “close”, “volume” or “rsi(14)”.

**Syntax:**

- [Count Up(nPeriods, exp)]

**Parameters:**

- nPeriods - Number of periods in the timeframe
- exp - The values to be used in the calculation. The default is Close.

**Operators:**

- =, !=, >, >=, ⇐, <, x, is, is not

**Example:**

- [Count Up(20, close) > 10]

The highest value of the expression over the specified time period. See our Support Center article on Writing Min/Max Scans for more information.

**Syntax:**

- Max(nPeriod, exp)

**Parameters:**

- nPeriod - Number of periods
- exp - expression

**Example:**

- [Max(253,close) > 99.9]

The lowest value of the expression over the specified time period. See our Support Center article on Writing Min/Max Scans for more information.

**Syntax:**

- Min(nPeriod, exp)

**Parameters:**

- nPeriod - Number of periods
- exp - expression

**Example:**

- [Min(253,close) < 99.9]

The percentage change of the expression over the specified time period. See our Support Center article on Writing Percent Change Scans for more information.

**Syntax:**

- PctChange(nPeriod, exp)

**Parameters:**

- nPeriod - Number of periods
- exp - expression

**Example:**

- [PctChange(10,close) > 15]

The percentage difference between two expressions.

**Syntax:**

- PctDiff(exp1, exp2)

**Parameters:**

- exp1 - first expression
- exp2 - second expression

**Example:**

- [PctDiff(close,sma(50,close)) < 5]

The difference between the security's Percent Change (PctChange) value and the PctChange value of the specified symbol.

**Syntax:**

- [PctRelative(nPeriods, symbol, exp)]

**Parameters:**

- nPeriods - Number of periods
- symbol - The symbol to compare with when calculating the difference in PctChange values. Note that, in place of an actual symbol, the pseudo-symbols $sector and $industry can also be used to find stocks that are outperforming their sector or industry.
- exp - Values to be used in the calculation; default is Close

**Operators:**

- =, !=, >, >=, ⇐, <, x, is, is not

**Example:**

- [PctRelative(20,$spx) > 0]
- [PctRelative(20,$sector) > 10]

The number of periods in a row where the value has decreased for the given expression such as “close”, “volume” or “rsi(14)”.

**Syntax:**

- [Streak Down(exp)]

**Parameters:**

- exp - Values to be used in the calculation; default is Close

**Operators:**

- =, !=, >, >=, ⇐, <, x, is, is not

**Example:**

- [Streak Down(close) > 1]

The number of periods in a row where the value has increased for the given expression such as “close”, “volume” or “rsi(14)”.

**Syntax:**

- [Streak Up(exp)]

**Parameters:**

- exp - Values to be used in the calculation; default is Close

**Operators:**

- =, !=, >, >=, ⇐, <, x, is, is not

**Example:**

- [Streak Up(close) > 1]