indicator · on price · open source
Smoothed Moving Average
Running…
Loading chart…
About
Smoothed Moving Average (SMMA) is Wilder's smoothed average: each bar's value is the previous bar's value plus a fraction of the change. Seeded from an SMA, it converges faster than a triangular MA at very long lengths.
- Very smooth line, great for the slow leg of long-term crossovers.
- The kernel inside ATR and several other Wilder indicators.
- Raise N for ultra-smooth swings; lower it for faster adaptation.
Source code
//@version=5
indicator("Smoothed Moving Average", overlay=true)
len = input.int(14, "Length", minval=1, maxval=500)
src = input.source("close", "Source")
var float smma = 0.0
smma := ta.sma(src, len)[1]
smma := nz(smma[1]) + (src - nz(smma[1])) / len
p_SMMA = plot(smma, "SMMA", color=color.maroon, linewidth=2)
alertcondition(ta.crossover(close, smma), "Price crosses above SMMA", "Price crossed above the SMMA")
alertcondition(ta.crossunder(close, smma), "Price crosses below SMMA", "Price crossed below the SMMA")
No comments yet.
Sign in to comment.