A classic variable reset to 0 (null value) on each tick received. You have to use an array variable to store the past value contained in the same bar in live, such as :
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue