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
| Parameter | Type | Default | Bounds or options | Description |
|---|---|---|---|---|
| Time Period | integer | 30 | 1…100000 | Number of bars in each triangularly weighted moving-average window. |
Outputs
| Output | Type | Description |
|---|---|---|
| TRIMA | number | Triangular 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
- Confusing triangular weighting with a centered moving average that uses future rows.
- Expecting rapid reaction to the newest observation.
- Assuming equal period numbers imply equal lag across moving-average families.
- 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.