I came across this in the new pine script documentation under "Essential Features" for BarStates
barstate.isconfirmed — true if the current dat