Pine Script Hide unnecessary parts of Pine indicators

We’ve added a useful little feature that expands the capabilities of Pine scripts. You can now hide a certain part of the indicator that you plot on a chart. This should help you reduce the amount of data on your charts. You can now use the new argument “show_last” as well as functions such as “plot”, “plotbar”, “plotchar”, “fill” and others.

plotshape(close, show_last=7)

show_last0

Here is an example suggested by the community:

//@version=3 
study(title="Moving Average", shorttitle="MA with mark", overlay=true)
len = input(9, minval=1, title="Length")
src = input(close, title="Source")
out = sma(src, len)
plot(out, color=blue, title="MA")
plot(out[len], offset = -len, style = circles, linewidth=5, color = red, show_last=1)

show_last1

August 1, 2017
spread the love