Pine Script Unexpected Behaviour Using Code From Pinescript Docs

Pine Script Unexpected Behaviour Using Code From Pinescript Docs