Overlap studies

Triangular Moving Average

Center-weighted moving average with linearly tapered window weights.

Engine
TA-Lib
Function
TRIMA
Input series
close
Outputs
1

How it works

TRIMA applies symmetric triangular weights so observations near the middle of each window receive the greatest weight and the oldest and newest observations receive the least weight.

Use case

Use TRIMA when stronger smoothing and reduced sensitivity to short-lived price changes are more important than fast response.

Parameters

ParameterTypeDefaultBounds or optionsDescription
Time Periodinteger301…100000Number of bars in each triangularly weighted moving-average window.

Outputs

OutputTypeDescription
TRIMAnumberTriangular Moving Average value for the bar.

Reading the result

TRIMA emphasizes observations near the middle of its rolling window and gives less weight to both ends. It therefore produces a smoother, slower baseline than recency-weighted moving averages in many workflows.

The centered weighting does not make the output forward-looking; every persisted value still uses only the available rolling history for that bar.

Common mistakes

  1. Confusing triangular weighting with a centered moving average that uses future rows.
  2. Expecting rapid reaction to the newest observation.
  3. Assuming equal period numbers imply equal lag across moving-average families.
  4. Using the smoother line without checking whether useful short-horizon variation was removed.

DataCat workflow notes

TRIMA can provide a stable trend context for noisy series. Compare it with SMA or EMA using final rows and the same horizon rather than selecting by visual smoothness alone.

Resources

Search documentation

Search across 46 documentation pages.