A 30-second introduction to options
I’m not going to go into much depth here, since this blog has a technical focus, but it doesn’t hurt to provide a bit of background and define a few terms.There are many different types of options, but in the vanilla case, an option is a contract wherein one party sells (for an amount referred to as the Premium) another party the right to purchase (a Call option) or sell (a Put option) an asset on pre-agreed terms (for example, at a fixed price referred to as the Strike), at certain points in time. The option buyer can then choose to exercise this right if they wish, but they are not obliged to do so.
If the option can be exercised only on a single date it is referred to as a European option, if it can be exercised on any date it can be referred to as an American option, and if it can be exercised on a fixed list of dates then it is referred to as Bermudan. These names have nothing to do with where the options are traded.
The asset underlying an option can take many different forms: it may be a stock (an Equity Option), a currency (an FX option), another financial contract (e.g. an Interest Rate Future Option – an option on an Interest Rate Futures contract) or a more complex deal (IR Swaptions exercise into Interest Rate Swap, Credit Default Swaptions into CDS, etc). Consequently there are many different pricing methods in existence, catering for different features and peculiarities of specific option types. For simple options there are closed-form approximations, for more exotic options simulation techniques are necessary.
The payoff of a vanilla call option on the exercise date is Max(0, S – K), sometimes written as (S-K)+ – the excess of the asset price over the strike price, if positive, or zero. Why? Because the call option allows you to pay K to receive the asset: if the price of the asset is greater than K then you can profit to the tune of S-K by exercising the option and selling the asset. If the price of the asset is less than K then you won’t exercise the option and your payoff is 0.
For a vanilla put option the option purchaser has a right to sell at K. If the price S is less than K on the exercise date then the option buyer can profit to the tune of K-S by buying the asset for S and exercising the option to sell it at the higher price K.
The Black-Scholes model
In 1973, Fischer Black and Myron Scholes published a paper deriving a formula, which has since come to bear their names, that calculates a theoretical price for a European option in a certain model of the world. That model of the world makes a number of assumptions, including:- It is possible to trade continuously, in any quantity, in order to hedge and without incurring transaction costs,
- there is no arbitrage opportunity,
- cash can be borrowed and lent at a constant risk-free rate of interest,
- the underlying stock may be sold short,
- the underlying stock price follows a Geometric Brownian Motion with a known constant volatility and drift,
- the underlying stock does not pay a dividend.
Over the years various people have developed extensions to the original model that relax one or more of the assumptions, giving rise to a family of related models. The book The Complete Guide to Option Pricing Formulas by Espen Gaarder Haug catalogues many of these variations.
The Black-Scholes formula
To start with, we'll look at the original Black-Scholes formula. In a Black-Scholes world, the formula for a Call option, with the payoff (S-K)+ described above, on a non-dividend paying stock is:- N is the Standard Normal CDF, as described in the previous post
- S is the spot (= current = time t) price of the underlying asset
- K is the strike price of the option – the price payable to purchase the asset at maturity
- r is the continuously compounded annual "risk free" interest rate
- T is the time to maturity, expressed as a fraction of a year
An F# implementation
After all of that, the F# implementation is trivial and not that interesting:module Options.BlackScholesMerton open Distributions let BlackScholes call S K T r v = let sqrtT = Math.Sqrt(T) let vSqrtT = v * sqrtT let d1 = ( Math.Log( S / K ) + ( r + v * v / 2.0 ) * T ) / vSqrtT let d2 = d1 - vSqrtT let KeRT = K * Math.Exp(-r * T) match call with | true -> S * Normal.CDF(d1) - KeRT * Normal.CDF(d2) | false -> KeRT * Normal.CDF(-d2) - S * Normal.CDF(-d1)
As an example of how this can be used, let's look at the RBS (Royal Bank of Scotland) December Call with a strike of 32 on Euronext. This is an American style option, but since RBS isn’t in a position to pay a dividend right now it can be priced as a European option. As of the 27th of November the mid price of the stock was 34.7225. That gives us the first three parameters of the function.
The next parameter, T, is the time to the expiry of the contract expressed as a fraction of a year. The contract specification specifies that the contract expires at 18:30 on the Third Friday of the Expiry month – 18th of December in our case. For simplicity here we can calculate the time to maturity on the basis of a 365 day year and the actual number of days to maturity (we could alternatively count the minutes to today's close, the minutes on the final trading day and the number of whole days in between).
In the contexts I've worked in, the rate r is usually interpolated from a LIBOR/Swap curve. In this case for simplicity we could just interpolate between short term deposit rates such as those on the Financial Times' Markets pages which as of today would give a mid rate of around 0.59%.
The final parameter – the volatility of the underlying asset over the remaining lifetime of the option – has a large impact on the price of the option. Depending on what we were using the option pricing formula for, we could take a couple of different approaches.
We might state our expectation of volatility over the lifetime of the option – perhaps based on historical data, although there is no guarantee the same volatility will be realised again. In this case we would just plug in our expectation as the volatility parameter.
Alternatively, we could note that we have fixed all of the other parameters to the model and can observe the traded price of the option: the only unknown is the volatility. Consequently we can run the Black-Scholes formula in reverse to obtain what is referred to as an implied volatility – the volatility that equates the Black-Scholes model theoretical price with the observed option prices on the market. This will be the topic of another post, as it will make for some interesting code and give me a chance to experiment with some visualizations. For the time being let's assume that we’ve somehow arrived at the conclusion that the volatility will be 20% over the remaining lifetime of the option.
Putting all of that together, a simple example of the usage of the code in FSI is:
> let expiry = DateTime( 2009, 12, 18 );; val expiry : DateTime = 18/12/2009 00:00:00 > let T = float((expiry - DateTime.Today).Days) / 365.0;; val T : float = 0.05479452055 > let r = 0.0059;; val r : float = 0.0059 > let v = 0.20;; val v : float = 0.2 > BlackScholesMerton.BlackScholes true 34.7225 32.0 T r v;; val it : float = 2.758012344
That price is lower than the observed price of around 3.75. To some extent this is explained by the 20% volatility estimate being too low, but there is likely to be difference between the theoretical price and the market price due to other factors such as (perhaps) low trading volume which will make it more difficult to hedge.
Unfortunately there's not much technical content in this post, but it does provide some building blocks that will be used in future posts. Finally, I'm sure I shouldn't need to say anything like this, but any use of the above information or code that you make you do at your own risk: I am not qualified to give advice regarding financial matters and you should do your own research if considering putting any money on the line.