Historical Volatility: the annualised standard deviation of log returns.
the reference derives the annualisation divisor from the chart's timeframe:
per = timeframe.isintraday or (timeframe.isdaily and multiplier == 1) ? 1 : 7.
A descriptor here is handed bars and settings and nothing else. It cannot
see the timeframe, and guessing one from bar spacing would silently change
the plot on a gappy or irregular series. So per is an input: leave it at 1
for intraday and daily charts, set it to 7 for weekly and above, which is
exactly the branch the reference takes.
Historical Volatility: the annualised standard deviation of log returns.
the reference derives the annualisation divisor from the chart's timeframe:
per = timeframe.isintraday or (timeframe.isdaily and multiplier == 1) ? 1 : 7. A descriptor here is handed bars and settings and nothing else. It cannot see the timeframe, and guessing one from bar spacing would silently change the plot on a gappy or irregular series. Soperis an input: leave it at 1 for intraday and daily charts, set it to 7 for weekly and above, which is exactly the branch the reference takes.