AFAIK the best approach is using the zigzag indicator as a way to identify supports and resistances. You can find those levels so:
0_1565552539187_00.png
In this example, I catch the last two highs (two resistances) into a variable. You can do it with lows also.