SummationIf (Function)

image\trumpet2.gif Disclaimer

The SummationIf function performs a summation of price when a condition is true.

Syntax

SummationIf(Test, Price, Length)

Returns (Double)

A numeric value containing the sum of the last Length occurrences of Price if Test is True.

Parameters

Name

Type

Description

Test

Numeric

Specifies the criteria that must be true for summation to occur.

Price

Numeric

Specifies which bar value (price, function, or formula) to sum.

Length

Numeric

Sets the number of bars used in the calculation.

Remarks

The number of values in the series is determined by the input Length. The values added together are determined by the input Price. For example, if the inputs Price and Length were replaced by Close and 14, respectively, the function would add together the last fourteen closes.

  The current bar’s Price is included in the calculation, unless the function is offset.

Example

Value1 = SummationIf(High>Close[1], High-Close, 14);