OPEN-SOURCE SCRIPT

Triangular Moving Average

The TRIMA is simply the SMA of the SMA -- a double-smoothed simple moving average . The end effect of the double smoothing is that greater weight is placed on values near the middle of the lookback period. It therefore reacts relatively slowly to price changes compared to most moving averages .

But why would I want more lag?
One potential use of this moving average that I've found is that it can allow price to run for a bit after crossing the TRIMA before catching up and creating an opposing signal. It therefore creates the chance for the price to "run its course" so to speak, which can make whipsaw signals less common.
doublelagMoving AveragessmoothedTriangleweighting

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer