金融分析与风险管理——期权中的希腊字母

本文详细介绍了金融分析中的期权希腊字母,包括Delta(期权价格与标的物价格的关系)、Gamma(Delta对标的物价格的敏感性)、Theta(期权价值随时间流逝的变化率)、Vega(期权对标的物波动率的敏感性)和Rho(期权对无风险利率的敏感性)。通过BSM模型,解析了各种希腊字母的数学表达式,并用Python实现了相关函数计算欧式期权的这些参数。

金融分析与风险管理——期权中的希腊字母(Greeks)

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)Ker(Tt)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=Ker(Tt)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π 1ex2/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=σTt ln(KS)+(r+σ2/2)(Tt)

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=σTt ln(KS)+(rσ2/2)(Tt)=d1σTt

接下来以欧式看涨期权的多头为例对其进行推导:

N ′ ( x ) = 1 2 π e − x 2 / 2 N^{'}(x) = \frac{1}{\sqrt{2 \pi}}e^{-x^2/2} N(x)=2π 1ex2/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=σTt ln(KS)+(rσ2/2)(Tt)==>d2σTt +σ2(Tt)/2=ln(KSer(Tt))

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+σTt )=2π 1e(d2+σTt )2/2=2π 1ed22/2d2σTt σ2(Tt)/2=2π 1ed22/2ed2σTt σ2(Tt)/2=N(d2)ed2σTt σ2(Tt)/2=N(d2)SKer(Tt)==>SN(d1)=Ker(Tt)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}} Sd1=SσTt ln(KS)+(r+σ2/2)(Tt)=SσTt 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) Sd2=SσTt ln(KS)+(rσ2/2)(Tt)=SσTt 1==>Sd1=Sd2>(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) Δ=Sc=S(SN(d1)Ker(Tt)N(d2))=N(d1)+SN(d1)Sd1Ker(Tt)N(d2)Sd212==>Δ=Sc=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) Δ=1N(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} Γ=S22

欧式看涨期权的表达式推导如下:

Γ = ∂ 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}} Γ=S22c=N(d1)Sd1=SσTt 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}} Γ=S22p=S(N(d1)1)=N(d1)Sd1=SσTt 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) d1d2=σTt ===>(d1d2)=tσTt =2Tt σ>(3)tc=t(SN(d1)Ker(Tt)N(d2))=SN(d1)td1Ker(Tt)N(d2)td2rKer(Tt)N(d2)13==>Θcall=tc=SN(d1)(td1td2)rKer(Tt)N(d2)=2Tt SN(d1)σrKer(Tt)N(d2)=22π(Tt) Sσed12/2rKer(Tt)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=tp=t(Ker(Tt)N(d2)SN(d1))=t[Ker(Tt)(1N(d2))S(1N(d1))]=rKer(Tt)(1N(d2))Ker(Tt)N(d2)td2+SN(d1)td1=SN(d1)(td1td2)+rKer(Tt)(1N(d2))=2Tt SN(d1)σ+rKer(Tt)N(d2)=Θcall+rKer(Tt)

在日常的使用中,时间是以天为单位,但是在 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}} d1d2=σTt ===>(d1d2)=σσTt =Tt >(4)σc=σ(SN(d1)Ker(Tt)N(d2))=SN(d1)σd1Ker(Tt)N(d2)σd214==>V=σc=STt N(d1)=2π STt ed12/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=σ(Ker(Tt)N(d2)SN(d1))=σ[Ker(Tt)(1N(d2))S(1N(d1))]=Ker(Tt)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 d1d2=σTt ===>(d1d2)=rσTt =0>(5)rc=r(SN(d1)Ker(Tt)N(d2))=SN(d1)rd1+(Tt)Ker(Tt)N(d2)Ker(Tt)N(d2)rd2=SN(d1)(td1td2)+(Tt)Ker(Tt)N(d2)15==>Rho=(Tt)Ker(Tt)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 rp=r(Ker(Tt)N(d2)SN(d1))=r[Ker(Tt)(1N(d2))S(1N(d1))]=(Tt)Ker(Tt)(1N(d2))Ker(Tt)(N(d2)rd2+SN(d1)rd1=SN(d1)(td1td2)(Tt)Ker(Tt)(1N(d2))=(Tt)Ker(Tt)(1N(d2))=(Tt)Ker(Tt)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')

在这里插入图片描述

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值