Black-Scholes-Merton Option Pricing Model-Derivative Pricing in Python

Subscribe to newsletter

The Black-Scholes-Merton model is one of the earliest option pricing models that was developed in the late 1960s and published in 1973 [1,2]. The most important concept behind the model is the dynamic hedging of an option portfolio in order to eliminate the market risk. First, a delta-neutral portfolio is constructed, and then it is adjusted to stay delta neutral as the market fluctuates. Finally, we arrive at a Partial-Differential Equation for the value of the option.

derivative pricing in python

where

  • V denotes the option value at time t,
  • S  is the stock price,
  • r is the risk-free interest rate and,
  • σ is the stock volatility.

This equation is also called a diffusion equation, and it has closed-form solutions for European call and put options. For a detailed derivation and analytical formula, see Reference [3].

Subscribe to newsletter https://harbourfrontquant.beehiiv.com/subscribe Newsletter Covering Trading Strategies, Risk Management, Financial Derivatives, Career Perspectives, and More

In this post, we focus on the implementation of the Black-Scholes-Merton option pricing model in Python. Closed-form formula for European call and put are implemented in a Python code. The picture below shows the prices of the call and  put options for the following market parameters:

  • Stock price: $45
  • Strike price: $45
  • Time to maturity: 1 year
  • Risk-free rate: 2%
  • Dividend yield: 0%
  • Volatility: 25%

option pricing in python

We compare the above results to the ones obtained by using third-party software and notice that they are in good agreement.

derivative valuation in python

In the next installment, we will price these options using Monte Carlo simulation.

References:

[1] Black, Fischer; Myron Scholes (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy. 81 (3): 637–654

[2] Merton, Robert C. (1973). Theory of Rational Option Pricing. Bell Journal of Economics and Management Science.

[3] Hull, John C. (2003). Options, Futures, and Other Derivatives. Prentice Hall


To download the accompanying Excel workbook or Python program for this post:
1. Subscribe to the newsletter. If you're already a subscriber, go to the next step
2. Once subscribed, refer a friend
After completing these steps, you’ll gain access to the file for this post, along with files for a dozen other posts.

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 NEWSLara Trump withdraws from consideration to replace Rubio in US Senate
Lara Trump withdraws from consideration to replace Rubio in US Senate
Stay up-to-date with the latest news - click here
LATEST NEWSROSEN, TRUSTED INVESTOR COUNSEL, Encourages MGP Ingredients, Inc. Investors to Secure Counsel Before Important Deadline in Securities Class Action - MGPI
ROSEN, TRUSTED INVESTOR COUNSEL, Encourages MGP Ingredients, Inc. Investors to Secure Counsel Before Important Deadline in Securities Class Action - MGPI
Stay up-to-date with the latest news - click here
LATEST NEWSThe 5 biggest revelations from Blake Lively's complaint against Justin Baldoni
The 5 biggest revelations from Blake Lively's complaint against Justin Baldoni

"It Ends with Us" star Blake Lively filed a legal complaint against her costar, Justin Baldoni, for sexual harassment and for conspiring to damage her reputation.

Stay up-to-date with the latest news - click here
LATEST NEWS5 money lessons a 63-year-old retiree worth $1 million taught her kids from an early age
5 money lessons a 63-year-old retiree worth $1 million taught her kids from an early age

She taught them how stocks and savings bonds work and encouraged them to be self-reliant, skills that have help them reach their own milestones.

Stay up-to-date with the latest news - click here
LATEST NEWSROSEN, A TOP RANKED LAW FIRM, Encourages Light & Wonder, Inc. Investors to Inquire About Securities Class Action Investigation - LNW
ROSEN, A TOP RANKED LAW FIRM, Encourages Light & Wonder, Inc. Investors to Inquire About Securities Class Action Investigation - LNW
Stay up-to-date with the latest news - click here

Leave a Reply