mean

Statistical Mean (same as SMA)

mean(source, period)

Parameters

Statistical Mean - mean(source, period)

Calculates the arithmetic mean (average) over a period. Identical to SMA.

  • source (source): Data series to calculate mean of
  • period (int): Number of periods for averaging
  • Common values: 14, 20, 50

Formula


Mean = Σ(field) / period

Examples


// price above 20-period mean
close > mean(close, 20);

// volume above 50-period average
volume > mean(volume, 50);

Returns

Arithmetic mean value