# How do we calculate option payoff before expiration?

I am trying to simulate a bull spread option

and I have used an online tutorial to calculate payoff at expiry but I am having difficulty simulating the payoff before expiration.

What I have done so far,

# payoff for long call
long call payoff = max(spot-strike,0)-long call premium

# payoff for short call
short call payoff = -1*(max(spot-strike,0)- short call premium)

# Theoretical P&L
theoretical p&l= long call payoff + short call payoff

* bs_model = Black Scholes Model


This theoretical P&L I plotted to a graph but instead of getting the smooth sigmoidal curve like the image above I getting a weird graph?

Edit:

The above calculations are my own guess work of calculating theoretical P&L. Can any one share a good link which explains the calculation of theoretical payoff before expiry? I searched all the web and cant find any?

• This seems wrong but is hard to judge without your code, some of your numbers or the graph you've created. Please edit your question to add these. – Bob Jansen Jul 24 '19 at 11:21
• I have edited my question and added my calculations to it – Eka Jul 24 '19 at 11:44

Somewhere must be a little error, here I used $$r=0.02$$ and $$\sigma=0.25$$. In black you have the payoff and in red the current price of the portfolio. Note that as the time to maturity decreases, the red line converges towards the black line. In grey and and yellow (on the secondary axis), you can see the individual call option prices which form your portfolio. So, I am sure you just have a little error somewhere and as Bob said, if you show your calculations, we'll be able to point at it or you may find it yourself.

Here, you can see the plot if the time to maturity is small (e.g. 0.01).

## Edit

All you have to do is to implement the Black Scholes formula for two call options which have different strike prices. To this end, implement the formula above and input a vector of stock prices to this function. It will output you a vector containing the current option prices which you can then plot getting a similar plot as above.

Please note that you do not compute payoffs before expiry'' but thefair'' option price according to some model. The Black Scholes formula looks like a payoff weighted with some probabilities, i.e. $$C(t,S) = S_t N(d_1)+Ke^{-r(T-t)}N(d_2)$$.

If you want to implement this function, you may use the following MATLAB code which can be easily translated into any other coding language.

• I added a code for computing Black Scholes prices which you can find everywhere on the internet. Just input several stock prices (in the range between 35 in 45), once for $K=39$ and $K=41$ and subtract both vectors and plot them. Then, you will get a plot as in my post which agrees with the one in your question. – KeSchn Jul 24 '19 at 14:01
• Thank you, It worked I was unnecessarily used this line long call payoff = max(spot-strike,0)-long call premium. Your explanation helped me a lot once more thank you – Eka Jul 24 '19 at 14:28