1
votes

I have been trying to plot take profit and stop loss lines for a script I wrote, but I am struggling with plotting lines in the future.

I have tried using the plot and line.new functions but with no success.

An example of what I would like to see

1
Search the Public Library for examples; you will find plenty: tradingview.com/scripts/supportandresistance - PineCoders-LucF
Hi, what exactly did you try and why was it not a success? - Francesco Dondi

1 Answers

1
votes

You can calculate the values you want to plot on the graph then set offset. Something like this,

plot(close, offset = 1, color = color.black, linewidth=2)

here offset will be number bars in the future. i.e 1 is calculated bar in future.