Reputation: 501
This is pretty simple
//@version=4
study("My script", overlay=true)
line ln = na
ln := line.new(bar_index, close, bar_index, close[10])
line.set_style(ln, line.style_dashed)
but this is the result I'm getting
I'm not sure what I'm doing wrong, s there any specific reason why my code is not executing on all candles?
Thank you
Upvotes: 0
Views: 300
Reputation: 3823
There is a limit to the number of lines you can use on your chart. By default the limit is 50. You can extend this to 500 by using the max_lines_count parameter in study/strategy.
study("My script", overlay = true, max_lines_count = 500)
https://www.tradingview.com/pine-script-reference/v4/#fun_study
Upvotes: 2