You can try to encapsulate your loop into a condition with “IsLastBarUpdate”, so that the code is only once each time the last bar is updated (new price received), see:
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok