indicator · on price · open source
Triangular Moving Average
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")
No comments yet.
Sign in to comment.