I am just starting out with coding and am looking for the best way to ID swing highs and lows for comparison. Eventually i want to sort the values to variables along with other indicators but getting the highs and lows is the first step. I have attached a chart showing what I am trying to achieve.
Thanks for any help.

Comment