Annualizing Intraday and Overnight Volatility from Price Changes
Summary
The document outlines a way to annualize intraday and overnight volatility separately. It estimates volatility as the standard deviation of recent log price changes over each session segment, then scales that estimate by the square root of the number of corresponding periods in a year. The example treats the regular trading session and the close-to-open interval as distinct time spans and gives separate annualization factors for them.
The replies confirm that an overnight log return can use the current open relative to the previous close, while an intraday return can use the open and close of the same bar. They also mention Garman–Klass as another volatility estimator. The discussion does not fully assess the time-scaling assumptions or the Thinkorswim implementation, and its example factors depend on the session hours and trading-day convention used. A charting detail notes that overlayed plots may be independently scaled to the chart’s vertical range.
Key ideas
- Estimate overnight changes from the open relative to the prior close.
- Estimate intraday changes from the open and close within the same session.
- Annualize standard deviation by multiplying by the square root of periods per year.
- Annualization factors depend on session length and the chosen trading calendar.
- Garman–Klass is mentioned as an alternative volatility estimator.
Tags
Full text
# What is the formula for Intraday and overnight volatility?
# What is the formula for Intraday and overnight volatility?
I'm a noob trying to calculate IntraDay and Overnight Volatility.
For Intraday volatility we can get the annualization factor with the following:
Length (hours, Open to Close): 6.5
Time frames per day: 24 / 6.5 = 3.6923
Time frames per year: 252 * 3.6923 = 930.4596
Annualization factor: SQRT(930.4596) = 30.5034
For Overnight volatility, the annualization factor is:
Length (hours, Close to Open): 17.5
Time frames per day: 24 / 17.5 = 1.3714
Time frames per year: 252 * 1.3714 = 345.5928
Annualization factor: SQRT(345.5928) = 18.5901
With these parameters, I can calculate intraday volatility as the standard deviation of the 20 most recent open-to-close price changes, multiplied by the annualization factor, 30.5034
And overnight volatility can be calculated by the standard deviation of the 20 most recent close-to-open price changes, multiplied by the annualization factor, 18.5901
It seems like this should be pretty straightforward since I have all the inputs but I'm not sure if I'm doing it right, especially in thinkorswim.
For example, I tried editing ThinkorSwim's default historical volatility study to the following (I only changed the the last two lines from the bottom):
```
#
# TD Ameritrade IP Company, Inc. (c) 2007-2017
#
declare lower;
input length = 20;
input basis = {default Annual, Monthly, Weekly, Daily};
def ap = getAggregationPeriod();
assert(ap >= AggregationPeriod.MIN, "Study can only be calculated for time-aggregated charts: " + ap);
def barsPerDay = (regularTradingEnd(getYyyyMmDd()) - regularTradingStart(getYyyyMmDd())) / ap;
def barsPerYear =
if ap > AggregationPeriod.WEEK then 12
else if ap == AggregationPeriod.WEEK then 52
else if ap >= AggregationPeriod.DAY then 252 * AggregationPeriod.DAY / ap
else 252 * barsPerDay;
def basisCoeff;
switch (basis) {
case Annual:
basisCoeff = 1;
case Monthly:
basisCoeff = 12;
case Weekly:
basisCoeff = 52;
case Daily:
basisCoeff = 252;
}
def clLog = log(open / close[1]);
plot HV = stdev(clLog, length) * 30.5;
HV.SetDefaultColor(GetColor(0));
```
Is this correct? Is there a simpler thinkscript/formula? Thanks very much. I appreciate it.
** Here's the graph its spitting out:
## Answer by joenor (score 2, accepted)
https://quant.stackexchange.com/a/43620
Looks correct to me, the open of the last bar divided by the close of the previous bar.
```
def clLog = log(open / close[1]);
```
For intraday it would be...
```
def clLog = log(open / close);
```
Also, to answer your comment, when combining plots all lines are scaled to use the full vertical space of the graph (i.e. 0-100%) which is why a lower number value from one line may show above a higher value from another line.
## Answer by Jónás Balázs (score 2)
https://quant.stackexchange.com/a/43622
You can find a greast summary on volatility estimation here.
I also suggest to get familiar with Garman-Klass volatility. Discussed here and in this article.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.