I'm trying to find ways to determine precisely higher highs, higher lows, lower lows, lower highs.

I created this algo based on an algo I found on internet. Do you have other suggestions find these  numbers? My goal is to find exit/entry points within lower timeframes when tradingin higher timeframes