上一篇 期权的定义
文章目录
编程金融小白学 股票期权
期权策略
单期权策略
-
单期权策略就是单买一种期权。
-
看空
- 预期大跌 买看跌
- 预期不涨 卖看涨
-
看多
- 预期大涨 买看涨
- 预期不跌 卖看跌
看空 | 看多 | |
---|---|---|
预期大跌 买看跌 | 预期大涨 买看涨 | 波动率 |
上升 | ||
预期不涨 卖看涨 | 预期不跌 卖看跌 | 波动率 |
下降 |
风险收益
期权多头 风险收益
- 损失有限 收益理论无限 现实概率低
在何时的概率 | 盈利 | 亏损 |
---|---|---|
合理定价 | 低 | 高 |
期权高估 | 更低 | 更高 |
虚值期权 | 极低 | 极高 |
虚值期权+期权高估 | 极微小 | 极巨大 |
- 期权多头需要注意的是
- 最大亏损为 100%
- 波动率下降时可能导致亏损
- 天然存在 时间价值 time decay
- 行权价的选择
期权空头 风险收益
-
损失理论无限 收益有限 现实概率高
-
在合理定价时 大概率盈利 小概率亏损
-
需要保证金约束
-
尽管如此 有小概率损失巨大
-
期权空头需要注意的是:
- 波动率上升可能导致亏损
- time decay 对空头有利
- 行权价的选择
# 导入 需要的 library 库
import numpy as np # 科学计算
import matplotlib.pyplot as plt # 画图
plt.rcParams['font.sans-serif'] = ['FangSong'] # 设置中文
plt.rcParams['axes.unicode_minus'] = False # 设置中文负号
class Option:
def __init__(self, option_price:float, deposit:float, buy=True):
self.opt = option_price
self.dep = deposit
self.buy = 1 if buy else -1
def call_opt(self, current:np.array):
'''
认购期权(买)
若 现价 - 期权价 < 0 ,不履行合约, 扣除定金
若 现价 - 期权价 > 0 ,履行合约,扣除定金
'''
return self.buy*((current-self.opt)*(current>=self.opt)-self.dep)
def put_opt(self, current:np.array):
'''
认沽期权(卖)
若 期权价 - 现价 < 0 ,不履行合约, 扣除定金
若 期权价 - 现价 > 0 ,履行合约,扣除定金
'''
return self.buy*((self.opt-current)*(current<=self.opt) - self.dep)
def __repr__(self):
return f"期权(期权价{self.opt},定金{self.dep})"
def plotshow(self,title):
plt.axhline(y=0,ls="-",c="black")
plt.axvline(x=self.opt,ls="-",c="green")
plt.grid(True)
plt.title(title)
plt.ylabel('收益')
plt.xlabel('到期价格')
plt.legend(loc='upper right')
plt.ylim((-300,300))
plt.xlim((2500,3500))
plt.show()
buy = Option(3000,100)
sell = Option(3000,100,False)
price = np.linspace(2500,3500,1001)
buy_call = buy.call_opt(price)
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,buy_call,color='red',label='合理定价认购多头')
plt.fill_between(price[:601],buy_call[:601],color='lightskyblue',label='亏损')
plt.fill_between(price[600:],buy_call[600:],color='mistyrose',label='收益')
buy.plotshow('认购多头合理定价时风险区域')
high = Option(3000,150)
high_call = high.call_opt(price)
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,buy_call,color='blue',label='合理定价认购多头')
plt.plot(price,high_call,color='red',label='期权高估认购多头')
plt.fill_between(price[:651],high_call[:651],color='lightskyblue',label='亏损')
plt.fill_between(price[650:],high_call[650:],color='mistyrose',label='收益')
high.plotshow('期权高估时 认购多头 风险区域')
dum_call = buy.call_opt(price-100)
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,buy_call,color='blue',label='合理定价认购多头')
plt.plot(price,dum_call,color='red',label='虚值期权认购多头')
plt.fill_between(price[:701],dum_call[:701],color='lightskyblue',label='亏损')
plt.fill_between(price[700:],dum_call[700:],color='mistyrose',label='收益')
buy.plotshow('虚值期权时 认购多头 风险区域')
跨式策略
底部跨式
- 同时买入 看涨看跌期权
buy_call = buy.call_opt(price)
buy_put = buy.put_opt(price)
sell_call = sell.call_opt(price)
sell_put = sell.put_opt(price)
comb_k = buy_call+buy_put
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,comb_k,color='red',label='底部跨式')
buy.plotshow('底部跨式')
- 亏损:期权费 × 2 \times 2 ×2
- 盈利: [ 0 , ∞ ) [0,\infty) [0,∞)
- 特征:
- 市场方向中性,波动大时获利
- 收益无限而风险有限
- 适用情形:
- 预期市场波动大
- 标的资产价格可能出现大的波动
- 预期有重大消息公布
- 暴跌或暴涨
- 策略变换:
- 顶部跨式策略
- 行权价
- 数量匹配
# 两份看涨 一份看跌
comb_2k = 2*buy_call+buy_put
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,comb_2k,color='red',label='底部跨式')
buy.plotshow('底部跨式数量匹配组合')
顶部跨式策略
- 同时卖出看涨看跌期权
sell_call = sell.call_opt(price)
sell_put = sell.put_opt(price)
comb_k_h = sell_call+sell_put
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,comb_k_h,color='red',label='顶部跨式')
buy.plotshow('顶部跨式')
勒式策略
- 因为跨式 行权价 成本偏高, 所以是对行权价偏高的一种调整
- 买入 两边 行权价 偏低的两个 看涨看跌期权。
buy_call_high = buy.call_opt(price-50)
buy_put_low = buy.put_opt(price+50)
comb_le = buy_call_high+buy_put_low
plt.figure(figsize=(8,5), dpi=600)
plt.plot(price,comb_le,color='red',label='勒式')
buy.plotshow('勒式策略')
- 亏损:期权费 × 2 \times 2 ×2
- 盈利: [ 0 , ∞ ) [0,\infty) [0,∞)
- 特征与适用情形:
- 与跨式相似
- 与跨式相比
- 初始成本下降,回报率上升
- 盈亏平衡点区间扩大
牛市价差组合
看涨 牛市价差组合
- 卖出高价看涨 买入低价看涨
sell_call_high = sell.call_opt(price-50)
buy_call_low = buy.call_opt(price+50)
comb_callbull = buy_call_low+sell_call_high
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_callbull,'--',color='red',label='组合价')
plt.plot(price,comb_callbull-50,color='red',label='牛市期权价差支出') # 50 为期权价差
buy.plotshow('看涨牛市期权价差')
- 策略特征
- 标的上涨时获利,下跌时亏损
- 风险收益均有限
- 与单买看涨期权相比
- 初期成本下降,最大亏损下降
- 温和上涨情况下:回报率相对较高
- 但收益空间有限
- 适用情形:预期标的资产价格温和上涨
- 当期权定价不合理时,会出现上图虚线的套利机会
看跌牛市价差组合
- 买入低价看跌 卖出高价看跌
sell_put_high = sell.put_opt(price-50)
comb_putbull = buy_put_low+sell_put_high
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_putbull,'--',color='red',label='组合价')
plt.plot(price,comb_putbull+50,color='red',label='牛市期权价差收入') # 50 为期权价差
buy.plotshow('看跌牛市期权价差')
- 适用情形:预期标的资产价格温和上涨
- 与看涨牛市价差相比
- 看涨:初期净支出,期末现金流回报 ≥ 0 \geq 0 ≥0
- 看跌:初期净收入,期末现金流回报 ≤ 0 \leq 0 ≤0
- 与单卖看跌相比
- 降低风险 也降低收入
熊市价差组合
看跌熊市价差组合
- 买入高价看跌 卖出低价看跌
sell_put_low = sell.put_opt(price+50)
buy_put_high = buy.put_opt(price-50)
comb_putbear = buy_put_high+sell_put_low
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_putbear,'--',color='red',label='组合价')
plt.plot(price,comb_putbear-50,color='red',label='熊市期权价差支出') # 50 为期权价差
buy.plotshow('看跌熊市期权价差')
- 策略特征
- 标的下跌时获利,上涨时亏损
- 风险收益均有限
- 与单买看跌期权相比
- 初期成本下降,最大亏损下降
- 温和下跌情况下:回报率相对较高
- 但收益空间有限
- 适用情形:预期标的资产价格温和下跌
- 当期权定价不合理时,会出现上图虚线的套利机会
看涨熊市价差组合
- 买入高价看涨 卖出低价看涨
sell_call_low = sell.call_opt(price+50)
comb_callbear = buy_call_high+sell_call_low
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_callbear,'--',color='red',label='组合价')
plt.plot(price,comb_callbear+50,color='red',label='熊市期权价差收入') # 50 为期权价差
buy.plotshow('看涨熊市期权价差')
- 适用情形:预期标的资产价格温和上涨
- 与看跌熊市价差相比
- 看跌:初期净支出,期末现金流回报 ≥ 0 \geq 0 ≥0
- 看涨:初期净收入,期末现金流回报 ≤ 0 \leq 0 ≤0
- 与单卖看涨相比
- 降低风险 也降低收入
蝶式组合
正向蝶式价差
- 买对称高低行权价,卖出双份中行权价
comb_butterfly = buy_call_high+buy_call_low +2*sell_call
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_butterfly,'--',color='red',label='组合价')
plt.plot(price,comb_butterfly-25,color='red',label='正向蝶式价差支出') # 25 为期权价差
buy.plotshow('正向蝶式价差')
- 策略特征
- 市场低波动时高回报率
- 风险收益均有限
- 适用情形:预期市场方向中性、低波动率
- 策略变化
- 看跌期权构造 理论上应相同
- 反向蝶式
- 行权价
- 套利
反向蝶式策略
- 卖对称高低行权价,买双份中行权价
comb_butterfly_op = sell_call_high+sell_call_low +2*buy_call
plt.figure(figsize=(8,5), dpi=800)
plt.plot(price,comb_butterfly_op,'--',color='red',label='组合价')
plt.plot(price,comb_butterfly_op+25,color='red',label='反向蝶式价差收入') # 25 为期权价差
buy.plotshow('反向蝶式价差')
- 策略特征
- 市场高波动时高回报率
- 风险收益均有限
- 适用情形:预期市场高波动率