indicator · on price · open source
Weighted Moving Average indicator
Weighted Moving Average is a free open-source indicator. Weighted Moving Average applies a linear weighting to the lookback window so the most… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Weighted Moving Average does
Weighted Moving Average applies a linear weighting to the lookback window so the most recent bar has the heaviest weight and the oldest the lightest.
- More responsive than an SMA at the same length, less than an EMA.
- Useful when you want the line to react to the latest print faster than an SMA but stay less jittery than an EMA.
- Raise N for smoother swings; lower it for tighter tracking.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Weighted Moving Average", overlay=true)
len = input.int(20, "Length", minval=1, maxval=500)
src = input.source(close, "Source")
colorMid = input.color("color.orange", "Color Mid")
wma = ta.wma(src, len)
p_WMA = plot(wma, "WMA", color=colorMid, linewidth=2)
alertcondition(ta.crossover(close, wma), "Price crosses above WMA", "Price crossed above the WMA")
alertcondition(ta.crossunder(close, wma), "Price crosses below WMA", "Price crossed below the WMA")
No comments yet.
Sign in to comment.