tma

tma(series, period)
Parameters
  • source (series) – Input series

  • period (numeric) – MA period

Returns

series

Returns the triangular moving average of source for the period bars. If there are less than \(2\mathrm{period} - 1\) values in the series - the result is nan. The first value of ssma is calculated as sma(series, period). Subsequent values are calculated according to the formula:

\[\mathrm{tma} = \frac{\sum_{i=0}^{\mathrm{period}-1} \mathrm{sma}_i(\mathrm{series},\mathrm{period})}{2 \mathrm{period} - 1}\]