Cookbook
Simple moving average
The classic smooth line.
//@zscript 1
indicator("SMA", overlay=true)
len = input.int(20, "Length", minval=1)
plot(ta.sma(close, len), "SMA", color=#03c988, linewidth=2)
How it works
The average of the last len closes. Longer length, smoother and slower line.
Try: switch close for hl2 to average the middle of each bar instead.
Education only. Not financial advice. Examples are teaching samples, not trading results.
