Speed

In Plus Out Equals Vanilla

Of a knock-in and a knock-out with the same strike, barrier and expiry exactly one pays the plain payoff on every path, so their prices add up to the plain option's price at any barrier; the demo shows the engine's closed-form prices doing it.

The question

Take two options with the same strike, the same barrier and the same expiry: an up-and-out call and an up-and-in call. One is cancelled when the price touches the barrier and the other starts then. Is there a relation between their prices that needs no model of the stock at all?

The lesson shows the relation on paths, then lets the engine price both options at twelve barriers under one model, constant volatility and a barrier watched continuously, and set their sum beside the plain call. All numbers are assumptions of the lesson.

Work it by hand

On any path the barrier is either touched or not. If it is touched, the knock-out pays nothing and the knock-in pays the plain payoff. If it is not, the knock-out pays the plain payoff and the knock-in pays nothing. So on every path the two payoffs add up to the plain payoff, with no assumption about how paths arise.

A price is the discounted expected payoff, and an expected value of a sum is the sum of the expected values. So the price of the knock-in plus the price of the knock-out is the price of the plain option, at every barrier.

That also prices one from the other. If a plain call is worth 8.00 and an up-and-out call with the same strike and barrier is quoted at 1.20, the up-and-in call with the same terms must be 8.00 - 1.20 = 6.80, if the relation is to hold.

Run it

Lines 1 to 4 build the model, the closed-form engine, the plain call and its price. The loop of lines 7 to 16 takes twelve barriers from 105 to 160 in steps of 5: lines 9 and 10 build the knock-out and the knock-in, lines 11 and 12 price them, line 15 keeps the largest gap between their sum and the plain price. Line 22 returns the plain call in whole cents, rounded with lmf.round; line 21 returns the largest gap rounded to nine decimals, which is 0.

Three lines over barriers from 105 to 160. The knock-out price rises from 0.01 to 8.90, the knock-in price falls from 10.44 to 1.55, and the plain call is a flat line at 10.45; at each barrier the first two add up to the third.
let m = model.black_scholes(spot, rate, 0.0, vol);
let eng = pricing.analytic();
let call = instrument.european_call(strike, 1.0);
let plain = pricing.price(call, m, eng).price();
let level = float_list(); let outs = float_list(); let inn = float_list();
let flat = float_list(); let worst = 0.0;
for (k in range(0, 12)) {
  let b = 105.0 + 5.0 * float(k);
  let oo = instrument.barrier_call(strike, 1.0, b, "up-out");
  let oi = instrument.barrier_call(strike, 1.0, b, "up-in");
  let o = pricing.price(oo, m, eng).price();
  let i = pricing.price(oi, m, eng).price();
  level.add(b); outs.add(lmf.round(o, 4)); inn.add(lmf.round(i, 4));
  flat.add(lmf.round(plain, 4));
  worst = max(worst, abs(o + i - plain));
}
lmcode_return_put("barrier", level);
lmcode_return_put("knock_out", outs);
lmcode_return_put("knock_in", inn);
lmcode_return_put("plain", flat);
lmcode_return_put("largest_gap", lmf.round(worst, 9));
let answer = int(math_round(lmf.round(plain, 2) * 100.0));
{
  "answer": 1045,
  "barrier": [
    105,
    110,
    115,
    120,
    125,
    130,
    135,
    140,
    145,
    150,
    155,
    160
  ],
  "knock_out": [
    0.0088,
    0.1186,
    0.4815,
    1.1761,
    2.1645,
    3.3329,
    4.5506,
    5.711,
    6.7457,
    7.6224,
    8.3357,
    8.8974
  ],
  "knock_in": [
    10.4418,
    10.332,
    9.9691,
    9.2745,
    8.2861,
    7.1177,
    5.9,
    4.7395,
    3.7048,
    2.8282,
    2.1149,
    1.5532
  ],
  "plain": [
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506,
    10.4506
  ],
  "largest_gap": 0
}

With the example inputs (spot 100, strike 100, rate 5%, volatility 20%, one year) the plain call is 10.45. At the barrier 120 the knock-out is 1.18 and the knock-in is 9.27; at 105 they are 0.01 and 10.44. The closed forms add up to the plain price only up to the last digit of the floating point, so compare rounded values.

You can change spot, strike, rate and vol, but keep the spot at or below 105, the lowest barrier. From a spot above 105 line 11 stops with "Line 11: barrier touched"; a spot of 0 or less stops line 1 with "Line 1: model.black_scholes: spot must be positive".

A volatility of 0 or less also stops line 1 ("Line 1: model.black_scholes: volatility must be positive"), and a strike of 0 or less stops line 3 ("Line 3: option strike must be positive"). A rate of 0 or below 0 runs; at a rate of -1 every price is 0. At exactly 105 the knock-out is 0 and the knock-in is the plain price.

Your turn

An up-and-out call is quoted at out, a number that is not the model's price. The inputs give the spot, the strike, the rate, the volatility and the barrier, and the quote. The program below should return, in whole cents, the price of the up-and-in call with the same strike and barrier that the relation implies. Decide whether it does, and find the candidates that do. Check runs each candidate on the data shown and on six others.

The spot 90, strike 95, rate 0.03, volatility 0.25, barrier 110 and the quote 1.5 of the up-and-out call.
let m = model.black_scholes(spot, rate, 0.0, vol);
let call = instrument.european_call(strike, 1.0);
let plain = pricing.price(call, m, pricing.analytic()).price();
let answer = int(math_round(lmf.round(out - plain, 2) * 100.0));
{
  "answer": -651
}

An up-and-out call is quoted at out. The inputs give the spot, the strike, the rate (continuous), the volatility, the barrier (above the spot) and the quote out. The model is Black-Scholes with no dividend and one year to expiry. Return, in whole cents, the price of the up-and-in call with the same strike and barrier that the relation between knock-in, knock-out and the plain call implies.

Read the result carefully

The relation holds for any model, because it is about paths. The two prices in the demo, taken one by one, are a model's: constant volatility, a known rate, and a barrier watched at every instant, which a real contract only approximates when it is watched at set times. With another model each price would differ and their sum would still be the plain price.

No rebate is paid when a knock-out is cancelled, which the relation needs. A quote is a number the lesson makes up; real quotes have costs and gaps that the relation ignores. It describes a model on made-up inputs and is not investment advice.

Recap

  • On every path exactly one of a knock-in and a knock-out with the same terms pays the plain payoff.
  • So their prices add up to the plain option's price, at any barrier.
  • The relation needs the same strike, barrier and expiry and no rebate, and no model.
  • A knock-in can therefore be priced as the plain price minus the knock-out.