Home/Dovee/Function reference

trima

Triangular moving average

Reference/Moving averages/Function

trima(source, length)

SMA of an SMA — extra smooth, more lag. Short form `trima(9)` uses close.

Parameters

NameTypeDescription
sourceoptionalseries
default close
Series to use. Omit it when the first argument is a number — ema(9) means ema(close, 9).
lengthint
default 9
Lookback in bars. Default 9.

Return value

series

Short form: if the first argument is a number, Dovee uses close as the source.

Example

line = trima(close, 9)
plot line as "Triangular moving average"

See also