デルタは一定ではない
デルタヘッジが正確なのは一瞬だけです。株が動くとオプションのデルタが変わり、ヘッジは合わなくなります。ガンマは株に対するデルタの変化率で、gamma = d(delta)/dS、価格の2階微分です。コールでもプットでもロングならガンマは正です。ブラック=ショールズでは pdf(d1) / (S * sigma * sqrt(T)) で、コールとプットで同じ値になり、pdf は釣鐘型の密度です。ガンマが大きいとヘッジがすぐに古くなり、頻繁な調整が必要になります。
import math
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 gamma(spot, strike, rate, sigma, t):
return norm_pdf(d1(spot, strike, rate, sigma, t)) / (spot * sigma * math.sqrt(t))
for spot in (80, 90, 100, 110, 120):
print(spot, round(gamma(spot, 100, 0.05, 0.2, 1), 5))
# 80 0.0186
# 90 0.02182
# 100 0.01876
# 110 0.01289
# 120 0.0075 gamma peaks near the strike and fades far from it満期が近づくとガンマは大きくなる
アット・ザ・マネーのオプションでは、満期が近づくとガンマが急上昇します。残り1年で0.019、3か月で0.039、1週間で0.141です。満期間際のオプションは、無価値か動いた分全額の価値かのほぼコイン投げで、デルタが極めて狭い価格帯で0から1に振れます。満期近くにオプションを売っているトレーダー(ショート・ガンマ)がよく眠れないのはそのためで、ヘッジは絶えず調整が必要で、ジャンプは痛手になります。ガンマは2階差分 (f(S + h) - 2 f(S) + f(S - h)) / h²(放物線なら厳密)で、どんなモデルでも推定できます。
for t in (1, 0.25, 0.02):
print(t, round(gamma(100, 100, 0.05, 0.2, t), 5))
# 1 0.01876
# 0.25 0.03929
# 0.02 0.14087 a week before expiry the at-the-money gamma is 7 times larger
def numerical_gamma(price_function, spot, bump):
return (price_function(spot + bump) - 2 * price_function(spot) + price_function(spot - bump)) / bump ** 2
price = lambda s: bs_call(s, 100, 0.05, 0.2, 1) # bs_call as in the previous topic
print(round(numerical_gamma(price, 100, 0.5), 5)) # 0.01876 the same as the formulaガンマが生む利益
デルタは株とともに変わるため、ロングのオプションは、株がどちらに動いてもデルタだけの予測より多く稼ぎます。5ドル上昇するとデルタは0.637から 0.637 + 0.01876 * 5 = 0.731 になります。値動きによる利益は delta * 値動き + 0.5 * gamma * 値動き² で、第2項がロング・オプションのガンマ利益(ショートでは損失)です。値動きの二乗で増えるので、どちら向きでも大きな動きはロング・ガンマ側に有利です。この利益はタダではなく、保有者はプレミアムと時間価値の減衰で支払っています。
g = gamma(100, 100, 0.05, 0.2, 1)
delta = call_delta(100, 100, 0.05, 0.2, 1) # as in the delta topic
print(round(delta, 4), round(delta + g * 5, 4)) # 0.6368 0.7306 the delta after a $5 rise
print(round(call_delta(105, 100, 0.05, 0.2, 1), 4)) # 0.7237 the exact delta at 105 (gamma is a first-order guide)
move = 5
true_gain = bs_call(105, 100, 0.05, 0.2, 1) - bs_call(100, 100, 0.05, 0.2, 1)
print(round(true_gain - delta * move, 4), round(0.5 * g * move ** 2, 4)) # 0.2232 0.2345 what delta missed, and what gamma explains# Dollar gamma: how many dollars of stock the delta hedge changes for a 1% move of the stock at 100
print(round(g * 100 ** 2 / 100, 3)) # 1.876- ガンマ =
pdf(d1) / (S * sigma * sqrt(T))(価格の2階微分)。コールとプットで同じで、行使価格付近と満期近くで最大 - 数値ガンマ
(f(S + h) - 2 f(S) + f(S - h)) / h²、値動き後のデルタdelta + gamma * 値動き - 値動きは
delta * 値動き + 0.5 * gamma * 値動き²を生む。ロングのオプションは上下どちらの大きな動きでも得をし、その代償は時間価値の減衰
次はベガです。誰も直接観測できない入力、ボラティリティへの感応度を学びます。
ラボ:採点される内容
gammaでデルタの変化の速さを測る25点numerical_gammaで任意の価格の曲率を測る25点delta_after_moveで値動き後のデルタを更新する25点gamma_pnlで曲率の恩恵を金額にする25点