To get the number of bars for the current ticker and timeframe (resolution) you use the built-in bar_index (pinescript version 4) or n but how do you get the number of bars when using the security function to retrieve a series?
bar_index
n
security
//@version=4 study("My Script", overlay=true) bar_index_weekly = security(syminfo.tickerid, "W", bar_index) plot(bar_index_weekly, "bar_index_weekly") plot(bar_index, "bar_index_current_timeframe")
1.4m articles
1.4m replys
5 comments
57.0k users