I have attached the script and the results. When tick replay is OFF then the indicator works fine and plots appear. Please see image 1 for the same. However, when tick replay is ON then the indicator doesn't give any output. Please see image 2 for the same.
Can you please help me make the necessary changes to make this script work in a tick chart with tick replay ON?

Comment