In "live" trading I want to compute data on closed bars. How can I modify the formula I posted to used the last closed bar and not tick by tick?