indicator · on price · open source

Simple Moving Average indicator

Simple Moving Average is a free open-source indicator by @deepwick. Simple Moving Average is the equal-weight baseline. Deepwick Script runs a subset of Pine Script.

Deepwick · @deepwickv1Updated 3 Nov 2026▲ 0 users
Running…
Loading chart…

What Simple Moving Average does

Simple Moving Average is the equal-weight baseline. Smooths price by averaging the last N bars of the chosen source — the reference line every other MA is compared against.

  • Raise N for a smoother, laggier line; lower it for faster response.
  • Pair with a faster MA (e.g. EMA 9) to catch crossovers as trend signals.
  • Works on any market; defaults to close and length 20.

Source code

Deepwick Script, a subset of Pine Script · read-only

//@version=6
indicator("Simple Moving Average", overlay=true)
len = input.int(20, "Length", minval=1, maxval=500)
src = input.source(close, "Source")
colorLine = input.color("color.blue", "Color  Line")
sma = ta.sma(src, len)
p_SMA = plot(sma, "SMA", color=colorLine, linewidth=2)
alertcondition(ta.crossover(close, sma), "Price crosses above SMA", "Price crossed above the SMA")
alertcondition(ta.crossunder(close, sma), "Price crosses below SMA", "Price crossed below the SMA")

Comments

No comments yet.

Sign in to comment.