indicator · on price · open source

Triangular Moving Average

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Triangular Moving Average (TRIMA) is an SMA of an SMA — the kernel is triangular (peaked in the middle of the window) so it removes more noise than a single SMA at the same length.

  • Smoother than a plain SMA but slower.
  • Excellent S/R line for swing trading on 4h/daily.
  • Raise N for very smooth swings, lower it for cleaner cycles.

Source code

//@version=5
indicator("Triangular Moving Average", overlay=true)
len = input.int(20, "Length", minval=2, maxval=500)
src = input.source("close", "Source")
trima = ta.sma(ta.sma(src, len), len)
p_TRIMA = plot(trima, "TRIMA", color=color.gray, linewidth=2)
alertcondition(ta.crossover(close, trima), "Price crosses above TRIMA", "Price crossed above the TRIMA")
alertcondition(ta.crossunder(close, trima), "Price crosses below TRIMA", "Price crossed below the TRIMA")

Comments

No comments yet.

Sign in to comment.