HarmonicMean (Function)

image\trumpet2.gif Disclaimer

The HarmonicMean function calculates the harmonic mean of prices over a range of bars.

Syntax

HarmonicMean(Price, Length)

Returns (Double)

A numeric value containing the HarmonicMean of a data set.

Parameters

Name

Type

Description

Price

Numeric

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

Length

Numeric

Sets the number of bars to consider.

Remarks

The harmonic mean is the reciprocal of the arithmetic mean of reciprocals. The harmonic mean is always less than the geometric mean, which is always less than the arithmetic mean.

Example

The following EasyLanguage expression will perform an action when the fast harmonic mean is greater than the slow harmonic mean:

If HarmonicMean(Close, 10) > HarmonicMean(Close, 20) Then {ACTION} ;