enter image description here
Hi all, I’m trying to learn how to code for algorithmic trading and I was looking at some indicators that are very commonly used. I stumbled upon this Smart Money Indicator by LuxAlgo and I was looking at their source code in Pinescript but I am not very familiar with the logic. The logic in the image is used to detect swing highs and swing lows, can anyone explain how it works?
From what I can understand, a swing high is only returned when the current value of os is 0 and the previous value of os is 1, but why would the previous value of os be 1 in a swing high? Please correct my misunderstanding.
alwx is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1