I want to label the last bar in the current window. barstate.islast is true only for the overall last bar in the whole dataset. I need to figure out the last bar that is displayed on my window. Is this possible?
Unfortunately, this is not possible in Pine.
There's no way to interact with what's shown in the window.
Edit 1 : last_bar_index
While it's still not possible to get the last bar that is displayed in the window, it is now possible to get the bar_index of the last bar in the set of bars, by using the built-in variable last_bar_index
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With