Introduction to various options knowledge points and profit and loss structure simulation

foreword

Option is a financial derivative tool created by people in order to avoid market risks (belonging to derivative investment). Theory and practice have proved that as long as investors reasonably choose the securities in their hands and the corresponding ratio of derivatives, they can obtain risk-free returns. . Pricing rules for derivatives such as options were born in the 1970s, providing greater prosperity and guarantee for the financial derivatives market.

This article will first introduce some basic knowledge of options, and the rest is mainly to learn the payoff knowledge of various options and the process of simulating them .

insert image description here

1: Introduction to the basics of options

  • option definition

1: Buy option: Also known as call option (knock-in option), it gives the option holder the right to buy a certain amount of certain assets at a specified price within a given period of time (or at any time during this time) 2: Sell option
: also known as put option (knock-out option), it is to give the option holder to sell a certain amount at a specified price within a given period of time (or at any time during this time). a legal contract of rights to certain assets

  • Exercise method

1: European-style exercise: when the exercise observation date is only the expiration date, the option is a European-style option
2: American-style exercise: when every day within the option period is an early exercise observation date, the option becomes an American-style option
3: Bermuda option: an option that can be exercised at a series of times specified before the expiration date, and its maturity payment structure is the same as that of the European option

  • Types of options

According to different options trading venues, it is divided into on-exchange options and off-exchange options
1: On-exchange options: There are standardized contracts such as commodity options, white sugar, soybean meal options, etc., financial options such as 50ETF, etc.
2: OTC options: non-standardized contracts such as China Securities 500 index options, individual stock options, etc.

According to different underlying assets, there are financial options and real options
1: Financial options: ordinary options such as stock options, foreign exchange options, interest rate options, stock index options, etc. , embedded options such as redeemable securities, refundable securities, convertible securities, etc. Both include options, etc.
2: Real options: The underlying assets of real options are various physical assets such as copper, coal, etc.

According to the types of options, it can be divided into ordinary vanilla options and exotic options 1: Ordinary vanilla options: the most standard European and American options that
we often encounter, etc. 2: Exotic options: exotic options are more complex derivative securities than conventional options. Products are usually OTC or embedded in structured bonds such as Binary Options, Barrier Options, Double Shark Options, Snowball Options, Phoenix Options, etc.

  • At-the-money combination of options

There is a price dependence relationship between the call option, the sell option and the underlying asset, and this dependence is called call and sell option parity. Take ordinary European options as an example to examine this parity relationship.
Let SSS is the stock price,CCC is the call option price,PPP is the put option price,EEE is the strike price, ST S_TSTis the stock price on the maturity date, ttt is the time until the exercise date,rrr is the market interest rate. Assuming that an investor is now at priceCCC sells one unit of the call option at pricePPP buys one unit of put option, atSSS price to buy one unit of the underlying stock of the option at the raterrr borrow a loan with a period ofttThe cash of t , according to the discount formula, has an amount ofE e − rt Ee^{-rt}E er t . The above rights and obligations are all settled on the maturity date. Without considering transaction costs and taxes, the cash flow statement of the investor's cash on the maturity date is as follows: From the above table, it is
insert image description here
found that no matter how the price changes, the portfolio value is 0. Since the above portfolio is a risk-free portfolio, the value at the end of the period is 0. Assuming that there is no arbitrage opportunity in the market, its initial value must be 0. That is,C + S = P + E e − rt C+S=P+Ee^{-rt}C+S=P+E er t . This is the parity formula for options.

Two: Introduction to Option Pricing Theory Option Pricing Elements

Since this article focuses on the study of payoff theory, here is only a brief summary. But we still have to do some introduction and reasoning to the famous Ito formula.

For Brownian motion { B t , t ≥ 0 } \{B_t,t\geq0\}{ Bt,t0 } and the Ito processdxt = a ( x , t ) dt + b ( x , t ) d B t dx_t=a(x,t)dt+b(x,t)dB_tdxt=a(x,t)dt+b(x,t)dBt

Let f ( x , t ) f(x,t)f(x,t ) is defined in[ 0 , ∞ ] × R [0,\infty]\times R[0,]×A binary continuous differentiable function on R , then for the continuous

Non-differentiable d B t dB_tdBtIn terms of Taylor expansion we have

d f ( x , t ) = ∂ f ∂ t d t + ∂ f ∂ x d x t + 1 2 ∂ 2 f ∂ x 2 ( d x t ) 2 + o ( ∣ d x t ∣ d t ) ( 1 ) df(x,t)=\frac{\partial f}{\partial t}dt+\frac{\partial f}{\partial x}dx_t+\frac{1}{2}\frac{\partial^2f}{\partial x^2}(dx_t)^2+o(|dx_t|dt)(1) df(x,t)=tfdt+xfdxt+21x22 f(dxt)2+o(dxtdt)(1)

For differential ( dxt ) 2 (dx_t)^2(dxt)2 we deformed have

( d x t ) 2 = a 2 d t d t + 2 a b d t d B t + b 2 d B t d B t (dx_t)^2=a^2dtdt+2abdtdB_t+b^2dB_tdB_t (dxt)2=a2 dtdt+2 a b d t d Bt+b2dB __tdBt, and then by the Ito isometric property, we have

( d x t ) 2 = b 2 ( x t , t ) d t + o ( d t ) (dx_t)^2=b^2(x_t,t)dt+o(dt) (dxt)2=b2(xt,t)dt+o(dt)

into the above formula (1) (1)( 1 ) finally has

d f ( x , t ) = ( ∂ f ∂ x a + ∂ f ∂ t + 1 2 ∂ 2 f ∂ x 2 b 2 ) d t + ∂ f ∂ x b d B t + o ( ∣ d x t ∣ d t ) df(x,t)=\left( \frac{\partial f}{\partial x}a+\frac{\partial f}{\partial t}+\frac{1}{2}\frac{\partial^2f}{\partial x^2}b^2 \right)dt+\frac{\partial f}{\partial x}bdB_t+o(|dx_t|dt) df(x,t)=(xfa+tf+21x22 fb2)dt+xfbdBt+o(dxtdt)#。

  • Option Pricing Elements

insert image description here

  • Factors Affecting Option Prices and Hedging Strategies

Before introducing this content, let's introduce the option (the price is CCC ) subject to the current bid priceSSS , execution priceKKK , option periodTTT , underlying asset price volatilityσ 2 \sigma^2p2 and the risk-free raterrThe influence of these five factors, the sensitivity of the option to these five factors is called theG reeks GreeksG r e e k s , by(1) above (1)( 1 ) Ito's formula, we know that its calculation formula is expressed as follows:

1: 期权δ ( D delta ) \delta(Delta)δ ( D e l t a ) is to investigate the relationship between the option price and the price of the underlying asset. From a mathematical point of view,δ \deltaδ is the partial derivative of the option price to the underlying asset price, there isδ = ∂ C ∂ S \delta=\frac{\partial C}{\partial S}d=SC

2: Period θ ( T heta ) \theta(Theta)θ ( T h e t a ) represents the sensitivity of the price to the expiration date, which is called the time loss of the option, there isθ = ∂ C ∂ τ \theta=\frac{\partial C}{\partial\tau}i=τC θ > 0 \theta>0 i>0 means profit over time

3: Option υ ( Vega ) \upsilon(Vega)υ ( V e g a ) represents the impact of variance on the option price, there isυ = ∂ C ∂ σ \upsilon=\frac{\partial C}{\partial\sigma}u=σC,若υ > 0 \upsilon >0u>0 means that as the variance rate increases, the option price increases

4: Option ρ ( R ho ) \rho(Rho)ρ ( R h o ) represents the sensitivity of the option value to fluctuations in interest rates, withρ = ∂ C ∂ r \rho=\frac{\partial C}{\partial r}r=rC, if the interest rate increases, the option value increases

5: Periodic Γ ( Gamma ) \Gamma(Gamma)Γ ( G a m m a ) representsδ \deltaThe relationship between δ and the change of the underlying asset price isΓ = ∂ 2 C ∂ S 2 \Gamma=\frac{\partial^2C}{\partial S^2}C=S22 C, since it is a square term, there is no directionality

  • The main methods of option pricing (simple list)

1: Formula method: The analytical method for solving related options based on Black-Scholes derivation has the advantage of being relatively direct and with a small amount of calculation, but it is helpless without an analytical solution, and it requires a high level of mathematical theory support

2: Binary tree method: For options that are path-dependent or have no analytical method, the advantage of this method is that it is simple and intuitive, and does not require deep mathematical knowledge, but the amount of calculation is relatively large

3: Monte Carlo (including Least Squares Monte Carlo): According to the principle of risk-neutral pricing, simulate as much as possible the various movement paths of the target asset in the risk-neutral time, calculate the average option return under each path, and then discount The value of the option can be obtained. Although it is relatively "universal", the amount of calculation is quite large if it is to be accurate. Especially for the pricing of off-market exotic options, this method is often used as the basis

Three: The payoff combination of common vanilla options

For vanilla options, we take European options as an example, and the return to the holder at maturity is

Call option: max ( S − K − c , − c ) max(SKc,-c)max(SKc,c ) (note: ccherec is the option contract price, generally simplifiedc = 0 c=0c=0

Put option: max ( K − S − c , − c ) max(KSc,-c)max(KSc,c)

We use the code to simulate the above structure income and combination income

import matplotlib.pyplot as plt
import pylab as mpl
import numpy as np
mpl.rcParams['font.sans-serif']=['SimHei']##中文乱码问题!
plt.rcParams['axes.unicode_minus']=False#横坐标负号显示问题!

s = list(range(0,200))##价格列表
x = [i for i in range(1,len(s)+1)]
ref = [0 for i in range(1,len(s))]
loc = max(s) / 2
k1 = 100
k2 = 120
p = 1###参与率
c1 = -0##期权价格
c2 = -0
def makefigure(l,text,k,loc,c,ref):
    plt.figure(figsize=(15, 8))
    plt.plot(x,l)
    plt.plot(ref)
    plt.ylabel('Payoff',fontsize=18)
    plt.xlabel('S',fontsize=18)
    plt.title(text,fontsize=18)
    plt.tick_params(labelsize=15)
    plt.annotate('行权价:%s(c1=%s,c2=-5)'%(k,c), xy=(k,c), xytext=(k,loc),arrowprops=dict(arrowstyle="fancy"),fontsize=15)
    return plt.show()

def call_Vanillaoption(k,s,c=0):
    ls = []
    for i in s:
        res = max(p * (i - k),0)
        ls.append(res + c)
    return ls
resc = call_Vanillaoption(k1,s,c1)
#makefigure(resc,'Call',k1,loc/2,c1,ref)

def put_Vanillaoption(k,s,c=0):
    ls = []
    for i in s:
        res = max(p * (k - i),0)
        ls.append(res + c)
    print(ls)
    return ls
resp = put_Vanillaoption(k2,s,c2)
#makefigure(resp,'Put',k1,loc/2,c2,ref)

Let's start with the simplest put option result

insert image description here

figure 1

When the strike price is 100, the strike price is 120, the option contract price is 0, and the put option income with a participation rate of 1 is shown in Figure 1 above, when we adjust the participation rate to 0.8 and the option price is -10, the image becomes as shown in Figure 2 below .insert image description here

figure 2

Note: The participation rate is the proportion of the amount involved in this transaction. For example, the exercise price is 100, the current asset price is 120, and a normal European put option earns 20, but now only 0.8 options participate, that is, 16, and then subtract the contract price 10, and finally made a net profit of 6! That is the slope of KS!

Let's look at the combined return structure of European put and call options

###买入一张看涨一张看跌,行权价不同相同时(相同也同样如此)
res = np.array(resc) + np.array(resp)
makefigure(res,'Call+Put',k1,loc/2,c1,ref)

We choose to buy a call option with an exercise price of 100, and at the same time buy a call option with an exercise price of 120, the contract price is -20, and the participation rate is 1 (not explained below, it is normally 1), see payoff combined results,

insert image description here

image 3

Explanation: For example, if the underlying price of the option expires at 0, the call option we bought will be void, but the option has already lost 20, but the put option we bought has a profit of 120 yuan, and the price of the two contracts is 120-20- 20=80; for another example, if the underlying price at maturity is 108, then the call option will be exercised to buy the underlying asset of 108 at 100 yuan, earning 8 yuan, and the put option will be sold at the exercise price of 120 to earn 12 yuan, but two If the option price is 40, then the net profit is 20-40=-20 (in reality, the option premium is far from being so high, here is just the value given for simulation) .

Let's take a look at the payoff combination of buying an option price of 100 and selling an option price of 120 at the same time, and the option contract is 10 .

##买一张看涨,卖一张看涨期权的收益结构图
tr1 = np.array(call_Vanillaoption(k1,s,c1))
tr2 = - np.array(call_Vanillaoption(k2,s,c1))
bsres = tr1 + tr2
makefigure(bsres,'Call1-Call2',k1,max(bsres)/5,c1,ref)

insert image description here

Figure 4

Explanation: Since it is bought and sold at the same time, the option price will actually be offset by one out and one in. Then when the underlying price is 50, since the option we bought will be invalidated, but the option we sold is given to someone else, the strike price It is 120, so others will not exercise the option. The two options are actually out-of-the-money, meaningless; if the underlying price at this time is 105, then the option bought with an exercise price of 100 will earn 5, but the option sold The exercise price of the issued option is 120, and others still will not exercise it .

Finally, we buy a put option with a strike price of 100 and sell a put option with a strike price of 120. The price of the put option bought is 5, and the call option sold is 10. This is a more complicated payoff combination As shown below ,

tr1 = np.array(put_Vanillaoption(k1,s,c2))
tr2 = - np.array(call_Vanillaoption(k2,s,c1))
bsres = tr1 + tr2
makefigure(bsres,'Put1-Call2',k1,max(bsres)/5,c1,ref)

insert image description here

Figure 5

Four: The payoff of barrier exotic options

There are many types of exotic options, and some of them have been mentioned in the previous content. Here we mainly introduce some barrier options.

Barrier option refers to the option that is subject to certain restrictions during its effective process, and its purpose is to control the investor's gain or loss within a certain range. Single-handicap options generally fall into two categories, knock-out options and knock-in options. A knock-out option means that the option is void when the price of the underlying asset reaches a certain barrier level; a knock-in option is valid only when the price of the underlying asset reaches a certain barrier level .

In the same way, there are multi-barrier options, which correspond to multiple barrier prices, and multiple barrier conditions are touched to correspond to the exercise of the option .

Let's start with the European single-barrier option to simulate the corresponding payoff, and write the payoff formula according to the graph, which is easier to understand!

For call options, knocking down is essentially the same as knocking up! B<K is meaningless

insert image description here

Figure 6

As shown in Figure 6, the barrier price is 130, the strike price is 100, and the call option with a contract price of 10. For the down-in (up-out) call option, we have the payoff structure as follows:

p a y o f f = m a x ( S − K − c , − c ) , S < H ; p a y o f f = − c , S ≥ H payoff=max(S-K-c,-c),S<H;payoff=-c,S\geq H payoff=max(SKc,c),S<H;payoff=c,SH

For call options, knocking up is essentially the same as knocking down! The size of B and K is not required!

insert image description here

Figure 7

As shown in Figure 7, the barrier price is 120, the strike price is 100, and the contract price is 10 call options. For the call option that is knocked up (knocked down), we have the payoff structure as follows:

p a y o f f = m a x ( S − K − c , − c ) , S ≥ H ; p a y o f f = − c , S < H payoff=max(S-K-c,-c),S\geq H;payoff=-c,S< H payoff=max(SKc,c),SH;payoff=c,S<H

For put options, the essence of knocking down and knocking up is the same, and there is no requirement for the size of B and K!

insert image description here

Figure 8

As shown in Figure 8, the barrier price is 180, the strike price is 150, and the put option with a contract price of 10. For the down-in (up-out) put option, we have the payoff structure as follows:

p a y o f f = m a x ( K − S − c , − c ) , S < H ; p a y o f f = − c , S ≥ H payoff=max(K-S-c,-c),S< H;payoff=-c,S\geq H payoff=max(KSc,c),S<H;payoff=c,SH

For put options, the essence of knocking up and knocking down is the same, and there is no requirement for the size of B and K! B>K is meaningless!

insert image description here

Figure 9

As shown in Figure 9, the barrier price is 50, the strike price is 150, and the contract price is 10. For the put option that is knocked up (knocked down), we have the payoff structure as follows:

p a y o f f = m a x ( K − S − c , − c ) , S ≥ H ; p a y o f f = − c , S < H payoff=max(K-S-c,-c),S\geq H;payoff=-c,S< H payoff=max(KSc,c),SH;payoff=c,S<H

The simulation code is given as follows:

import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']##中文乱码问题!
plt.rcParams['axes.unicode_minus']=False#横坐标负号显示问题!

class barrieroption:

    def __init__(self, s, k, pc, pp, c):  # 定义内置初始化函数
        self.s = s
        self.k = k
        self.pc = pc
        self.pp = pp
        self.c = c
        self.x = [i for i in range(1, len(s) + 1)]
        self.ref = [0 for i in range(len(s))]

    def makefigure(self,l,text,k,b,ly):
        plt.figure(figsize=(15, 8))
        plt.plot(self.x,l)
        plt.plot(self.ref)
        plt.ylabel('Payoff', fontsize=18)
        plt.xlabel('S', fontsize=18)
        plt.title(text, fontsize=18)
        plt.tick_params(labelsize=15)
        plt.annotate('行权价(K):%s(c=%s)' % (k,c), xy=(k,c), xytext=(k,ly), arrowprops=dict(arrowstyle="fancy"),
                     fontsize=15)
        plt.annotate('障碍价(B):%s(c=%s)' % (b,c), xy=(b-1,c), xytext=(b,ly/2.5),
                     arrowprops=dict(arrowstyle='->'), fontsize=15)
        return plt.show()

    ###Call
    def call_Vanillaoption(self):
        ls = []
        for i in s:
            res = max(pc * (i - k),0)
            ls.append(res + c)
        return ls
    #向上敲出call(向下敲入call)##b<k没意义
    def upoutcall(self,tls,b):
        for i in range(len(tls)):
            if s[i] > b:
                tls[i] = c
            else:
                pass
        return tls
    ##向上敲入call(向下敲出call)
    def upincall(self,tls,b):
        for i in range(len(tls)):
            if s[i] <= b:
                tls[i] = c
            else:
                pass
        return tls

    #######Put
    def put_Vanillaoption(self):
        ls = []
        for i in s:
            res = max(pp * (k - i),0)
            ls.append(res + c)
        return ls
    ##向下敲入put(向上敲出put)
    def downinput(self,tls,b):
        for i in range(len(tls)):
            if s[i] >= b:
                tls[i] = c
            else:
                pass
        return tls
    # 向下敲出put(向上敲入put)b>k没意义
    def downoutput(self,tls,b):
        for i in range(len(tls)):
            if s[i] < b:
                tls[i] = c
            else:
                pass
        return tls

s = list(range(1,200))
k = 150
b1 = 130
b2 = 120
b3 = 180
b4 = 50
pc = 1###参与率
pp = 1###参与率
c = -10
res = barrieroption(s, k, pc, pp, c)
res11 = barrieroption.call_Vanillaoption(res)
# res12 = barrieroption.upoutcall(res,res11,b1)
# res13 = barrieroption.makefigure(res,res12,'Up-out-call&Down-in-call',k,b1,max(res12)/5)
# res14 = barrieroption.upincall(res,res11,b2)
# res15 = barrieroption.makefigure(res,res14,'Up-in-call&Down-out-call',k,b2,max(res14)/5)
####################################
res21 = barrieroption.put_Vanillaoption(res)
# res22 = barrieroption.downinput(res,res21,b3)
# res23 = barrieroption.makefigure(res,res22,'Down-in-put&Up-out-put',k,b3,max(res22)/5)
res24 = barrieroption.downoutput(res,res21,b4)
res25 = barrieroption.makefigure(res,res24,'Down-out-put&Up-in-put',k,b4,max(res24)/5)

Five: Summary

With the continuous improvement of the modern financial market, the types of investment have become more and more complex, and derivative investment, alternative investment, equity investment, etc. emerge in endlessly. Option investment in derivatives investment is also "rising with the tide", and the corresponding series of investment theories and practical operations are making rapid progress. Therefore, in today's derivatives market, it is inevitable to learn option theory, but the method of solving the problem in terms of the problem itself is more important.

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43577256/article/details/123379030