barstate.isconfirmed

True when the current bar is closed (false while the last bar is still forming).