株価への感応度
オプションを持つトレーダーは、株が動いたときに口座がどうなるかを知る必要があります。その答えがデルタで、株が1単位動いたときのオプション価格の変化 dC/dS です。コールのデルタは0〜1、プットは-1〜0です。ブラック=ショールズ・モデルでは、コールのデルタは単に N(d1)、プットのデルタは N(d1) - 1 です。デルタ0.64のアット・ザ・マネーの1年コールは、株が1ドル上がると約64セント増えます。デルタは、オプションがイン・ザ・マネーで終わるおおよその確率としても読まれます。
import math
def norm_cdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def d1(spot, strike, rate, sigma, t):
return (math.log(spot / strike) + (rate + 0.5 * sigma ** 2) * t) / (sigma * math.sqrt(t))
def call_delta(spot, strike, rate, sigma, t):
return norm_cdf(d1(spot, strike, rate, sigma, t))
for spot in (80, 90, 100, 110, 120):
delta = call_delta(spot, 100, 0.05, 0.2, 1)
print(spot, round(delta, 4), round(delta - 1, 4)) # the call delta and the put delta
# 80 0.2219 -0.7781
# 90 0.4298 -0.5702
# 100 0.6368 -0.3632
# 110 0.7958 -0.2042
# 120 0.8965 -0.1035 deep in the money: the call moves almost one for one with the stockバンプによるデルタの測定
閉じた式があるのは単純なオプションだけです。どんな価格モデルでも、デルタは数値的に推定できます。株を少し高くしたときと少し低くしたときでオプションを評価し、その差を間隔で割ります。中心差分 (f(S + h) - f(S - h)) / (2h) は片側差分より正確で、放物線なら厳密です。同じ関数がモンテカルロ価格や二項ツリーにも使えるので、この「動かして再評価」が感応度を得る万能の方法です。h は小さく、ただし丸め誤差が支配しない程度にします(株価の1%が典型的な出発点)。
def bs_call(spot, strike, rate, sigma, t):
d_1 = d1(spot, strike, rate, sigma, t)
return spot * norm_cdf(d_1) - strike * math.exp(-rate * t) * norm_cdf(d_1 - sigma * math.sqrt(t))
def numerical_delta(price_function, spot, bump):
return (price_function(spot + bump) - price_function(spot - bump)) / (2 * bump)
price = lambda s: bs_call(s, 100, 0.05, 0.2, 1) # any function of the spot price will do
print(round(numerical_delta(price, 100, 0.01), 6)) # 0.636831
print(round(call_delta(100, 100, 0.05, 0.2, 1), 6)) # 0.636831 the same as the formulaデルタによるヘッジ
デルタはオプションのポジションを同等の株のポジションに置き換えます。デルタ0.64のコール1枚(100株分)は、小さな動きでは64株を持つのと同じように振る舞います。エクスポージャーを消すには反対のポジションを取ります。コールのロング10枚なら 10 * 100 * 0.6368 = 637 株を売ります。ヘッジ後の持ち高はデルタ中立で、株の小さな動きでは価値がほとんど変わりません。ヘッジは現在の価格にしか合わないため、株とデルタが動いたら調整が必要です。どれくらいの頻度で調整するかは、リスクと取引コストのトレードオフです。
def hedge_shares(contracts, delta, multiplier=100):
return -contracts * multiplier * delta
delta = call_delta(100, 100, 0.05, 0.2, 1)
print(round(hedge_shares(10, delta), 1)) # -636.8 long 10 call contracts: sell about 637 shares
print(round(hedge_shares(-10, delta), 1)) # 636.8 short 10 call contracts: buy about 637 shares
# After a $1 move the options gain about delta * 1 each and the shares lose about the same
print(round(bs_call(101, 100, 0.05, 0.2, 1) - bs_call(100, 100, 0.05, 0.2, 1), 4)) # 0.6461 close to delta, not exactly# Delta as expiry approaches: at the money it stays near 0.5, in the money it goes to 1, out of the money to 0
for t in (1, 0.25, 0.02):
print(t, [round(call_delta(spot, 100, 0.05, 0.2, t), 4) for spot in (90, 100, 110)])
# 1 [0.4298, 0.6368, 0.7958]
# 0.25 [0.1898, 0.5695, 0.8704]
# 0.02 [0.0001, 0.5197, 0.9997]- コールのデルタ
N(d1)は(0, 1)、プットのデルタN(d1) - 1は(-1, 0)。オプション1つの株式換算 - 数値デルタ
(f(S + h) - f(S - h)) / (2h)はどの価格モデルにも使える。hは小さく、ただし丸めノイズより大きく - ヘッジ株数 =
-契約数 * 乗数 * デルタで小さな動きに対してデルタ中立になる。デルタが変わったら調整する
次はガンマです。デルタ自体の感応度で、ヘッジがどれだけ速く古くなるかを示します。
ラボ:採点される内容
call_deltaでコールの株価感応度を測る25点put_deltaでプットのデルタを導く25点numerical_deltaで価格を少し動かしてデルタを測る25点hedge_sharesでポジションを中立化する25点