Q: How to restrict any function to the required number of days in pinescript I have created my Pivot plotting and now looking for resctricting it for the last few days only. 
I am not able to restrict the same. can some one help me on the same.

A: In the plot function use show_last = x
Where x is the number of bars to show from the latest bar.
For example to plot the pivots on the last 10 bars use:
plot(series = pivots, title = "Pivots", show_last = 10)

