https://github.com/jasonstrimpel/volatility-trading
A complete set of volatility estimators based on Euan Sinclair's Volatility Trading
https://github.com/jasonstrimpel/volatility-trading
options options-trading python trading volatility volatility-trading
Last synced: 11 months ago
JSON representation
A complete set of volatility estimators based on Euan Sinclair's Volatility Trading
- Host: GitHub
- URL: https://github.com/jasonstrimpel/volatility-trading
- Owner: jasonstrimpel
- License: gpl-3.0
- Created: 2014-06-14T21:04:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T17:00:05.000Z (over 1 year ago)
- Last Synced: 2025-04-04T14:14:42.959Z (about 1 year ago)
- Topics: options, options-trading, python, trading, volatility, volatility-trading
- Language: Python
- Homepage:
- Size: 7.77 MB
- Stars: 1,668
- Watchers: 84
- Forks: 383
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-systematic-trading - volest - A complete set of volatility estimators based on Euan Sinclair's Volatility Trading (Alpha Collections / General Alpha)
- awesome-quant - volatility-trading - A complete set of volatility estimators based on Euan Sinclair's Volatility Trading. (Reproducing Works / Data Visualization)
- awesome-quant - volatility-trading - A complete set of volatility estimators based on Euan Sinclair's Volatility Trading. (Reproducing Works, Training & Books / Data Visualization)
- awesome-forensics - **326**星
README
# volest #
## Learn how to apply this code to your own options trading ##
[Getting Started With Python for Quant Finance](https://gettingstartedwithpythonforquantfinance.com) is the cohort-based course and community that will take you from complete beginner to up and running with Python for quant finance in 30 days.
## [A complete set of volatility estimators based on Euan Sinclair's Volatility Trading](https://amzn.to/3UhddGP) ##
The original version incorporated network data acquisition from Yahoo!Finance
from `pandas_datareader`. Yahoo! changed their API and broke `pandas_datareader`.
The changes allow you to specify your own data so you're not tied into equity
data from Yahoo! finance. If you're still using equity data, just download
a CSV from finance.yahoo.com and use the `data.yahoo_data_helper` method
to form the data properly.
### Volatility estimators include: ###
* Garman Klass
* Hodges Tompkins
* Parkinson
* Rogers Satchell
* Yang Zhang
* Standard Deviation
Also includes
* Skew
* Kurtosis
* Correlation
For each of the estimators, plot:
* Probability cones
* Rolling quantiles
* Rolling extremes
* Rolling descriptive statistics
* Histogram
* Comparison against arbirary comparable
* Correlation against arbirary comparable
* Regression against arbirary comparable
Create a term sheet with all the metrics printed to a PDF.
### Page 1 - Volatility cones ###

### Page 2 - Volatility rolling percentiles ###

### Page 3 - Volatility rolling min and max ###

### Page 4 - Volatility rolling mean, standard deviation and zscore ###

### Page 5 - Volatility distribution ###

### Page 6 - Volatility, benchmark volatility and ratio###

### Page 7 - Volatility rolling correlation with benchmark ###

### Page 3 - Volatility OLS results ###

Example usage:
```python
from volatility import volest
import yfinance as yf
# data
symbol = 'JPM'
bench = 'SPY'
estimator = 'GarmanKlass'
# estimator windows
window = 30
windows = [30, 60, 90, 120]
quantiles = [0.25, 0.75]
bins = 100
normed = True
# use the yahoo helper to correctly format data from finance.yahoo.com
jpm_price_data = yf.Ticker(symbol).history(period="5y")
jpm_price_data.symbol = symbol
spx_price_data = yf.Ticker(bench).history(period="5y")
spx_price_data.symbol = bench
# initialize class
vol = volest.VolatilityEstimator(
price_data=jpm_price_data,
estimator=estimator,
bench_data=spx_price_data
)
# call plt.show() on any of the below...
_, plt = vol.cones(windows=windows, quantiles=quantiles)
_, plt = vol.rolling_quantiles(window=window, quantiles=quantiles)
_, plt = vol.rolling_extremes(window=window)
_, plt = vol.rolling_descriptives(window=window)
_, plt = vol.histogram(window=window, bins=bins, normed=normed)
_, plt = vol.benchmark_compare(window=window)
_, plt = vol.benchmark_correlation(window=window)
# ... or create a pdf term sheet with all metrics in term-sheets/
vol.term_sheet(
window,
windows,
quantiles,
bins,
normed
)
```
Hit me on twitter with comments, questions, issues @jasonstrimpel