价格变动的另外两种方式
Delta、gamma 和 vega 涵盖了股价及其波动率。布莱克-斯科尔斯公式还剩两个输入:到期时间和利率。Theta 是期权价值随时间流逝的变化(公式里的 t 每天都在缩短),Rho 是利率变动时的变化。交易员每天感受到的通常是 theta:多头期权是一种不断损耗的资产,每天损失的权利金就是持有凸性的代价。
import math
def norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def norm_pdf(x):
return math.exp(-0.5 * x * x) / math.sqrt(2 * math.pi)
def d1(spot, strike, rate, sigma, t):
return (math.log(spot / strike) + (rate + 0.5 * sigma ** 2) * t) / (sigma * math.sqrt(t))
def d2(spot, strike, rate, sigma, t):
return d1(spot, strike, rate, sigma, t) - sigma * math.sqrt(t)
def call_theta(spot, strike, rate, sigma, t):
decay = -spot * norm_pdf(d1(spot, strike, rate, sigma, t)) * sigma / (2 * math.sqrt(t))
carry = -rate * strike * math.exp(-rate * t) * norm_cdf(d2(spot, strike, rate, sigma, t))
return decay + carry
theta = call_theta(100, 100, 0.05, 0.2, 1)
print(round(theta, 4)) # -6.414 per year
print(round(theta / 365, 4)) # -0.0176 per calendar dayTheta:为什么时间会造成损失
theta 的第一项 -S * pdf(d1) * sigma / (2 * sqrt(T)) 是*期权价值*的衰减:时间越少,出现大幅波动的机会越少。第二项 -r * K * exp(-rT) * N(d2) 是尚无需支付的行权价所产生的利息,由看涨期权买方获得。对看涨期权两项都为负,所以 theta 为负,而且损失并不均匀:越接近到期越快,平值期权最快。通常按日历日报价,即 theta / 365。
# Theta per day for the same option as expiry approaches: the decay speeds up
import math
def norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def norm_pdf(x):
return math.exp(-0.5 * x * x) / math.sqrt(2 * math.pi)
def call_theta(spot, strike, rate, sigma, t):
d_1 = (math.log(spot / strike) + (rate + 0.5 * sigma ** 2) * t) / (sigma * math.sqrt(t))
d_2 = d_1 - sigma * math.sqrt(t)
return -spot * norm_pdf(d_1) * sigma / (2 * math.sqrt(t)) - rate * strike * math.exp(-rate * t) * norm_cdf(d_2)
for days in (360, 90, 30, 7):
per_day = call_theta(100, 100, 0.05, 0.2, days / 365) / 365
print(days, "days left:", round(per_day, 4)) # 360: -0.0177, 90: -0.0288, 30: -0.045, 7: -0.0858Rho:利率
Rho 为 K * T * exp(-rT) * N(d2):看涨期权为正,因为利率越高,将要支付的行权价的现值越低。看跌期权符号相反。对短期期权它是最小的希腊字母,对长期期权(LEAPS、长期权证)则很重要。按每个利率百分点报价,即 rho / 100,就像 vega 按每个波动率点报价。
# Rho of the one-year call at several rates: it grows with the rate and with the time left
import math
def norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def call_rho(spot, strike, rate, sigma, t):
d_1 = (math.log(spot / strike) + (rate + 0.5 * sigma ** 2) * t) / (sigma * math.sqrt(t))
return strike * t * math.exp(-rate * t) * norm_cdf(d_1 - sigma * math.sqrt(t))
for rate in (0.0, 0.05, 0.10):
print("rate", rate, "rho per point:", round(call_rho(100, 100, rate, 0.2, 1) / 100, 4)) # 0.0: 0.4602, 0.05: 0.5323, 0.1: 0.5931
print("two years, 5%:", round(call_rho(100, 100, 0.05, 0.2, 2) / 100, 4)) # 1.0568# Check theta and rho by bumping the inputs: they are slopes of the price
import math
def norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def bs_call(spot, strike, rate, sigma, t):
d_1 = (math.log(spot / strike) + (rate + 0.5 * sigma ** 2) * t) / (sigma * math.sqrt(t))
return spot * norm_cdf(d_1) - strike * math.exp(-rate * t) * norm_cdf(d_1 - sigma * math.sqrt(t))
h = 1e-5
theta = -(bs_call(100, 100, 0.05, 0.2, 1 + h) - bs_call(100, 100, 0.05, 0.2, 1 - h)) / (2 * h)
rho = (bs_call(100, 100, 0.05 + h, 0.2, 1) - bs_call(100, 100, 0.05 - h, 0.2, 1)) / (2 * h)
print(round(theta, 4), round(rho, 4)) # -6.414 53.2325Theta 为 gamma 付费做了 delta 对冲的多头期权在股价波动时赚取 gamma 收益,股价不动的每一天则支付 theta。对冲后的头寸两者几乎相抵:
theta ~ -0.5 * sigma^2 * S^2 * gamma(利率为零时)。因此做多 gamma 的交易员实际上是在赌股价的波动会超过价格中已计入的波动率。- Theta 是随时间流逝损失的价值:多头看涨期权为负,临近到期和平值时更快;按每日
theta / 365报价。 - Rho 是对利率的敏感度:看涨为正、看跌为负,期限越长越大;按每点
rho / 100报价。 - 两者都是价格的斜率,对
t或rate做小扰动即可检验任何公式。
下一节:隐含波动率,把公式反过来用,从期权价格读出市场的波动率。
实验:评分内容
- 用
call_theta给时间流逝定价25 分 - 用
theta_per_day给出每日损耗25 分 - 用
call_rho衡量对利率的敏感度25 分 - 用
rho_per_point给出每个百分点的 rho25 分