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

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].

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

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 NEWS‘Enough pollution’ in low-income NJ area with 1 power plant
‘Enough pollution’ in low-income NJ area with 1 power plant

WOODBRIDGE, N.J. (AP) — Residents of low-income communities in New Jersey that would get a second gas-fired power plant nearby are urging the governor to halt the project, which they said flies in the face of an environmental justice law he signed with great fanfare…

Stay up-to-date with the latest news - click here
LATEST NEWSAbsolute Software to Present at Raymond James Annual Institutional Investors Conference
Absolute Software to Present at Raymond James Annual Institutional Investors Conference

VANCOUVER, British Columbia & SAN JOSE, Calif. — Absolute Software™ (NASDAQ: ABST) (TSX: ABST), the only provider of self-healing, intelligent security solutions, today announced the company will present at the Raymond James 44th Annual Institutional Investors Conference on Wednesday, March 8, 2023 at 11:35 am…

Stay up-to-date with the latest news - click here
LATEST NEWSUS pick to head World Bank, ex-Mastercard CEO Banga, starts ‘charm offensive’
US pick to head World Bank, ex-Mastercard CEO Banga, starts ‘charm offensive’

WASHINGTON, March 1 (Reuters) – U.S. President Joe Biden’s pick to head the World Bank, ex-Mastercard CEO Ajay Banga, met on Wednesday with executive directors at the bank as he launched a “charm offensive” to win the post, sources familiar with the plans said. Biden…

Stay up-to-date with the latest news - click here
LATEST NEWSSnowflake and AWS Significantly Deepen Commitment to Driving Customer-focused Innovation
Snowflake and AWS Significantly Deepen Commitment to Driving Customer-focused Innovation

Snowflake and AWS expand their successful partnership by boosting sales collaboration, industry solution alignment, and joint go-to-market strategies Over 6,000 joint customers1 including Goldman Sachs and other Fortune 500 enterprises, are using Snowflake and AWS to rapidly innovate Approximately 84% of Snowflake’s customers run their…

Stay up-to-date with the latest news - click here
LATEST NEWSNew Grain February Record Set
New Grain February Record Set

Improved grain industry collaboration leads to shipping record MONTREAL, March 01, 2023 (GLOBE NEWSWIRE) — CN (TSX: CNR) (NYSE: CNI) today announced that February 2023 was the best February ever for Western Canadian grain movement on CN’s network. The Company worked with its customers and…

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

Leave a Reply