Calculate American and European option values using the Cox-Ross-Rubinstein model
Call Option
Put Option
European (At Expiry)
American (Any Time)
Calculated Option Value
0.00
Understanding the Binomial Tree Model
The Binomial Tree model, specifically the Cox-Ross-Rubinstein (CRR) model, is a versatile numerical method used for valuation of financial options. Unlike the Black-Scholes model, which is a continuous-time model, the Binomial model assumes that over a discrete time step, the price of the underlying asset will move to one of two possible values (up or down).
The Core Formulas
To construct the tree, we calculate the Up Factor (u) and Down Factor (d) based on the asset's volatility:
Time per Step (Δt): Total Time (T) / Number of Steps (N)
Up Factor (u): e(σ * √Δt)
Down Factor (d): 1 / u
Risk-Neutral Probability (p): (e(r * Δt) – d) / (u – d)
American vs. European Options
One of the primary advantages of the Binomial Tree is its ability to price American Options. Because the tree works backward from expiration, the calculator checks at every single node whether it is more profitable to exercise the option immediately or to continue holding it. This "Early Exercise" feature is what distinguishes American options from European ones.
Example Calculation
Suppose you have a stock trading at 100, a strike price of 100, 6 months to expiration (0.5 years), a risk-free rate of 5%, and a volatility of 20%. If you use a 2-step model:
The stock can go up to 110.51 or down to 90.48 in the first step.
In the second step, it can reach 122.14, 100.00, or 81.87.
The payoff is calculated at these final nodes and discounted back to the present using the risk-neutral probability.
function calculateBinomialOption() {
var S = parseFloat(document.getElementById('stockPrice').value);
var K = parseFloat(document.getElementById('strikePrice').value);
var T = parseFloat(document.getElementById('timeToExpiry').value);
var r = parseFloat(document.getElementById('interestRate').value) / 100;
var sigma = parseFloat(document.getElementById('volatility').value) / 100;
var N = parseInt(document.getElementById('numSteps').value);
var type = document.getElementById('optionType').value;
var style = document.getElementById('exerciseStyle').value;
if (isNaN(S) || isNaN(K) || isNaN(T) || isNaN(r) || isNaN(sigma) || isNaN(N) || N <= 0 || S <= 0 || K <= 0 || T 1000) {
alert("Number of steps limited to 1000 for performance.");
N = 1000;
}
var dt = T / N;
var u = Math.exp(sigma * Math.sqrt(dt));
var d = 1 / u;
var a = Math.exp(r * dt);
var p = (a – d) / (u – d);
var q = 1 – p;
// Terminal Stock Prices and Option Values
var stockPrices = new Array(N + 1);
var optionValues = new Array(N + 1);
for (var i = 0; i = 0; j–) {
for (var i = 0; i <= j; i++) {
// Continuation value
var valueHold = (p * optionValues[i] + q * optionValues[i + 1]) / a;
if (style === "american") {
// Check for early exercise
var st = S * Math.pow(u, j – i) * Math.pow(d, i);
var valueExercise;
if (type === "call") {
valueExercise = Math.max(0, st – K);
} else {
valueExercise = Math.max(0, K – st);
}
optionValues[i] = Math.max(valueHold, valueExercise);
} else {
optionValues[i] = valueHold;
}
}
}
// Display Results
var resultDiv = document.getElementById('resultArea');
var valDisplay = document.getElementById('optionValueResult');
var detailsDiv = document.getElementById('calculationDetails');
resultDiv.style.display = 'block';
valDisplay.innerText = optionValues[0].toFixed(4);
detailsDiv.innerHTML = '
u Factor: ' + u.toFixed(4) + '
' +
'
d Factor: ' + d.toFixed(4) + '
' +
'
Prob (p): ' + p.toFixed(4) + '
';
// Smooth scroll to result
resultDiv.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}