Option Pricing using the Binomial Tree Model in C#
Post on: 4 Май, 2015 No Comment

Introduction
I would like to put forth a simple class that calculates the present value of an American option using the binomial tree model.
Background
Calculation of a European option is typically performed using the closed form solution that Fischer Black and Myron Scholes developed in 1973. While the Black-Scholes formula is well-known as the equation that triggered huge growth in the options markets, what are perhaps less well-known are some of the alternative models for pricing options, particularly for American-style options. In 1979, a few gentlemen by the names of Cox, Ross, and Rubenstein came up with what is known as the binomial tree or binomial lattice method. This is the standard method used for calculating the value of an American option. Unlike the Black-Scholes model, the binomial tree model is not a closed form equation, but rather is a computationally intensive numerical method.
Because of put-call parity, the behavior that two products with the same payoff must have the same value, we can create a synthetic option by valuing a replicating portfolio of assets that have the same payoff. The model uses a lattice made up of discrete time steps, and each node in the lattice represents a possible price at a particular (discrete) point in time. We start at the final time step (maturity) and work backwards, valuing each node along the way until we reach the current time.
Pricing American Options
For an American option, we calculate the value of each binomial node as the maximum of either the Strike minus the Exercise price or zero (for a call), or the maximum of the Exercise price minus the Strike or zero (for a put). The reason we must calculate this payoff at every node is because the owner of the option has the ‘option’ to exercise at every discrete time step.
Implementing the Binomial Tree
In this example, my approach was to be as clear as possible in the code. If I was to include this code in a large-scale pricing system, I would of course not include basic financial math functions such as present value or n factorial in the binomial tree class. But for the sake of expediency, these small functions are included within the class.
An enumeration, EPutCall, is used to represent whether the option is a call or a put.
The user of this class may either pass all the arguments in the constructor, or if instance reuse is required, can set properties. The arguments required are the current AssetPrice. Strike. TimeStep. Volatility. EPutCall. EOptionStyle. RiskFreeRate. and Steps. which is the number of discrete time steps the user designates the binomial tree to contain.
The core calculation of the binomial tree model is the value of each node on the tree. You may have noticed that this code only supports options on assets that do not pay dividends. To modify the code for dividend-paying assets, simply subtract the dividend from the risk free rate such that:
The binomial coefficient is a part of the formula used in calculating the value of an individual binomial node.

While intuitively we think of calculating the nodes on a binomial tree backwards, you will notice that my for loop is counting up. This is because my counter, j. is being used to calculate the current step number by subtracting j from the number of total steps ( step — j ).
For an American option, we must calculate the expected payoff at each node of the tree. The payoff is always the greater of the intrinsic value or zero, as intrinsic value cannot be less than zero.
To use our little C# binomial tree class, we can simply pass all our arguments into the constructor and retrieve the OptionValue property. In this case, we are pricing a put option where the current price of the asset is 100, the strike is set at 95, the time to maturity is 0.5 years, annualized volatility is 30%, the risk free rate is 8%, and we are constructing a binomial tree of 5 discrete time steps.
Finally, let’s compare our results with the final result of a 100,000 step Monte Carlo simulation. After all, we don’t want to rely on a model that hasn’t been thoroughly tested!
Points of Interest
In addition to the binomial tree, American options may be modeled using a trinomial tree. This model assumes an asset may move up, down, or remain flat. Another model is the jump diffusion model where asset price changes are assumed to not only vary in direction but also in magnitude. These models are, of course, more complex than the simple binomial tree but are typically closer to real world option pricing.