Options
The fundamental logic is No arbitrage
Binomial Option Valuation
Basic Formula
Given risk-neutral, the formula for Binomial at each step is:
class BinomialTreeOption:
def __init__(self, df_spy, X, T, r, N, option_type="call"):
"""
Initialize the Binomial Tree for option pricing with stage-specific volatility.
"""
self.df_spy = df_spy
self.S = spy_price
self.X = X
self.T = T
self.r = r
self.N = N
self.option_type = option_type
self.dt = T / N # Time step size
def compute_rolling_volatility(self, current_date, window=30):
"""
Compute rolling volatility up to a given trading date.
"""
spy_subset = self.df_spy.loc[:current_date]
log_returns = np.log(spy_subset["Close"] / spy_subset["Close"].shift(1))
rolling_vol = log_returns.rolling(window=window).std() * np.sqrt(252)
return rolling_vol.iloc[-1]
def build_stock_tree(self):
"""
Build the binomial tree for stock prices with dynamic volatility.
"""
stock_tree = np.zeros((self.N + 1, self.N + 1))
stock_tree[0, 0] = self.S
trading_dates = self.df_spy.index[-self.N:]
for i in range(1, self.N + 1):
current_date = trading_dates[i - 1]
sigma_t = self.compute_rolling_volatility(current_date)
u = np.exp(sigma_t * np.sqrt(self.dt))
d = np.exp(-sigma_t * np.sqrt(self.dt))
for j in range(i + 1):
stock_tree[j, i] = stock_tree[0, 0] * (u ** (i - j)) * (d ** j)
return stock_tree
def build_option_tree(self):
"""
Build the option price tree using backward induction.
"""
stock_tree = self.build_stock_tree()
option_tree = np.zeros((self.N + 1, self.N + 1))
if self.option_type == "call":
option_tree[:, self.N] = np.maximum(stock_tree[:, self.N] - self.X, 0)
elif self.option_type == "put":
option_tree[:, self.N] = np.maximum(self.X - stock_tree[:, self.N], 0)
trading_dates = self.df_spy.index[-self.N:]
for i in range(self.N - 1, -1, -1):
current_date = trading_dates[i]
sigma_t = self.compute_rolling_volatility(current_date)
u = np.exp(sigma_t * np.sqrt(self.dt))
d = np.exp(-sigma_t * np.sqrt(self.dt))
p = (np.exp(self.r * self.dt) - d) / (u - d)
for j in range(i + 1):
option_tree[j, i] = np.exp(-self.r * self.dt) * (
p * option_tree[j, i + 1] + (1 - p) * option_tree[j + 1, i + 1]
)
return option_tree
def price(self):
"""
Compute the option price at time 0.
"""
option_tree = self.build_option_tree()
return option_tree[0, 0]
def compute_binomial_price(row, df_spy, r, N):
X = row["strike"]
expiration = row["expiration"]
# set to global T
T_local = T
option = BinomialTreeOption(df_spy, X, T_local, r, N)
return option.price()Components
Basic assumptions of binomial tree:
- Begin at
- Up
down , default .
Model one
Proposed by Bruce Tuckman to describe fixed income pricing, as
where
Risk Neutrual Probability
Inferred from no arbitrage, the expected stock price is:
which should be equal to risk free return:
One Period Binomial Model
Now assuming European option:
Then
Put-Call Parity
| Fiduciary call | Protective put | |
|---|---|---|
| If S ≤ X | ||
| If S ≥ X |
Then we have:
Risk-free Portfolio Method
Constructing risk-free portfolio by long
stock and short a call, the value of the portfolio at time is: Then at
: Since the portfolio is risk free,
, then we solve: Then we can solve
by , where : Then we can get the same formula as the risk neutrual probability method.
NOTE
Arbitrage opportunity exists when value is not equal,
Two Period Binomial Model
Same as one period model,
Example
Consider a non-dividend-paying stock currently priced at €50. A European-style call option written on this stock has two years until maturity and an exercise price of €50. The risk-free interest rate is assumed to be 5% per annum. Additionally, the up factor (U) is given as 1.356 and the down factor (D) is 0.744. Based on this information, we are tasked with calculating both the current value of the call option and the current value of the corresponding put option.
To solve the problem, we begin with
Step 1: calculating the stock prices in the binomial tree. The up-up price is
Step 2, we compute the option values at maturity. For the call option, we have
Step 3 involves calculating the risk-neutral probability. The up probability is
Next, we calculate intermediate option values. For the call,
Step 4, we calculate the initial values. The call option is worth
As an additional tip, using the put-call parity formula, we can verify:
Advance Exercise of American Option
- American call options on non-dividend stock will not be exercised early because the value of call option will be greater than exercise: Worth more alive than dead.
- American call option on dividend-paying stock or deep in-the-money option could be exercised earlier.
Two Period Binomial Model of American Option
American option may be exercised early when:
- Exercise value is greater than arbitrage-free value
- Use the higher between exercise value and calculated price at each node.
NOTE
Calculate the option value if exercised
Interest Rate Option
The valuation process is same as standard binomial model, but times nominal principal.
Black-Scholes Model
Assumption
Black-Scholes model is the continuous format of Binomial (when
The underlying asset follows Geometric Brownian Motion, moves smoothly from price to price (continuous).
The continuously compounding risk-free rate is constant and down. Assuming borrowing and lending at risk-free rate.
The volatility of underlying asset is constant
The market is frictionless:
- No transaction costs, no taxes, no regulatory constraints
- No arbitrage
- The underlying asset is highly liguid, and continuous trading
- Short selling of the underlying asset is permitted
Basic Formula
The formula for Black-Scholes is:
def black_scholes(S, X, T, r, sigma):
d1 = (np.log(S / X) + (r + 0.5 * sigma ** 2))/(sigma * np.sqrt(T))
d2= d1 - sigma * np.sqrt(T)
return S * norm.cdf(d1) - X * np.exp(-r * T) * norm.cdf(d2)Initial Model
Similar as put-call parity, call option can be regarded as leveraged stock investment (Long stock(
Conclusion of and
is the of call option is the of a put option is the risk-neutral probability that a call option will be exercised at expiration (ITM). is the risk-neutral probablility that a put option will be exercised at expiration (ITM). .
BSM Model with Carrying Benefits or Costs
Options On Future
Position
The position of future depends on the position on option:
- Long call
Long futrue position - Long put
Short future position
The strike price is contracted in the option. For long call, exercise if
Black Model
IMPORTANT
Usually in practice, option and future will be set expire at same tim e (American Option).
Interest Rate Option
The contract is similar to Option on Futures and FRA. The position judgement and exercise case is exactly same as Option on Futures
Swapation
Swapation is an option to enter a swap:
- A payer swapation is an option to enter into a swap as the fixed-rate payer (Long).
- A receive swapation is an option to enter into a swap as the fixed rate receiver (Short).
Greeks
From Black-Scholes model,
We can understanding it asL
Then,
Delta
For non-dividend paying stock:
NOTE
In this case,
For dividend-paying stock:
NOTE
Gamma
NOTE
NOTE
Theta
Theta is usually negative for both call and put options as their value decrease in value by time. With:
- Exception: Deep in the money put options