This is why tick is an important event that makes the basic mechanisms of MQL4 programs run.
What happens when a new tick comes in?
What actions should the terminal take? This is control that moves to the forefront here. But,
do not forget to comment upon your code.