Close-to-Close Historical Volatility Calculation – Volatility Analysis in Python

Follow us on LinkedIn

In a previous post, we touched upon a stock’s volatility through its beta. In this post, we are going to discuss historical volatilities of a stock in more details. If you want to use the online version, go to Historical Volatility Online Calculator.

Also referred to as statistical volatility, historical volatility gauges the fluctuations of underlying securities by measuring price changes over predetermined periods of time. It is the less prevalent metric compared to implied volatility because it isn’t forward-looking.

When there is a rise in historical volatility, a security’s price will also move more than normal. At this time, there is an expectation that something will or has changed. If the historical volatility is dropping, on the other hand, it means any uncertainty has been eliminated, so things return to the way they were. Read more

There are various types of historical volatilities such as close-to-close, Parkinson, Garman-KIass, Yang-Zhang, etc. These volatility measures play an important role in trading and risk management. In this post, we will discuss the close-to-close historical volatility.

The close-to-close historical volatility (CCHV) is calculated as follows,

historical volatility in python

where xi are the logarithmic returns calculated based on the stock’s closing prices,  and N is the sample size.  In this example, N=22, the average number of trading days in a month.

We implemented the above equation in Python. We downloaded SPY data from Yahoo finance and calculated CCHV using the Python program. The picture below shows the close-to-close historical volatility of SPY from March 2015 to March 2020.

volatility trading in python

It’s observed that the volatility is a mean-reverting process. The CCHV has the following characteristics [1]

Advantages

  • It has well-understood sampling properties
  • It is easy to correct bias
  • It is easy to convert to a form involving typical daily moves

Disadvantages

  • It is a very inefficient use of data and converges very slowly

References

[1] E. Sinclair, Volatility Trading, John Wiley & Sons, 2008

Further questions

What's your question? Ask it in the discussion forum

Have an answer to the questions below? Post it here or in the forum

LATEST NEWSKootenay Silver Announces Public Offering for Gross Proceeds of Up to C$5.0 Million
Kootenay Silver Announces Public Offering for Gross Proceeds of Up to C$5.0 Million

NOT FOR DISTRIBUTION TO UNITED STATES NEWSWIRE SERVICES OR FOR DISSEMINATION IN THE UNITED STATES VANCOUVER, British Columbia, April 08, 2024 (GLOBE NEWSWIRE) — Kootenay Silver Inc. (“Kootenay” or the “Company”) (TSXV: KTN) is pleased to announce that it has entered into an agreement with…

Stay up-to-date with the latest news - click here
LATEST NEWSHigh Arctic Announces 2023 Fourth Quarter and Year End Financial and Operating Results and Provides Update on Plan to Reorganize
High Arctic Announces 2023 Fourth Quarter and Year End Financial and Operating Results and Provides Update on Plan to Reorganize

NOT FOR DISTRIBUTION TO U.S. NEWSWIRE SERVICES OR FOR DISSEMINATION IN THE UNITED STATES. ANY FAILURE TO COMPLY WITH THIS RESTRICTION MAY CONSTITUTE A VIOLATION OF U.S. SECURITIES LAW CALGARY, Alberta, April 08, 2024 (GLOBE NEWSWIRE) — High Arctic Energy Services Inc. (TSX: HWO) (the…

Stay up-to-date with the latest news - click here
LATEST NEWSXORTX Announces Participation in Spring 2024 Investor Conferences
XORTX Announces Participation in Spring 2024 Investor Conferences

CALGARY, Alberta, April 08, 2024 (GLOBE NEWSWIRE) — XORTX Therapeutics Inc. (“XORTX” or the “Company”) (NASDAQ: XRTX | TSXV: XRTX | Frankfurt: ANUA WKN: A3UNZ), a late-stage clinical pharmaceutical company focused on developing innovative therapies to treat progressive kidney disease, announces that Dr. Allen Davidoff,…

Stay up-to-date with the latest news - click here
LATEST NEWSJames River Granted Motion Ordering Fleming to Complete its Pending Acquisition of JRG Re
James River Granted Motion Ordering Fleming to Complete its Pending Acquisition of JRG Re

Court Requires Fleming to Complete the Transaction Within 10 days PEMBROKE, Bermuda, April 08, 2024 (GLOBE NEWSWIRE) — James River Group Holdings, Ltd. (“James River” or the “Company”) (NASDAQ: JRVR) announced that the Supreme Court, New York County, Commercial Division (the “Court”) granted the Company’s…

Stay up-to-date with the latest news - click here
LATEST NEWSG2 Goldfields Announces Graduation to the TSX
G2 Goldfields Announces Graduation to the TSX

TORONTO, April 08, 2024 (GLOBE NEWSWIRE) — G2 Goldfields Inc. (“G2” or the “Company”) (TSXV:GTWO, OTCQX:GUYGF) is pleased to announce that it has received final approval from the Toronto Stock Exchange (“TSX”) for the listing of its common shares (the “Shares”). The Shares will begin…

Stay up-to-date with the latest news - click here

Leave a Reply