Percentile (Function)

image\trumpet2.gif Disclaimer

The Percentile function returns a price value at the boundary of the specified percentile level.

Syntax

Percentile(PcntRank, Price, Length)

Returns (Double)

A numeric value containing the percentile (k-th value) of a specified period, as defined by Price and Length.

Parameters

Name

Type

Description

PcntRank

Numeric

Sets the percentile to be considered using a decimal value between 0 and 1.  Enter .25 for %25.

Price

Numeric

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

Length

Numeric

Sets the number of bars to be considered.

Remarks

The Percentile value that is returned is at the point in the Price data series where a specified percentage of the prices are below the PcntRank level.

Example

Assigns to Value1 the value of the 25th percentile, based on the Closing prices of the last 10 bars:

Value1 = Percentile(.25, Close, 10);

Assigns to Value2 the value of the 50th percentile, based on the Range of the last 21 bars:

Value2 = Percentile(.5, Range, 21);