MATLAB Price Barrier Up and Out Call Flashcards

1
Q

Simulate M trajectories in [t0,t0+T] in N time-steps of size delta T
Number of trajectories and time step for the simulation

A
M = 4
deltaT = T/N
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Generate M x N samples from N(0,1)

A

X = randn (M,N)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Generate the matrix of initial stock price in the first column and multipliers in other columns

A

Y = [S0*ones(M,1)

exp((r-0.5sigma^2)deltaT+sigmasqrt(deltaT)X)]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Generate M trajectories with N monitoring times

A

S = cumprod(Y,2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Check whether the trajectory is below the barrier:
1 if the price did not cross the barrier at some monitoring time;
0 otherwise

A

indexUnderBarrier = all(S kleiner als B,2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compute the payoff for each trajectory

value of S at maturity

A

ST = S(:,end)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Compute the payoff for the European Call Option

A

payoff = max(ST-K,0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Assign payoff equal to zero if the price crossed the barrier

A

payoff = payoff*indexUnderBarrier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

MC estimate of the price of the option and standard deviation of this estimate

A

discountFactor = exp(-r*T)

price_MC_UO = discountFactor*mean(payoff)
stdev_MC_UO = discountFactor*std(payoff)/sqrt(M)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly