金融分析与风险管理——期权中的希腊字母(Greeks)
- 1. 期权的Delta
- 2. 期权的Gamma
- 3. 期权的Theta
- 4. 期权的Vega
- 5. 期权的Rho
1. 期权的Delta
期权的Delta:期权价格变动与标的物价格变动的比率,即期权价格与标的物价格之间关系曲线的切线斜率,公式如下:
Δ = ∂ ∏ ∂ S \Delta = \frac{\partial \prod}{\partial S} Δ=∂S∂∏
∏ \prod ∏ 表示期权价格,S 表示标的物价格。
Delta = 0.6 表示:当标的物价格变化一个很小的金额时,相应的期权价格变化约为标的物价格变化的60%。
利用BSM模型的期权定价公式,欧式看涨、看跌的分布如下,具体的过程可以参照:金融分析与风险管理——期权BSM模型。
欧式看涨期权的定价公式:
c = S N ( d 1 ) − K e − r ( T − t ) N ( d 2 ) c = SN(d_1) - Ke^{-r(T-t)}N(d_2) c=SN(d1)−Ke−r(T−t)N(d2)
欧式看跌期权的定价公式:
p = K e − r ( T − t ) N ( − d 2 ) − S N ( − d 1 ) p = Ke^{-r(T-t)}N(-d_2) - SN(-d_1) p=Ke−r(T−t)N(−d2)−SN(−d1)
其中, T T T 是期权的有效期限, t t t 是流失的时间。
N ( x ) = ∫ 1 2 π e − x 2 / 2 d x N(x) = \int\limits \frac{1}{\sqrt{2 \pi}}e^{-x^2/2}\mathrm{d}x N(x)=∫2π
1e−x2/2dx
d 1 = l n ( S K ) + ( r + σ 2 / 2 ) ( T − t ) σ T − t d_1 = \frac{ln(\frac{S}{K}) + (r+\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}} d1=σT−t
ln(KS)+(r+σ2/2)(T−t)
d 2 = l n ( S K ) + ( r − σ 2 / 2 ) ( T − t ) σ T − t = d 1 − σ T − t d_2 = \frac{ln(\frac{S}{K}) + (r-\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}} = d_1 - \sigma \sqrt{T-t} d2=σT−t
ln(KS)+(r−σ2/2)(T−t)=d1−σT−t
接下来以欧式看涨期权的多头为例对其进行推导:
N ′ ( x ) = 1 2 π e − x 2 / 2 N^{'}(x) = \frac{1}{\sqrt{2 \pi}}e^{-x^2/2} N′(x)=2π
1e−x2/2
d 2 = l n ( S K ) + ( r − σ 2 / 2 ) ( T − t ) σ T − t = = > d 2 σ T − t + σ 2 ( T − t ) / 2 = l n ( S K ∗ e r ( T − t ) ) d_2 = \frac{ln(\frac{S}{K}) + (r-\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}} ==> d_2\sigma \sqrt{T-t} + \sigma^2(T-t)/2 = ln(\frac{S}{K}*e^{r(T-t)}) d2=σT−t
ln(KS)+(r−σ2/2)(T−t)==>d2σT−t
+σ2(T−t)/2=ln(KS∗er(T−t))
N ′ ( d 1 ) = N ′ ( d 2 + σ T − t ) = 1 2 π e − ( d 2 + σ T − t ) 2 / 2 = 1 2 π e − d 2 2 / 2 − d 2 σ T − t − σ 2 ( T − t ) / 2 = 1 2 π e − d 2 2 / 2 ∗ e − d 2 σ T − t − σ 2 ( T − t ) / 2 = N ′ ( d 2 ) e − d 2 σ T − t − σ 2 ( T − t ) / 2 = N ′ ( d 2 ) ∗ K S e − r ( T − t ) = = > S N ′ ( d 1 ) = K e − r ( T − t ) N ′ ( d 2 ) − − − − > ( 1 ) N^{'}(d_1) = N^{'}(d_2 + \sigma \sqrt{T-t}) = \\[10pt] \frac{1}{\sqrt{2 \pi}}e^{-(d_2 + \sigma \sqrt{T-t})^2/2} = \\[10pt] \frac{1}{\sqrt{2 \pi}}e^{-d_2^2/2 - d_2 \sigma \sqrt{T-t}-\sigma^2(T-t)/2} = \\[10pt] \frac{1}{\sqrt{2 \pi}}e^{-d_2^2/2}* e^{- d_2 \sigma \sqrt{T-t}-\sigma^2(T-t)/2} = \\[10pt] N^{'}(d_2)e^{- d_2 \sigma \sqrt{T-t}-\sigma^2(T-t)/2} = \\[10pt] N^{'}(d_2)*\frac{K}{S}e^{-r(T-t)} ==> SN^{'}(d_1) = Ke^{-r(T-t)}N^{'}(d_2) ---->(1) N′(d1)=N′(d2+σT−t
)=2π
1e−(d2+σT−t
)2/2=2π
1e−d22/2−d2σT−t
−σ2(T−t)/2=2π
1e−d22/2∗e−d2σT−t
−σ2(T−t)/2=N′(d2)e−d2σT−t
−σ2(T−t)/2=N′(d2)∗SKe−r(T−t)==>SN′(d1)=Ke−r(T−t)N′(d2)−−−−>(1)
∂ d 1 ∂ S = ∂ l n ( S K ) + ( r + σ 2 / 2 ) ( T − t ) σ T − t ∂ S = 1 S σ T − t \frac{\partial d_1}{\partial S} = \frac{\partial \frac{ln(\frac{S}{K}) + (r+\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}}}{\partial S} = \frac{1}{S \sigma \sqrt{T-t}} ∂S∂d1=∂S∂σT−t
ln(KS)+(r+σ2/2)(T−t)=SσT−t
1
∂ d 2 ∂ S = ∂ l n ( S K ) + ( r − σ 2 / 2 ) ( T − t ) σ T − t ∂ S = 1 S σ T − t = = > ∂ d 1 ∂ S = ∂ d 2 ∂ S − − − − > ( 2 ) \frac{\partial d_2}{\partial S} = \frac{\partial \frac{ln(\frac{S}{K}) + (r-\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}}}{\partial S} = \frac{1}{S \sigma \sqrt{T-t}} ==>\frac{\partial d_1}{\partial S} = \frac{\partial d_2}{\partial S} ---->(2) ∂S∂d2=∂S∂σT−t
ln(KS)+(r−σ2/2)(T−t)=SσT−t
1==>∂S∂d1=∂S∂d2−−−−>(2)
Δ = ∂ c ∂ S = ∂ ( S N ( d 1 ) − K e − r ( T − t ) N ( d 2 ) ) ∂ S = N ( d 1 ) + S N ′ ( d 1 ) ∂ d 1 ∂ S − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ S 由 ( 1 ) 与 ( 2 ) 可 推 出 = = > Δ = ∂ c ∂ S = N ( d 1 ) \Delta = \frac{\partial c}{\partial S} = \frac{\partial (SN(d_1) - Ke^{-r(T-t)}N(d_2))}{\partial S} = \\[10pt] N(d_1) + SN^{'}(d_1)\frac{\partial d_1}{\partial S} - Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial S} \\[10pt] 由(1)与(2)可推出==>\Delta = \frac{\partial c}{\partial S} = N(d_1) Δ=∂S∂c=∂S∂(SN(d1)−Ke−r(T−t)N(d2))=N(d1)+SN′(d1)∂S∂d1−Ke−r(T−t)N′(d2)∂S∂d2由(1)与(2)可推出==>Δ=∂S∂c=N(d1)
其Delta的具体表达式如下:
期权类型 | 方向 | Delta表达式 |
---|---|---|
欧式看涨期权 | 多头 | Δ = N ( d 1 ) \Delta = N(d_1) Δ=N(d1) |
欧式看涨期权 | 空头 | Δ = − N ( d 1 ) \Delta = -N(d_1) Δ=−N(d1) |
欧式看跌期权 | 多头 | Δ = N ( d 1 ) − 1 \Delta = N(d_1) - 1 Δ=N(d1)−1 |
欧式看跌期权 | 空头 | Δ = 1 − N ( d 1 ) \Delta = 1 - N(d_1) Δ=1−N(d1) |
利用Python构建欧式看涨、看跌期权 Delta 的函数:
#期权的Delta
def delta_option(S,K,sigma,r,T,optype,positype):
'''
T:期权的剩余期限
optype:表示期权类型,call看涨、put看跌
positype:表示期权头寸,long多头、short空头
'''
import numpy as np
from scipy.stats import norm
d1 = (np.log(S/K)+(r+sigma**2/2)*T)/(sigma*np.sqrt(T))
if optype == 'call':
if positype == 'long':
delta = norm.cdf(d1)
else:
delta = -norm.cdf(d1)
else:
if positype == 'long':
delta = norm.cdf(d1) - 1
else:
delta = 1 - norm.cdf(d1)
return delta
#标的价格与delta的关系
S_list = np.linspace(4,8,100)
Delta_call = delta_option(S = S_list,K=6,sigma=0.24,r=0.04,T=0.5,optype='call',positype='long')
Delta_put = delta_option(S = S_list,K=6,sigma=0.24,r=0.04,T=0.5,optype='put',positype='long')
plt.figure(figsize=(12,6))
plt.subplot(1,2,1)
plt.plot(S_list,Delta_call,label='看涨期权多头')
plt.plot(S_list,Delta_put,label='看跌期权多头')
plt.legend()
plt.grid('True')
#期权期限与delta的关系
T_list = np.linspace(0.1,5,100)
Delta_call1 = delta_option(S = 7,K=6,sigma=0.24,r=0.04,T=T_list,optype='call',positype='long')
Delta_call2 = delta_option(S = 6,K=6,sigma=0.24,r=0.04,T=T_list,optype='call',positype='long')
Delta_call3 = delta_option(S = 5,K=6,sigma=0.24,r=0.04,T=T_list,optype='call',positype='long')
plt.subplot(1,2,2)
plt.plot(T_list,Delta_call1,label='实值看涨期权多头')
plt.plot(T_list,Delta_call2,label='平价看涨期权多头')
plt.plot(T_list,Delta_call3,label='虚值看涨期权多头')
plt.legend()
plt.grid('True')
2. 期权的Gamma
期权的Gamma:期权Delta变动与标的物价格变动的比率,即Gamma是期权价格关于标的物价格的二阶偏导,公式如下:
Γ = ∂ 2 ∏ ∂ S 2 \Gamma = \frac{\partial^2 \prod}{\partial S^2} Γ=∂S2∂2∏
欧式看涨期权的表达式推导如下:
Γ = ∂ 2 c ∂ S 2 = N ′ ( d 1 ) ∂ d 1 ∂ S = N ′ ( d 1 ) S σ T − t \Gamma = \frac{\partial^2 c}{\partial S^2} = N^{'}(d_1) \frac{\partial d_1}{\partial S} = \frac{N^{'}(d_1)}{S \sigma \sqrt{T-t}} Γ=∂S2∂2c=N′(d1)∂S∂d1=SσT−t
N′(d1)
欧式看跌期权的表达式推导如下:
Γ = ∂ 2 p ∂ S 2 = ∂ ( N ( d 1 ) − 1 ) ∂ S = N ′ ( d 1 ) ∂ d 1 ∂ S = N ′ ( d 1 ) S σ T − t \Gamma = \frac{\partial^2 p}{\partial S^2} = \frac{\partial (N(d_1) - 1)}{\partial S} = N^{'}(d_1) \frac{\partial d_1}{\partial S} = \frac{N^{'}(d_1)}{S \sigma \sqrt{T-t}} Γ=∂S2∂2p=∂S∂(N(d1)−1)=N′(d1)∂S∂d1=SσT−t
N′(d1)
利用Python构建欧式看涨、看跌期权Gamma的函数:
#期权的Gamma
def gamma_option(S,K,sigma,r,T):
import numpy as np
# from scipy.stats import norm
d1 = (np.log(S/K)+(r+sigma**2/2)*T)/(sigma*np.sqrt(T))
return np.exp(-d1**2/2)/(S*sigma*np.sqrt(2*np.pi*T))
#标的价格与Gamma的关系
S_list = np.linspace(4,8,100)
gamma_list = gamma_option(S=S_list, K=6, sigma=0.24, r=0.04, T=0.5)
plt.figure(figsize=(12,6))
plt.subplot(1,2,1)
plt.plot(S_list,gamma_list)
plt.grid('True')
#期限与Gamma的关系
T_list = np.linspace(0.1,5,100)
gamma1 = gamma_option(S=7, K=6, sigma=0.24, r=0.04, T=T_list)
gamma2 = gamma_option(S=6, K=6, sigma=0.24, r=0.04, T=T_list)
gamma3 = gamma_option(S=5, K=6, sigma=0.24, r=0.04, T=T_list)
plt.subplot(1,2,2)
plt.plot(T_list,gamma1,label='实值看涨期权')
plt.plot(T_list,gamma2,label='平价看涨期权')
plt.plot(T_list,gamma3,label='虚值看涨期权')
plt.legend()
plt.grid('True')
3. 期权的Theta
期权的Theta:期权价格变化与时间变化(期权剩余有效期)的比率,公式如下:
Θ = ∂ ∏ ∂ T \Theta = \frac{\partial \prod}{\partial T} Θ=∂T∂∏
欧式看涨期权的表达式推导如下:
d 1 − d 2 = σ T − t = = = > ( d 1 − d 2 ) ′ = ∂ σ T − t ∂ t = − σ 2 T − t − − − − − > ( 3 ) ∂ c ∂ t = ∂ ( S N ( d 1 ) − K e − r ( T − t ) N ( d 2 ) ) ∂ t = S N ′ ( d 1 ) ∂ d 1 ∂ t − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ t − r K e − r ( T − t ) N ( d 2 ) 由 ( 1 ) 与 ( 3 ) 可 推 出 = = > Θ c a l l = ∂ c ∂ t = S N ′ ( d 1 ) ( ∂ d 1 ∂ t − ∂ d 2 ∂ t ) − r K e − r ( T − t ) N ( d 2 ) = − S N ′ ( d 1 ) σ 2 T − t − r K e − r ( T − t ) N ( d 2 ) = − S σ e − d 1 2 / 2 2 2 π ( T − t ) − r K e − r ( T − t ) N ( d 2 ) d_1 - d_2 = \sigma \sqrt{T - t} ===> (d_1 - d_2)^{'} = \frac {\partial \sigma \sqrt{T - t}}{\partial t} = - \frac{\sigma}{2 \sqrt {T-t}} ----->(3) \\[10pt] \frac{\partial c}{\partial t} = \frac{\partial (SN(d_1) - Ke^{-r(T-t)}N(d_2))}{\partial t} = \\[10pt] SN^{'}(d_1)\frac{\partial d_1}{\partial t} - Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial t} - rKe^{-r(T-t)}N(d_2) \\[10pt] 由(1)与(3)可推出==> \\[10pt] \Theta_{call} = \frac{\partial c}{\partial t} = SN^{'}(d_1)(\frac{\partial d_1}{\partial t} - \frac{\partial d_2}{\partial t}) - rKe^{-r(T-t)}N(d_2) = \\[10pt] -\frac{SN^{'}(d_1) \sigma}{2 \sqrt {T-t}} - rKe^{-r(T-t)}N(d_2) = \\[10pt] -\frac{S \sigma e^{-d_1^2/2}}{2 \sqrt {2 \pi (T-t)}} - rKe^{-r(T-t)}N(d_2) d1−d2=σT−t
===>(d1−d2)′=∂t∂σT−t
=−2T−t
σ−−−−−>(3)∂t∂c=∂t∂(SN(d1)−Ke−r(T−t)N(d2))=SN′(d1)∂t∂d1−Ke−r(T−t)N′(d2)∂t∂d2−rKe−r(T−t)N(d2)由(1)与(3)可推出==>Θcall=∂t∂c=SN′(d1)(∂t∂d1−∂t∂d2)−rKe−r(T−t)N(d2)=−2T−t
SN′(d1)σ−rKe−r(T−t)N(d2)=−22π(T−t)
Sσe−d12/2−rKe−r(T−t)N(d2)
欧式看跌期权的表达式推导如下:
Θ p u t = ∂ p ∂ t = ∂ ( K e − r ( T − t ) N ( − d 2 ) − S N ( − d 1 ) ) ∂ t = ∂ [ K e − r ( T − t ) ( 1 − N ( d 2 ) ) − S ( 1 − N ( d 1 ) ) ] ∂ t = r K e − r ( T − t ) ( 1 − N ( d 2 ) ) − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ t + S N ′ ( d 1 ) ∂ d 1 ∂ t = S N ′ ( d 1 ) ( ∂ d 1 ∂ t − ∂ d 2 ∂ t ) + r K e − r ( T − t ) ( 1 − N ( d 2 ) ) = − S N ′ ( d 1 ) σ 2 T − t + r K e − r ( T − t ) N ( − d 2 ) = Θ c a l l + r K e − r ( T − t ) \Theta_{put} = \frac{\partial p}{\partial t} = \frac{\partial (Ke^{-r(T-t)}N(-d_2) - SN(-d_1))}{\partial t} = \\[10pt] \frac{\partial [Ke^{-r(T-t)}(1-N(d_2)) - S(1-N(d_1))]}{\partial t} = \\[10pt] rKe^{-r(T-t)}(1-N(d_2)) - Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial t} + SN^{'}(d_1)\frac{\partial d_1}{\partial t} = \\[10pt] SN^{'}(d_1)(\frac{\partial d_1}{\partial t} - \frac{\partial d_2}{\partial t}) + rKe^{-r(T-t)}(1-N(d_2)) = \\[10pt] -\frac{SN^{'}(d_1) \sigma}{2 \sqrt {T-t}} + rKe^{-r(T-t)}N(-d_2) = \\[10pt] \Theta_{call} + rKe^{-r(T-t)} Θput=∂t∂p=∂t∂(Ke−r(T−t)N(−d2)−SN(−d1))=∂t∂[Ke−r(T−t)(1−N(d2))−S(1−N(d1))]=rKe−r(T−t)(1−N(d2))−Ke−r(T−t)N′(d2)∂t∂d2+SN′(d1)∂t∂d1=SN′(d1)(∂t∂d1−∂t∂d2)+rKe−r(T−t)(1−N(d2))=−2T−t
SN′(d1)σ+rKe−r(T−t)N(−d2)=Θcall+rKe−r(T−t)
在日常的使用中,时间是以天为单位,但是在 BSM 模型中,时间则是以年为单位的,使用该模型计算时,需要把天转化成年,其中“每日历天”是按365天计算的;“每交易日”是按252天计算的。
利用Python构建欧式看涨、看跌期权Theta的函数:
#期权的Theta
def theta_option(S,K,sigma,r,T,optype):
import numpy as np
from scipy.stats import norm
d1 = (np.log(S/K)+(r+sigma**2/2)*T)/(sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
theta_call = -(S*sigma*np.exp(-d1**2/2))/(2*np.sqrt(2*np.pi*T)) - r*K*np.exp(-r*T)*norm.cdf(d2)
if optype == 'call':
theta = theta_call
else:
theta = theta_call + r*K*np.exp(-r*T)
return theta
#标的价格与Theta的关系
S_list = np.linspace(1,11,100)
theta_list1 = theta_option(S=S_list,K=6, sigma=0.24, r=0.04, T=0.5,optype='call')
theta_list2 = theta_option(S=S_list,K=6, sigma=0.24, r=0.04, T=0.5,optype='put')
plt.figure(figsize=(12,6))
plt.subplot(1,2,1)
plt.plot(S_list,theta_list1,label='看涨期权')
plt.plot(S_list,theta_list2,label='看跌期权')
plt.legend()
plt.grid('True')
#期限与Theta的关系
T_list = np.linspace(0.1,5,100)
theta1 = theta_option(S=7, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
theta2 = theta_option(S=6, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
theta3 = theta_option(S=5, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
plt.subplot(1,2,2)
plt.plot(T_list,theta1,label='实值看涨期权')
plt.plot(T_list,theta2,label='平价看涨期权')
plt.plot(T_list,theta3,label='虚值看涨期权')
plt.legend()
plt.grid('True')
4. 期权的Vega
期权的Vega:期权价格变化与标的波动率变化的比率,公式如下:
V = ∂ ∏ ∂ σ V = \frac{\partial \prod}{\partial \sigma} V=∂σ∂∏
欧式看涨的表达式推导如下:
d 1 − d 2 = σ T − t = = = > ( d 1 − d 2 ) ′ = ∂ σ T − t ∂ σ = T − t − − − − > ( 4 ) ∂ c ∂ σ = ∂ ( S N ( d 1 ) − K e − r ( T − t ) N ( d 2 ) ) ∂ σ = S N ′ ( d 1 ) ∂ d 1 ∂ σ − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ σ 由 ( 1 ) 与 ( 4 ) 可 推 出 = = > V = ∂ c ∂ σ = S T − t N ′ ( d 1 ) = S T − t e − d 1 2 / 2 2 π d_1 - d_2 = \sigma \sqrt{T - t} ===> (d_1 - d_2)^{'} = \frac {\partial \sigma \sqrt{T - t}}{\partial \sigma} = \sqrt {T-t} ---->(4) \\[10pt] \frac{\partial c}{\partial \sigma} = \frac{\partial (SN(d_1) - Ke^{-r(T-t)}N(d_2))}{\partial \sigma} = \\[10pt] SN^{'}(d_1)\frac{\partial d_1}{\partial \sigma} - Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial \sigma} \\[10pt] 由(1)与(4)可推出==>V = \frac{\partial c}{\partial \sigma} = S\sqrt{T-t}N^{'}(d_1) = \frac{S\sqrt{T-t}e^{-d_1^2/2}}{\sqrt{2\pi}} d1−d2=σT−t
===>(d1−d2)′=∂σ∂σT−t
=T−t
−−−−>(4)∂σ∂c=∂σ∂(SN(d1)−Ke−r(T−t)N(d2))=SN′(d1)∂σ∂d1−Ke−r(T−t)N′(d2)∂σ∂d2由(1)与(4)可推出==>V=∂σ∂c=ST−t
N′(d1)=2π
ST−t
e−d12/2
欧式看跌的表达式推导如下:
∂ p ∂ σ = ∂ ( K e − r ( T − t ) N ( − d 2 ) − S N ( − d 1 ) ) ∂ σ = ∂ [ K e − r ( T − t ) ( 1 − N ( d 2 ) ) − S ( 1 − N ( d 1 ) ) ] ∂ σ = − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ σ + S N ′ ( d 1 ) ∂ d 1 ∂ σ = ∂ c ∂ σ \frac{\partial p}{\partial \sigma} = \frac{\partial (Ke^{-r(T-t)}N(-d_2) - SN(-d_1))}{\partial \sigma} = \\[10pt] \frac{\partial [Ke^{-r(T-t)}(1-N(d_2)) - S(1-N(d_1))]}{\partial \sigma} = \\[10pt] -Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial \sigma} + SN^{'}(d_1)\frac{\partial d_1}{\partial \sigma} = \\[10pt] \frac{\partial c}{\partial \sigma} ∂σ∂p=∂σ∂(Ke−r(T−t)N(−d2)−SN(−d1))=∂σ∂[Ke−r(T−t)(1−N(d2))−S(1−N(d1))]=−Ke−r(T−t)N′(d2)∂σ∂d2+SN′(d1)∂σ∂d1=∂σ∂c
利用Python构建欧式看涨Vega的函数:
#期权的Vega
def vega_option(S,K,sigma,r,T):
import numpy as np
# from scipy.stats import norm
d1 = (np.log(S/K)+(r+sigma**2/2)*T)/(sigma*np.sqrt(T))
return S*np.sqrt(T)*np.exp(-d1**2/2)/np.sqrt(2*np.pi)
vega = vega_option(S=5.8, K=6, sigma=0.24, r=0.04, T=0.5)
#标的价格与Vega
S_list = np.linspace(3,10,100)
vega_list = vega_option(S=S_list, K=6, sigma=0.24, r=0.04, T=0.5)
plt.figure(figsize=(12,6))
plt.subplot(1,2,1)
plt.plot(S_list,vega_list)
plt.grid('True')
#期限与Vega
T_list = np.linspace(0.1,5,100)
vega1 = vega_option(S=8, K=6, sigma=0.24, r=0.04, T=T_list)
vega2 = vega_option(S=6, K=6, sigma=0.24, r=0.04, T=T_list)
vega3 = vega_option(S=4, K=6, sigma=0.24, r=0.04, T=T_list)
plt.subplot(1,2,2)
plt.plot(T_list,vega1,label='实值看涨期权')
plt.plot(T_list,vega2,label='平价看涨期权')
plt.plot(T_list,vega3,label='虚值看涨期权')
plt.legend()
plt.grid('True')
5. 期权的Rho
期权的Rho:期权价格变化与无风险收益率变化的比率,公式如下:
R h o = ∂ ∏ ∂ r Rho = \frac{\partial \prod}{\partial r} Rho=∂r∂∏
欧式看涨的表达式推导如下:
d 1 − d 2 = σ T − t = = = > ( d 1 − d 2 ) ′ = ∂ σ T − t ∂ r = 0 − − − − > ( 5 ) ∂ c ∂ r = ∂ ( S N ( d 1 ) − K e − r ( T − t ) N ( d 2 ) ) ∂ r = S N ′ ( d 1 ) ∂ d 1 ∂ r + ( T − t ) K e − r ( T − t ) N ( d 2 ) − K e − r ( T − t ) N ′ ( d 2 ) ∂ d 2 ∂ r = S N ′ ( d 1 ) ( ∂ d 1 ∂ t − ∂ d 2 ∂ t ) + ( T − t ) K e − r ( T − t ) N ( d 2 ) 由 ( 1 ) 与 ( 5 ) 可 推 出 = = > R h o = ( T − t ) K e − r ( T − t ) N ( d 2 ) > = 0 d_1 - d_2 = \sigma \sqrt{T - t} ===> (d_1 - d_2)^{'} = \frac {\partial \sigma \sqrt{T - t}}{\partial r} = 0 ---->(5) \\[10pt] \frac{\partial c}{\partial r} = \frac{\partial (SN(d_1) - Ke^{-r(T-t)}N(d_2))}{\partial r} = \\[10pt] SN^{'}(d_1)\frac{\partial d_1}{\partial r} + (T-t)Ke^{-r(T-t)}N(d_2) - Ke^{-r(T-t)}N^{'}(d_2)\frac{\partial d_2}{\partial r} = \\[10pt] SN^{'}(d_1)(\frac{\partial d_1}{\partial t} - \frac{\partial d_2}{\partial t}) + (T-t)Ke^{-r(T-t)}N(d_2) \\[10pt] 由(1)与(5)可推出==> Rho = (T-t)Ke^{-r(T-t)}N(d_2)>=0 d1−d2=σT−t
===>(d1−d2)′=∂r∂σT−t
=0−−−−>(5)∂r∂c=∂r∂(SN(d1)−Ke−r(T−t)N(d2))=SN′(d1)∂r∂d1+(T−t)Ke−r(T−t)N(d2)−Ke−r(T−t)N′(d2)∂r∂d2=SN′(d1)(∂t∂d1−∂t∂d2)+(T−t)Ke−r(T−t)N(d2)由(1)与(5)可推出==>Rho=(T−t)Ke−r(T−t)N(d2)>=0
欧式看跌期权的表达式推导如下:
∂ p ∂ r = ∂ ( K e − r ( T − t ) N ( − d 2 ) − S N ( − d 1 ) ) ∂ r = ∂ [ K e − r ( T − t ) ( 1 − N ( d 2 ) ) − S ( 1 − N ( d 1 ) ) ] ∂ r = − ( T − t ) K e − r ( T − t ) ( 1 − N ( d 2 ) ) − K e − r ( T − t ) ( N ′ ( d 2 ) ∂ d 2 ∂ r + S N ′ ( d 1 ) ∂ d 1 ∂ r = S N ′ ( d 1 ) ( ∂ d 1 ∂ t − ∂ d 2 ∂ t ) − ( T − t ) K e − r ( T − t ) ( 1 − N ( d 2 ) ) = − ( T − t ) K e − r ( T − t ) ( 1 − N ( d 2 ) ) = − ( T − t ) K e − r ( T − t ) N ( − d 2 ) < = 0 \frac{\partial p}{\partial r} = \frac{\partial (Ke^{-r(T-t)}N(-d_2) - SN(-d_1))}{\partial r} = \\[10pt] \frac{\partial [Ke^{-r(T-t)}(1-N(d_2)) - S(1-N(d_1))]}{\partial r} = \\[10pt] -(T-t)Ke^{-r(T-t)}(1-N(d_2)) - Ke^{-r(T-t)}(N^{'}(d_2)\frac{\partial d_2}{\partial r} + SN^{'}(d_1)\frac{\partial d_1}{\partial r} = \\[10pt] SN^{'}(d_1)(\frac{\partial d_1}{\partial t} - \frac{\partial d_2}{\partial t}) - (T-t)Ke^{-r(T-t)}(1-N(d_2)) =\\[10pt] -(T-t)Ke^{-r(T-t)}(1-N(d_2)) = -(T-t)Ke^{-r(T-t)}N(-d_2) <= 0 ∂r∂p=∂r∂(Ke−r(T−t)N(−d2)−SN(−d1))=∂r∂[Ke−r(T−t)(1−N(d2))−S(1−N(d1))]=−(T−t)Ke−r(T−t)(1−N(d2))−Ke−r(T−t)(N′(d2)∂r∂d2+SN′(d1)∂r∂d1=SN′(d1)(∂t∂d1−∂t∂d2)−(T−t)Ke−r(T−t)(1−N(d2))=−(T−t)Ke−r(T−t)(1−N(d2))=−(T−t)Ke−r(T−t)N(−d2)<=0
利用Python构建欧式看涨期权 Rho 的函数:
#期权的Rho
def rho_option(S,K,sigma,r,T,optype):
import numpy as np
from scipy.stats import norm
d1 = (np.log(S/K)+(r+sigma**2/2)*T)/(sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
if optype == 'call':
rho = K*T*np.exp(-r*T)*norm.cdf(d2)
else:
rho = -K*T*np.exp(-r*T)*norm.cdf(-d2)
return rho
#标的价格与rho
S_list = np.linspace(3,10,100)
rho_list1 = rho_option(S=S_list, K=6, sigma=0.24, r=0.04, T=0.5,optype='call')
rho_list2 = rho_option(S=S_list, K=6, sigma=0.24, r=0.04, T=0.5,optype='put')
plt.figure(figsize=(12,6))
plt.subplot(1,2,1)
plt.plot(S_list,rho_list1,label='看涨期权')
plt.plot(S_list,rho_list2,label='看跌期权')
plt.legend()
plt.grid('True')
#期限与rho
T_list = np.linspace(0.1,5,100)
rho1 = rho_option(S=8, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
rho2 = rho_option(S=6, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
rho3 = rho_option(S=4, K=6, sigma=0.24, r=0.04, T=T_list,optype='call')
plt.subplot(1,2,2)
plt.plot(T_list,rho1,label='实值看涨期权')
plt.plot(T_list,rho2,label='平价看涨期权')
plt.plot(T_list,rho3,label='虚值看涨期权')
plt.legend()
plt.grid('True')