barstate.ishistory
True on bars that have closed (every bar except a forming last bar): not barstate.isrealtime.