Barrier Options
Barrier Options
Visit the Mathema Option Pricing System, supporting FX options and structured product pricing and valuation!
Stock barrier options have been traded in the over-the-counter (OTC) market since 1967. Barrier options have become extremely popular and are undoubtedly the most favored category of exotic options. The Chicago Board Options Exchange and the American Options Exchange now list up-and-out calls and down-and-out puts on stock indices. In the OTC market, a variety of barrier options are actively traded, including those on currencies, interest rates, and commodities.
European Barrier Options
Merton (1973) and Reiner and Rubinstein (1991a) proposed formulas for pricing standard barrier options (Rich, 1994). These formulas use a common set of factors:
Here:
"Knock-in" Barrier Options
A "knock-in" barrier option is paid for today but only comes into existence if the asset price reaches the barrier level before expiration. It may also include a pre-specified cash rebate , which is paid if the option is not knocked in during its lifetime.
Down-and-in Call ()
Payoff: If before expiration, the payoff is ; otherwise, is paid at expiration.
Up-and-in Call ()
Payoff: If before expiration, the payoff is ; otherwise, is paid at expiration.
Down-and-in Put ()
Payoff: If before expiration, the payoff is ; otherwise, is paid at expiration.
Up-and-in Put ()
Payoff: If before expiration, the payoff is ; otherwise, is paid at expiration.
"Knock-out" Barrier Options
A "knock-out" barrier option is similar to a standard option, except that it becomes worthless if the asset price reaches the barrier level before expiration. It may include a pre-specified cash rebate , which is paid if the option is knocked out before expiration.
Down-and-out Call ()
Payoff: If before expiration, the payoff is ; otherwise, is paid when the barrier is hit.
Up-and-out Call ()
Payoff: If before expiration, the payoff is ; otherwise, is paid when the barrier is hit.
Down-and-out Put ()
Payoff: If before expiration, the payoff is ; otherwise, is paid when the barrier is hit.
Up-and-out Put ()
Payoff: If before expiration, the payoff is ; otherwise, is paid when the barrier is hit.
Calculation Example
import math
from scipy.stats import norm
def european_call_option(S, X, T, r, sigma):
d1 = (math.log(S / X) + (r + 0.5 * sigma ** 2) * T) / (sigma * math.sqrt(T))
d2 = d1 - sigma * math.sqrt(T)
return S * norm.cdf(d1) - X * math.exp(-r * T) * norm.cdf(d2)
def down_and_in_call(S, X, T, r, sigma, H, K):
mu = (r - 0.5 * sigma ** 2) / sigma ** 2
lambda_ = math.sqrt(mu ** 2 + 2 * r / sigma ** 2)
x1 = (math.log(S / X) + (1 + mu) * sigma * math.sqrt(T)) / (sigma * math.sqrt(T))
x2 = (math.log(S / H) + (1 + mu) * sigma * math.sqrt(T)) / (sigma * math.sqrt(T))
y1 = (math.log(H ** 2 / (S * X)) + (1 + mu) * sigma * math.sqrt(T)) / (sigma * math.sqrt(T))
y2 = (math.log(H / S) + (1 + mu) * sigma * math.sqrt(T)) / (sigma * math.sqrt(T))
z = (math.log(H / S) + lambda_ * sigma * math.sqrt(T)) / (sigma * math.sqrt(T))
A = S * math.exp((r - sigma ** 2 / 2) * T) * norm.cdf(x1) - X * math.exp(-r * T) * norm.cdf(x1 - sigma * math.sqrt(T))
B = S * math.exp((r - sigma ** 2 / 2) * T) * norm.cdf(x2) - X * math.exp(-r * T) * norm.cdf(x2 - sigma * math.sqrt(T))
C = S * math.exp((r - sigma ** 2 / 2) * T) * (H / S) ** (2 * (mu + 1)) * norm.cdf(y1) - X * math.exp(-r * T) * (H / S) ** (2 * mu) * norm.cdf(y1 - sigma * math.sqrt(T))
D = S * math.exp((r - sigma ** 2 / 2) * T) * (H / S) ** (2 * (mu + 1)) * norm.cdf(y2) - X * math.exp(-r * T) * (H / S) ** (2 * mu) * norm.cdf(y2 - sigma * math.sqrt(T))
E = K * math.exp(-r * T) * (norm.cdf(-z) - (H / S) ** (2 * mu) * norm.cdf(y2 - sigma * math.sqrt(T)))
F = K * ((H / S) ** (mu + lambda_) * norm.cdf(z) + (H / S) ** (mu - lambda_) * norm.cdf(z - 2 * lambda_ * sigma * math.sqrt(T)))
c_di_X_H = A - B + D + E
c_di_X_H_eta1_phi1 = c_di_X_H * 1 * 1
return c_di_X_H_eta1_phi1
# Set parameters
S = 100 # Stock price
X = 95 # Strike price
T = 1 # Time to maturity (years)
r = 0.05 # Risk-free rate
sigma = 0.2 # Volatility
H = 90 # Barrier level
K = 5 # Cash rebate
# Calculate Down-and-in call option payoff
result = down_and_in_call(S, X, T, r, sigma, H, K)
print("Down-and-in call option payoff:", result)