This script shows support-and-resistance levels that span months and weeks.
It also shows the levels in the last 100 bars in higher detail. Details detection is only applied to last 100 bars so that your chart is not cluttered with infinite horizontal lines. 100 can be changed in the settings.
For example, here, you see the levels in small time frames at a different detail level:
This script uses the arrays introduced in pine script v4