May 4, 2009

Black Scholes using Hedging and the Partial Differential Equation

Using the Black Scholes model assumptions, we assume that the underlying stock follows Geometric Brownian Motion.

\mathrm{d}S = \mu S \mathrm{d}t + \sigma S \mathrm{d}X.

Use \Pi to denote the value of a portfolio of one long option position and a short position in some quantity \Delta of the underlying:

\Pi = V(S, t) - \Delta S

As the time t to t + \mathrm{d}t the value of the portfolio will change. This change in value is partly due to the change in the option value and partly to the change in the underlying

\mathrm{d} \Pi = \mathrm{d} V - \Delta \mathrm{d} S

From Ito's Lemma we have

\mathrm{d} V = \frac{\partial V}{\partial t} \mathrm{d} t + \frac{\partial V}{\partial S} \mathrm{d} S + \frac{1}{2} \sigma^2 S^2 \frac{\partial ^2 V}{\partial S^2} \mathrm{d} t

Substituting, the value of \mathrm{d} V in the previous equation and grouping for \mathrm{d} t and \mathrm{d} S terms.

\mathrm{d} \Pi = \left(\frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial ^2 V}{\partial S^2} \right) \mathrm{d} t + \left( \frac{\partial V}{\partial S} - \Delta \right) \mathrm{d} S

\mathrm{d} t, terms are deterministic terms and \mathrm{d} S terms are random.

We can eliminate the random terms by choosing -

\Delta = \frac{ \partial V}{\partial S},

Thus by choosing a suitable value of \Delta, our portfolio change is deterministic and completely riskless. This riskfree change must be equal to the growth we would get by putting the equivalent amout in a risk-free asset.

\mathrm{d} \Pi = r \Pi \mathrm{d} t

Putting it all together and elimiating \Delta and \Pi, we get

\frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial ^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0

The Black-Scholes PDE.

April 29, 2009

American Option on a non-dividend paying stock

Theorem: It is never optimal to exercise an American option on a non-dividend paying stock for certain values of risk-free rate r.

Proof: We know that at maturity following relation is true, for a stock price process , strike price K.

Discounting the above equations using the risk free rate r to time t, we obtain

.

where is the European option price.

We also know that, where is the continuation price for an American option. Thus,

Thus, if risk free rate is strictly positive, we can prove that for positive paths

Above equation implies that for an American option on a non dividend paying stock it is never optimal to exercise early.

Q.E.D.

March 17, 2009

Delta of an European Option using VBA

The delta of an option is the sensitivity of an option price relative to changes in the price of the underlying asset. It tells option traders how fast the price of the option will change as the underlying stock/future moves. In matematical terms it will be given as - . In the Black Scholes model this is given by - Here is a short VBA snippet to calculate the delta of a european option.
Function BSOptionDelta(S, X, r, q, mat, sigma, CallPut As String)
    Dim eqt, NDOne
    NDOne = Application.NormSDist(BSDOne(S, X, r, q, mat, sigma))
    eqt = Exp(-q * mat)
    Select Case CallPut
        Case "Call": BSOptionDelta = NDOne
        Case "Put": BSOptionDelta = NDOne - 1
        Case Else: MsgBox ("You can only specify 'Call' or 'Put'")
    End Select
    BSOptionDelta = eqt * BSOptionDelta
End Function

Private Function BSDOne(S, X, r, q, mat, sigma)
'   Returns Black-Scholes d1 value
    BSDOne = (Log(S / X) + (r - q + 0.5 * sigma ^ 2) * mat) / (sigma * Sqr(mat))
End Function

March 16, 2009

Black Scholes Assumptions

The Black-Scholes model of the market for an equity makes the following explicit assumptions:
  • It is possible to borrow and lend cash at a known constant risk-free interest rate.
  • The stock price follows a geometric Brownian motion with constant drift and constant volatility and they are lognormally distributed.
  • There are no transaction costs.
  • The stock does not pay a dividend (this was modified by Merton later on).
  • All securities are perfectly divisible (i.e. it is possible to buy any fraction of a share).
  • There are no restrictions on short selling.
  • Markets are efficient.

March 5, 2009

How to Post VBA Code on Blogger

  1. Prerequisite:
  2. Textpad
  3. Setup Instructions
  4. Download the syntax file for VB code from the following location. Follow the installation instructions and create a new documnet class for *.vba files.
  5. Ready to put code on your blog
    1. In order to post code save it as a .vba text file.
    2. Open the file using Textpad.
    3. Check that you are happpy with the syntax highlighting.
    4. Select the code you are intreested in copying.
    5. From the context menu select "Copy Other" -> "As a HTML page".
    6. Paste the contents in another text file.
    7. You need to copy the CSS elements to your template - This needs to be done only once.
    8. Copy the area from <pre> and paste it in blog "Edit Html".
Another way of doing syntax highlighting is explained in Fahd' blog

February 26, 2009

A new beginning

I am creating this blog to share the knowledge, I am gaining while doing my MSc in Mathematical Trading and Finance at CASS business school. I am hoping that this blog will be helpful to anyone who is interested in the subject. My aim is to provide, where possible, intution behind the Mathematics involved and present the material in a simple manner.