Back to Community
Black-Scholes

Please see the attached code for an implementation of a standard Black-Scholes model for options pricing and risk management. Includes functions for valuation of first, second, and third order Greeks.

Clone Algorithm
170
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 52f252dd89a92e0993ce595e
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
5 responses

Improvements to the Black-Scholes library. We now include a function to compute the implied volatility of an underlying asset given observed option prices. Under Black-Scholes, there is a one-to-one mapping of volatility to option price given a fixed set of other market parameters. The implied volatility is the volatility that would make the price given by the model equal to the observed price.

The implied volatility can be viewed as investors' expectation of the future volatility of an asset. When investing in stocks, one may use the implied vol to measure the riskiness of an asset in the future and adjust a position accordingly.

Clone Algorithm
170
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 52f525462f8c4007445b4b09
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

hopefully we can get some historical option data or surface data to use these.

Andrew - is there anything more you would like to see on Quantopian in terms of option pricing models, algorithms for constructing implied volatility surfaces, etc.? I'd like to be able to improve the convergence rate of the optimization routines used to compute implied volatility.

I think you have most of the basics, another 2nd order greek would be vanna (rate of change of vega with respect to spot)

I'm hoping we'll one day get an interpolated vol surface something like
(secid, daysToMaturity, delta, impliedVol) for each date for the major etfs

also, realizedVol calculation that uses log of price returns like http://www.volx.us/VolFormula.htm, but also includes dividend and corp. action adjustments
as a simple transform like mavg(days)

@ Ryan how come The implied volatility is always 0.8 ? on the print out? can this algo different IV for each individual stocks thanks... ;)