Option greeks: formula proofs and python implementation.

This documents is the first part of a general overview of vanilla options partial sensitivities (option greeks). Here we provide 1st generation greeks, their formula, mathematical proof, and suggest an implementation in Python.


Delta Definition

Delta is the option’s sensitivity to small changes in the underlying price.

Shape

Call option delta surface in Python

Figure 1: Call option Delta surface

Formula

First let’s remind the Black-Scholes-Merton formula for a vanilla Call option:

(1)   \begin{equation*} c= e^{-qT} S N(d_{1})-Xe^{-rT} N(d_{2}) \end{equation*}

 

(2)   \begin{equation*} p= Xe^{-rT} N(-d_{2}) - e^{-qT} S N(-d_{1}) \end{equation*}

With:

(3)   \begin{equation*} d_{1}= \frac{\ln (S/X)+(r-q + \frac{\sigma ^{2}}{2})T}{\sigma \sqrt{T}} \end{equation*}

And:

(4)   \begin{equation*} d_{2}=d_{1}- \sigma \sqrt{T} \end{equation*}

The call option Delta will be:

(5)   \begin{equation*} \Delta_{c} = \frac{dc}{dS} = e^{-qT} N(d_{1}) \end{equation*}

Proof

 

(6)   \begin{equation*} \begin{split} \begin{aligned} \Delta_{c} = \frac{dc}{dS} = {} & \frac{d(e^{-qT} S N(d_{1})-Xe^{-rT} N(d_{2}))}{dS} \\ & {=} e^{-qT} N(d_{1}) + S e^{-qT} \frac{\partial N(d_{1})}{\partial S} - X e^{-rT} \frac{\partial N(d_{2})}{\partial S} \\ & {=} e^{-qT} N(d_{1}) + S e^{-qT} \frac{\partial d_{1}}{\partial S} \frac{\partial N(d_{1})}{\partial d_{1}} - X e^{-rT} \frac{\partial d_{2}}{\partial S} \frac{\partial N(d_{2})}{\partial d_{2}} \\ & {=} e^{-qT} N(d_{1}) + S e^{-qT} \frac{\partial d_{1}}{\partial S} N'(d_{1}) - X e^{-rT} \frac{\partial d_{2}}{\partial S} N'(d_{2}) \\ & {=} e^{-qT} N(d_{1}) + \underbrace{\frac{S e^{-qT} N'(d_{1})}{S \sigma \sqrt{T}} - \frac{Xe^{-rT} N'(d_{2})}{S \sigma \sqrt{T}}}_{\text{I=0}} \end{aligned} \end{split} \end{equation*}

Above, I=0. Indeed, according to (1.3.3) we have:

(7)   \begin{equation*} \begin{split} \begin{aligned} {} & \ln (S/X) + (r-q + \frac{\sigma ^{2}}{2})T = d_{1}\sigma \sqrt{T}\\ & \Rightarrow \ln (S) - \ln (X) + (r-q)T = d_{1}\sigma \sqrt{T} - \frac{\sigma ^{2}}{2}T = \frac{1}{2} \big[ d_{1}^{2} - (d_{1} - \sigma \sqrt{T})^{2} \big] \\ & \Rightarrow \ln(S) + \ln(\frac{1}{\sqrt{2\pi}}) - \frac{d_{1}^{2}}{2} = \ln(X) -(r-q)T + \ln(\frac{1}{\sqrt{2\pi}}) - \frac{d_{2}^{2}}{2} \\ & \Rightarrow S \frac{1}{\sqrt{2\pi}} e^{- \frac{d_{1}^{2}}{2}} = X e^{-(r-q)T} \frac{1}{\sqrt{2\pi}} e^{ - \frac{d_{2}^{2}}{2}} \\ & \Rightarrow SN'(d_{1}) = X e^{-(r-q)T}N'(d_{2})\\ & \Rightarrow S e^{-qT} N'(d_{1}) = X e^{-rT} N'(d_{2}) \end{aligned} \end{split} \end{equation*}

Finally from (1.4.1) we obtain:

(8)   \begin{equation*} \boldsymbol{\Delta_{c} = e^{-qT} N(d_{1})} \end{equation*}

For the Put, since by parity we have:

(9)   \begin{equation*} \begin{split} \begin{aligned} {} & p + Se^{-qT} = c + X e^{-rT} \\ & \Rightarrow \frac{dp}{dS} = \frac{dc}{dS}-e^{-qT} \\ & \Rightarrow \boldsymbol{\Delta_{p} = N(d_{1})-1} \end{aligned} \end{split} \end{equation*}

Python script

 

Now here is a piece of code that you can use to calculate and chart the Delta surface displayed above (the python file that contains the Delta calculation above is called “OptionsAnalytics.py”).

 

Facebooktwittergoogle_plusredditlinkedinmail