Portfolio LabKnowledgeSign inCreate account

Option pricer: how Portfolio Lab values options

Advanced18 min read · updated 24 October 2026 · 15 sources

The option pricer on the Options page values vanilla and exotic options with several models side by side, provides all Greeks and the implied volatility, calculates strategies with up to eight legs and fits the volatility smile to option chains with SVI. This methodology describes each method exactly as the code computes it: with formulas, defaults, constants and limits. The formulas follow the collection by Haug (2007).

Inputs and units

The interest rate r, the dividend yield q (for currencies, the foreign interest rate r_f) and the volatility σ are annual figures expressed as continuous rates. You enter the maturity in calendar days; the calculation uses T = days / 365. The permitted range is 1 day to 50 years, volatilities from 0.1% to 500%, and interest rates and dividend yields from −20% to 100%. The page starts with a price and strike of 100, a maturity of 182 days, a 3% interest rate and 20% volatility.

OutputUnit
Price, intrinsic value, time valuecurrency of the underlying, per option on one unit
Delta, Gamma, Speedper unit of price
Vega, Vanna, Volgaper volatility point (one percentage point of σ)
Theta, Charmper calendar day
Rho, Rho dividendper percentage point of interest rate or dividend yield
Lambdapercentage change in value per 1% change in price (leverage)

Black-Scholes-Merton with cost of carry

The pricer values European vanilla options in closed form with the generalized Black-Scholes-Merton model. A single parameter, the cost of carry b, covers three types of underlying: stocks and indices with a continuous dividend yield following Merton (1973), futures following Black (1976) and currencies following Garman and Kohlhagen (1983).

c = S·e^((b−r)T)·N(d₁) − K·e^(−rT)·N(d₂); p = K·e^(−rT)·N(−d₂) − S·e^((b−r)T)·N(−d₁); d₁ = [ln(S/K) + (b + σ²/2)·T] / (σ√T), d₂ = d₁ − σ√T
S
price of the underlying (for a future, the futures price)
K
strike
T
time to maturity in years
r
continuous interest rate
b
cost of carry
σ
volatility p.a.
N
cumulative distribution function of the standard normal distribution
UnderlyingCost of carry bModel
Stock or indexr − q (q = dividend yield)Black-Scholes-Merton
Future0Black 76
Currencyr − r_f (r_f = foreign interest rate)Garman-Kohlhagen

The forward is F = S·e^(bT); for a future, it is the futures price itself, and the option is simply discounted with e^(−rT). For stocks and currencies, b changes with the interest rate, so Rho there also includes the effect on the forward. For a future, b stays at 0, and Rho is −T × price (divided by 100 per percentage point).

With a 2% dividend yield, the same call falls to 9.2270; as an option on a future (b = 0), it costs 7.5771. A currency option with a 2% foreign interest rate has the same value as the stock option with a 2% dividend yield, because both have b = 3%.

Binomial trees

For American and Bermudan options, for barriers in the tree and as a check on European prices, there are three recombining binomial trees with n steps of length Δt = T/n. They differ in how the up and down factors u and d and the risk-neutral probability p are chosen:

TreeFactors u and dProbability p
Cox-Ross-Rubinsteinu = e^(σ√Δt), d = 1/u(e^(bΔt) − d) / (u − d)
Jarrow-Rudde^((b − σ²/2)Δt ± σ√Δt)0.5
Leisen-Reimeru = e^(bΔt)·h(d₁)/h(d₂), d = (e^(bΔt) − p·u)/(1 − p)h(d₂)

Cox-Ross-Rubinstein is the classic tree of Cox et al. (1979). Leisen-Reimer sets the probabilities so that the tree matches the values N(d₁) and N(d₂) of the Black-Scholes formula. This requires an odd number of steps; if you enter an even number, the pricer increases it by one. The function h is the Peizer-Pratt inversion (method 2): h(z) = ½ + sign(z)·½·√(1 − exp(−(z / (n + 1/3 + 0.1/(n + 1)))²·(n + 1/6))).

According to Leisen and Reimer (1996), this tree converges smoothly and with order two for European options, whereas Cox-Ross-Rubinstein and other common trees converge only with order one. Cox-Ross-Rubinstein also oscillates between even and odd numbers of steps. If p lies outside 0 to 1 (very few steps, extreme interest rates), the pricer stops with a message.

StepsCox-Ross-RubinsteinJarrow-RuddLeisen-Reimer
10010.430610.459910.4505 (computed with 101)
10110.468010.459610.4505
50010.446610.453410.4506 (computed with 501)
1,00110.452310.450410.4506

The table shows the call from the standard example; in closed form it costs 10.4506. For any input, the page shows this convergence as a chart over 10 to 300 steps in increments of ten, with the closed-form price as a line.

American and Bermudan exercise

Working backwards through the tree, the continuation value e^(−rΔt)·(p·V_up + (1 − p)·V_down) at each node is compared with the intrinsic value; the larger of the two counts. For American exercise this happens at every step, for Bermudan exercise at m equally spaced dates (step round(k·n/m) for k = 1 … m − 1, plus maturity). The main price comes from the Leisen-Reimer tree with the chosen number of steps (default 500). Cox-Ross-Rubinstein and Jarrow-Rudd are shown alongside for comparison, as is the European price and thus the early exercise premium.

An American call without dividends is worth as much as the European one, in the example likewise 10.4506. Merton (1973) already showed that exercising it early never pays off.

Early exercise boundary: a Leisen-Reimer tree with 601 steps records the critical price at each exercise step, i.e. for a put the highest node at which immediate exercise is worth more than holding, and for a call the lowest. In the example, the boundary starts at about 81, is about 83 after half a year, 86 to 87 a quarter of a year before maturity and just over 98 at the last step. Because the nodes are offset from one step to the next, the line jumps slightly.

Greeks from the tree: Delta, Gamma and Theta can be read directly from the nodes of the first two steps, Theta from the middle node after two steps. For American options, the table of Greeks nevertheless uses central differences of the main price (Leisen-Reimer with 301 steps), so that all Greeks are produced by the same method.

Barrier options

A barrier option comes into existence or is extinguished when the price touches a level H: down-and-out, down-and-in, up-and-out and up-and-in, each as a call or a put. For European options with continuous monitoring, the pricer uses the closed-form formulas of Reiner and Rubinstein, as compiled by Haug (2007) for all eight cases. This includes a rebate: for out options it is paid when the barrier is touched, for in options at maturity if the barrier was never touched. If the price is already beyond the barrier, the in option is a vanilla option and the out option is worth only the rebate. Merton (1973) had already derived a first formula for down-and-out options.

Many contracts monitor the barrier only on fixed dates, for example daily at the closing price. For these, the pricer shifts the barrier away from the price following Broadie et al. (1997) and plugs it into the continuous formula:

H_discrete = H × exp(±0.5826 × σ × √(T/m))
+
barrier above the price (up)
−
barrier below the price (down)
m
number of observations until maturity
0.5826
−ζ(½)/√(2π), ζ = Riemann zeta function

In the tree (Cox-Ross-Rubinstein), the barrier is checked at every step; nodes on or beyond the barrier receive the rebate. For the check tree of a European barrier with 50 to 5,000 observations, the pricer uses exactly that many steps, otherwise the chosen number. The tree prices knock-in options via the parity in = vanilla − out; in doing so, it approximates the rebate of an in option using the risk-neutral probability of never touching the barrier before maturity. American and Bermudan barriers are therefore available only as knock-outs; their main price comes from Cox-Ross-Rubinstein, with Leisen-Reimer alongside.

Digital, Asian and lookback options

Digital: cash-or-nothing pays a fixed amount if the option ends in the money: price = amount × e^(−rT) × N(d₂) for the call, N(−d₂) for the put. Asset-or-nothing delivers the underlying: S × e^((b−r)T) × N(d₁) or N(−d₁). In the standard example, a digital call on an amount of 10 costs exactly 5.3232, the asset version 63.6831.

Asian with a fixed strike: the payoff depends on the average over n equally spaced fixings t_i = i·T/n up to maturity. For the geometric average G there is an exact formula, because the product of lognormal prices is again lognormal: ln G is normally distributed with mean ln S + (b − σ²/2)·T·(n + 1)/(2n) and variance σ²·T·(n + 1)(2n + 1)/(6n²). For a continuous average, the formula of Kemna and Vorst (1990) applies with b_A = ½(b − σ²/6) and σ_A = σ/√3. The pricer values the arithmetic average with Monte Carlo, which Boyle (1977) introduced to option pricing:

  • exact simulation of the log prices at the fixings, by default 40,000 paths with a fixed seed for the random numbers (the same numbers are also used for the Greeks),
  • Antithetic variates: for every random vector z, −z is computed as well; the standard error is therefore taken from the means of the pairs,
  • Control variate following Kemna and Vorst (1990): the geometric average on the same paths, whose exact value is known. The estimator is Ā − β·(Ḡ − G_exact) with β = covariance / variance from the sample; the method is described in Glasserman (2003).

Two fast approximations are shown alongside for comparison: the lognormal approximation of Levy (1992) with the exact first two moments of the discrete average, and the formula of Turnbull and Wakeman (1991), which assumes a continuous average starting today. The profiles across the price use the Levy approximation for arithmetic Asians, because Monte Carlo would be too slow there.

Lookback (continuous monitoring): with a floating strike, the call pays S_T − minimum and the put pays maximum − S_T (Goldman et al. 1979); with a fixed strike, the call pays max(maximum − K, 0) and the put max(K − minimum, 0) (Conze and Viswanathan 1991). You can enter the minimum or maximum so far, for example for an option that is already running; 0 stands for today's price. In the standard example, the lookback call costs 17.2168 with a floating strike and 19.1676 with a fixed strike. The formulas divide by b; for b = 0, the code uses b = 10⁻⁷ as a limiting value.

Greeks: closed form or via differences

For European vanilla options, Delta, Gamma, Vega, Theta and Rho come from the closed-form formulas. Everything else is computed via differences on the respective main model: the Greeks of American and exotic options, and Vanna, Volga, Charm, Speed and the dividend Rho even for vanilla options. Monte Carlo uses the same random numbers for every shift, so that the noise largely cancels out.

GreekMeaningShift for differences
Delta, Gammafirst and second derivative with respect to the priceprice ± 1%
Speedthird derivative with respect to the priceprice ± 1% and ± 2%
Vega, Volgafirst and second derivative with respect to σ, per volatility pointσ ± 1 point (at most ± σ/4)
Vannachange in Delta per volatility pointprice and σ together
Theta, Charmchange in value or in Delta over one calendar daymaturity − 1 day (at most − T/2)
Rho, Rho dividendper percentage point of interest rate or dividend yield± 0.25 percentage points
LambdaDelta × underlying price / option pricefrom Delta and price

Theta is a forward difference (value tomorrow minus value today); all other differences are central.

Profiles: the pricer shows value, Delta, Gamma, Vega and Theta across prices from 50% to 150% of today's price (41 points) for three points in time: today, halfway through the remaining maturity and one week before expiry (at most a quarter of the maturity). For these curves it uses faster settings (150 tree steps, 8,000 paths) and differences with the same shifts; for vanilla and digital options, the payoff at expiry is added as a dashed line.

Implied volatility

For a given market price, the pricer searches for the volatility at which the chosen model returns exactly that price, using Brent's method on the interval from 0.1% to 500% (tolerance 10⁻¹⁰). This works for every option type, including American and exotic ones. If the price lies outside the range the model can produce between 0.1% and 500% volatility (for example below the discounted intrinsic value), there is no solution, and the pricer reports a violation of the arbitrage bounds.

Volatility smile with SVI

Instead of a flat volatility, each option can take its volatility from a smile. The pricer uses Gatheral's SVI parameterization (Stochastic Volatility Inspired) in its raw form, as described by Gatheral and Jacquier (2014): it models the total implied variance w = σ²·T as a function of the log-moneyness k.

w(k) = a + b·(ρ·(k − m) + √((k − m)² + s²)), k = ln(K/F), σ_impl(k) = √(w(k)/T)
a
level of the variance
b
slope of the wings, b ≥ 0 (not the cost of carry)
ρ
skew, −1 < ρ < 1; a negative value makes puts more expensive
m
horizontal shift of the vertex
s
curvature at the vertex, s > 0
F
forward S·e^(bT)

In the parametric input, you specify the ATM volatility instead of a; a then follows from w(0) = σ_ATM²·T, i.e. a = σ_ATM²·T − b·(−ρ·m + √(m² + s²)). The defaults are 20% ATM volatility, b = 0.1, ρ = −0.6, m = 0 and s = 0.1.

Butterfly arbitrage: a smile is only admissible if the risk-neutral density it implies is nowhere negative; otherwise a butterfly spread would have a negative price. According to Gatheral and Jacquier (2014), g(k) ≥ 0 is essentially a necessary and sufficient condition for this:

g(k) = (1 − k·w′/(2w))² − (w′²/4)·(1/w + 1/4) + w″/2
w′, w″
first and second derivative of w with respect to k

The pricer checks g at 301 points from k = −1.5 to 1.5 and warns as soon as the minimum falls below zero. It also checks that the variance stays positive everywhere and that the wings are not too steep: b·(1 + |ρ|) ≤ 4/T.

A smile applies to one maturity. If options with a different maturity use it as well, the pricer applies the same volatility per moneyness ln(K/F), using the forward for each option's maturity; it does not model a term structure of volatility in this way.

Market smile from option chains

In the “Smile and surface” section, the pricer loads the option chains of a US underlying with exchange-traded options (by default SPY, an ETF on the S&P 500) and fits an SVI smile to each expiry:

  1. Expiries: all with 5 to 800 days to expiry; if there are more than eight, the two nearest and then six evenly spaced ones up to about two years.
  2. Filtering prices: only strikes with a bid above 0 and an ask not below the bid; the calculation uses the mid price.
  3. Forward from put-call parity: for the five strikes closest to the current price that have both calls and puts, F = K + e^(rT)·(call − put); the forward is the median of these five values. The interest rate is the US dollar money market rate (continuous), or 4% if no data is available. The forward and the rate give the implied dividend yield q = r − ln(F/S)/T.
  4. Implied volatilities with Black 76 on the forward, out of the money only: puts below the forward, calls at and above the forward. Prices below the discounted intrinsic value or above the upper bound are dropped, as are volatilities below 1% or above 300%.
  5. SVI fit: least squares on the total variance for k from −0.6 to 0.4 (at least five strikes), weighted by 1/(1 + 2|k|) so that strikes near the money count more. Bounds b ≥ 0, |ρ| < 1, s > 0; a negative minimum variance a + b·s·√(1 − ρ²) is penalized. The best fit from three starting values wins.
  6. Result: ATM volatility at k = 0, the root mean square deviation of the fitted from the observed volatilities, the butterfly test, the term structure of ATM volatility and a volatility surface across moneyness K/F from about 67% to 135% (k from −0.4 to 0.3 in steps of 0.05).

The results are cached for 30 minutes. You can load the market smile in the Calculator, under Strategies or in the “Smile and surface” section; after that, the whole surface across all expiries applies in the Calculator and under Strategies. For a maturity T between two expiries T₁ < T < T₂, the total variance per log-moneyness is interpolated linearly, w(k, T) = (1 − λ)·w₁(k) + λ·w₂(k) with λ = (T − T₁)/(T₂ − T₁); before the first and after the last expiry, the implied volatility of the nearest expiry per k is kept, i.e. w = wᵢ(k)·T/Tᵢ. Each leg of a strategy gets the volatility for its own maturity. On loading, the pricer takes the price, the interest rate and the implied dividend yield from the expiry closest to the chosen maturity; it resets the strike, the barrier and any legs whose distance from the price |ln(K/S)| exceeds 0.25 to the current price. “Price with this expiry in the calculator” also sets the maturity of the selected expiry and a strike close to the forward. The butterfly check also applies to the interpolated slice; the pricer does not check whether the slices of two expiries cross (calendar arbitrage). Option prices are often delayed, and illiquid strikes have wide bid-ask spreads; filters and weights dampen this effect but do not eliminate it.

Multi-leg strategies

A strategy consists of 1 to 8 legs: calls, puts or the underlying itself, each with a quantity (positive = bought, negative = sold), strike, maturity and optionally its own volatility. There are templates for 13 common combinations, from the long call to the calendar spread. The calculation works as follows:

  • Volatility per leg: the leg's own volatility, otherwise the smile at the leg's strike (k = ln(K/F) with the forward for the leg's maturity), otherwise the flat volatility.
  • Entry cost: the sum of today's model values (Black-Scholes with cost of carry) times quantity; positive means you pay, negative means you receive a premium.
  • Profit and loss across prices from 60% to 140% of today's price (241 points), today and at the first expiry. Legs that expire later are then valued with Black-Scholes for their remaining maturity and with their own volatility.
  • Break-even: the prices at which the profit at the first expiry changes sign, interpolated linearly between the grid points.
  • Maximum profit and loss: the largest and smallest value in the price range; “unlimited” if the curve is still rising or falling at the edge and thus continues beyond the range shown.
  • Greeks of the strategy: the sum of the closed-form Greeks per leg times quantity; the underlying contributes a Delta of 1.

With a smile, the picture changes: with the default SVI smile, a strangle made up of a 90 put and a 110 call over 91 days gets 29.58% volatility for the put and 17.93% for the call, instead of a uniform 20%.

Limitations

  • No local or stochastic volatility: all models assume a constant volatility over the life of the option. The smile only tells you which constant volatility applies to a given strike.
  • Smile for exotics: for barriers, Asians and lookbacks, the smile volatility at the strike applies to the whole path. Barrier options in particular, however, depend strongly on the volatility near the barrier; the price is then only a rough guide, and the pricer points this out.
  • Continuous monitoring: the formulas for barriers and lookbacks assume continuous monitoring. For barriers there is the Broadie-Glasserman-Kou correction; for lookbacks there is none. With daily monitoring, they slightly overstate the value.
  • Dividends as a yield: the pricer captures individual dividend payments, which are decisive for the early exercise of calls, only through a continuous dividend yield.
  • Simplified market: flat interest rates, no transaction costs and no collateral; strategies value later legs at the first expiry with the same volatility as today.
  • Model values: the figures are fair values under the models' assumptions, not tradable prices and not investment advice.

Frequently asked questions

Why does the pricer show several prices for the same option?

Each model is shown next to the main price as a check. For European vanilla options, the closed-form formula is the main price, and the three binomial trees show the discretization error. For American options, Leisen-Reimer is the main price; for arithmetic Asians, Monte Carlo with control variate; for discretely monitored barriers, the corrected formula.

Why does the Cox-Ross-Rubinstein tree fluctuate with the number of steps?

Because, depending on the number of steps, the strike falls at a different position between two terminal nodes. The error therefore changes sign between even and odd numbers of steps. Leisen-Reimer places the nodes so that this effect almost disappears; in the standard example, just 101 steps match the Black-Scholes price to within 0.0001.

What does the butterfly arbitrage warning mean?

The smile you have set leads to a negative probability density somewhere: a butterfly spread would have a negative price there. Usually the wings are too steep or the curvature s is too small; a smaller b or a larger s generally fixes this.

Why can't the pricer find an implied volatility?

The price you entered lies outside what the model can deliver with 0.1% to 500% volatility, usually below the discounted intrinsic value. Check the price of the underlying, the interest rate and the dividend yield, and whether the price belongs to the option type you selected.

How accurate is the Monte Carlo price of the Asian option?

The pricer shows the standard error alongside. With antithetic variates and the geometric average as control variate, it is 0.0012 in the example with 40,000 paths, about 24 times smaller than without the control variate. A band of two standard errors either side of the price contains the model value with a probability of about 95%.

Where does the data for the market smile come from?

From publicly available option chains of US underlyings with bid and ask prices, which are often delayed. The pricer uses only mid prices of out-of-the-money options and fits an SVI smile to each expiry.

Literature

  1. Black, Fischer (1976): The pricing of commodity contracts. Journal of Financial Economics 3 (1-2), pp. 167–179. doi:10.1016/0304-405X(76)90024-6
  2. Boyle, Phelim P. (1977): Options: A Monte Carlo approach. Journal of Financial Economics 4 (3), pp. 323–338. doi:10.1016/0304-405x(77)90005-8
  3. Broadie, Mark; Glasserman, Paul; Kou, Steven (1997): A Continuity Correction for Discrete Barrier Options. Mathematical Finance 7 (4), pp. 325–349. doi:10.1111/1467-9965.00035
  4. Conze, Antoine; Viswanathan (1991): Path Dependent Options: The Case of Lookback Options. The Journal of Finance 46 (5), pp. 1893–1907. doi:10.1111/j.1540-6261.1991.tb04648.x
  5. Cox, John C.; Ross, Stephen A.; Rubinstein, Mark (1979): Option pricing: A simplified approach. Journal of Financial Economics 7 (3), pp. 229–263. doi:10.1016/0304-405X(79)90015-1
  6. Garman, Mark B.; Kohlhagen, Steven W. (1983): Foreign currency option values. Journal of International Money and Finance 2 (3), pp. 231–237. doi:10.1016/S0261-5606(83)80001-1
  7. Gatheral, Jim; Jacquier, Antoine (2014): Arbitrage-free SVI volatility surfaces. Quantitative Finance 14 (1), pp. 59–71. doi:10.1080/14697688.2013.819986
  8. Glasserman, Paul (2003): Monte Carlo Methods in Financial Engineering. Springer.
  9. Goldman, M. Barry; Sosin, Howard B.; Gatto, Mary Ann (1979): Path Dependent Options: “Buy at the Low, Sell at the High”. The Journal of Finance 34 (5), pp. 1111–1127. doi:10.1111/j.1540-6261.1979.tb00059.x
  10. Haug, Espen Gaarder (2007): The Complete Guide to Option Pricing Formulas. McGraw-Hill, 2nd edition.
  11. Kemna, A.G.Z.; Vorst, A.C.F. (1990): A pricing method for options based on average asset values. Journal of Banking & Finance 14 (1), pp. 113–129. doi:10.1016/0378-4266(90)90039-5
  12. Leisen, Dietmar P. J.; Reimer, Matthias (1996): Binomial models for option valuation - examining and improving convergence. Applied Mathematical Finance 3 (4), pp. 319–346. doi:10.1080/13504869600000015
  13. Levy, Edmond (1992): Pricing European average rate currency options. Journal of International Money and Finance 11 (5), pp. 474–491. doi:10.1016/0261-5606(92)90013-N
  14. Merton, Robert C. (1973): Theory of Rational Option Pricing. The Bell Journal of Economics and Management Science 4 (1). doi:10.2307/3003143
  15. Turnbull, Stuart M.; Wakeman, Lee MacDonald (1991): A Quick Algorithm for Pricing European Average Options. The Journal of Financial and Quantitative Analysis 26 (3). doi:10.2307/2331213

Full bibliography

This page describes how Portfolio Lab calculates; past results are not a forecast. All terms in the glossary.