Works on all timeframes - minute, days, weeks, months - and always plots 52 weeks historical high and low.
The 52 weeks lookback window slides backwards as we plot for older / historical bars on the chart.
Instead of 52 weeks, number of weeks to look back can be specified using 'No. of weeks to lookback' parameter in Settings --> Inputs.
Style and color for 'High' and 'Low' plots can be changed through Settings --> Style
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.