ImmortalFreedom

Visualizing Behaviors of barstate Variables

The title pretty much sums up what this script does. It's intended for Pine Script developers, but especially for newcomers to Pine Editor contemplating the use of barstate variables. I would recommend using this on 15 second or 1 minute chart intervals for a quick and obvious analysis of barstate behaviors.

These barstate variables change from TRUE to FALSE or FALSE to TRUE during specific times/conditions of script operation. One unique state you might not ever see change is barstate.isfirst. This is only TRUE when bar_index==0, most easily viewed on the monthly "All" chart on the far left. I provided a label displaying the current bar_index for perspective. I hope this provides an improved grasp of barstate understanding for fellow members, as it did for myself.

When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members , I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
Release Notes:
Added textalign=text.align_left to dress up the labels with formatting finesse
Release Notes:
barstate.islastconfirmedhistory is now a newly added barstate variable.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?