Black-Scholes options pricing
Options are the world's most widely used derivative to help manage asset price risk. In this exercise you'll price a European call option on IBM's stock using the Black-Scholes option pricing formula. IBM_returns
data has been loaded in your workspace.
First you'll compute the volatility sigma
of IBM_returns
, as the annualized standard deviation.
Next you'll use the function black_scholes()
, created for this and the following exercises, to price options for two different volatility levels: sigma
and two times sigma
.
The strike price K
, i.e. the price an investor has the right (but not the obligation) to buy IBM, is 80. The risk-free interest rate r
is 2% and the market spot price S
is 90.
You can find the source code of the black_scholes()
function here.
This is a part of the course
“Quantitative Risk Management in Python”
Exercise instructions
- Compute the volatility of
IBM_returns
as the annualized standard deviationsigma
(you annualized volatility in Chapter 1). - Calculate the Black-Scholes European call option price
value_s
using theblack_scholes()
function provided, when volatility issigma
. - Next find the Black-Scholes option price
value_2s
when volatility is instead 2 *sigma
. - Display
value_s
andvalue_2s
to examine how the option price changes with an increase in volatility.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Compute the volatility as the annualized standard deviation of IBM returns
sigma = np.sqrt(____) * IBM_returns.____
# Compute the Black-Scholes option price for this volatility
value_s = black_scholes(S = 90, X = 80, T = 0.5, r = 0.02,
sigma = ____, option_type = "call")
# Compute the Black-Scholes option price for twice the volatility
value_2s = ____(S = 90, X = 80, T = 0.5, r = 0.02,
sigma = ____, option_type = "call")
# Display and compare both values
print("Option value for sigma: ", ____, "\n",
"Option value for 2 * sigma: ", ____)
This exercise is part of the course
Quantitative Risk Management in Python
Learn about risk management, value at risk and more applied to the 2008 financial crisis using Python.
Now it’s time to expand your portfolio optimization toolkit with risk measures such as Value at Risk (VaR) and Conditional Value at Risk (CVaR). To do this you will use specialized Python libraries including pandas, scipy, and pypfopt. You’ll also learn how to mitigate risk exposure using the Black-Scholes model to hedge an options portfolio.
Exercise 1: Measuring RiskExercise 2: VaR for the Normal distributionExercise 3: Comparing CVaR and VaRExercise 4: Which risk measure is "better"?Exercise 5: Risk exposure and lossExercise 6: What's your risk appetite?Exercise 7: VaR and risk exposureExercise 8: CVaR and risk exposureExercise 9: Risk management using VaR & CVaRExercise 10: VaR from a fitted distributionExercise 11: Minimizing CVaRExercise 12: CVaR risk management and the crisisExercise 13: Portfolio hedging: offsetting riskExercise 14: Black-Scholes options pricingExercise 15: Options pricing and the underlying assetExercise 16: Using options for hedgingWhat is DataCamp?
Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.