► On lower timeframes - hour or less - this will show High, Low and Close from the previous day, two days ago, the previous week and two weeks ago and .
► On 1h daily reference points need to be enabled. On higher timeframes, daily reference points will not be shown. On the , weekly levels need to be enabled to still show and will be disabled on all higher periods.
► It is configured only for normal timeframes. If you use something like 17-minutes timeframe, you will have to allow this timeframe in the code.
Bear in mind, using all lines at the same time can be a little confusing and price doesn't react to every one of them. You can probably disable lows in the uptrend or scratch closes to simplify your chart.
Have a great trade!
For instance in prorealtime (another charting software) there are parameters called "DrawOnLastBarOnly" or "CalculateOnLastBars" which can be used to restrict how many periods into the past an indicator will be calculated/plotted. Would be great if that was possible with your script as well.