Plotting Put Option Profit and Loss Across Spot Prices and Time
Summary
The document explains how to construct put-option value curves at different times by repricing the option across a range of underlying spot prices. Under the stated assumptions of European exercise and no dividend or early-exercise concern, the Black-Scholes formula takes the strike, implied volatility, spot, risk-free rate, and time to maturity as inputs. For each curve, vary spot while holding the other assumptions constant; for a later time curve, reduce the remaining time to maturity and reprice again.
The answer clarifies that the plotted option premiums represent the position’s mark-to-market value at each spot and time, so changes from the opening premium correspond to profit or loss for a position that can be closed at those values. The illustration assumes implied volatility and other inputs remain unchanged as spot and time vary. It does not model changes in volatility, rates, dividends, transaction costs, or exercise effects, so actual position P&L may differ from the curves.
Key ideas
- A put value curve can be generated by repricing across a range of spot prices.
- For a later-time curve, use the reduced time remaining to maturity.
- The curves hold implied volatility, rates, and other model inputs constant as spot changes.
- Option value at a given time and spot represents mark-to-market value; P&L depends on the entry premium.
- The stated European-option setup omits changing volatility and other real-world effects.
Tags
Full text
# How to calculate profit loss curve of a put option
# How to calculate profit loss curve of a put option
I am using the black scholes method to calculate the premium for selling put option using the py_vollib package in Python. I can calculate the premium for a put option that has an arbitrary strike. However, I would like to generate a profit-loss curve like that shown below. How is it possible to calculate the profit-loss (PL) curve at t=0, t=30 and t=218?
My python code for plotting the option premium is below:
```
import numpy as np
import py_vollib_vectorized #Apply patch to pyvollib
from py_vollib.black_scholes import black_scholes
import matplotlib.pyplot as plt
#16 May 2024 SPX option details at 12 October 2023, 10.30am
PUT_STRIKE = 3875
dte = 218
iv = 0.215
SPOT_PRICE = 4372
RFR = 0.052 #risk free rate
def calc_PL():
'''This should calculate the PL curve, not the premium
'''
strike_array = np.arange(3200, 5200, 1)
price = black_scholes('p', SPOT_PRICE, strike_array, dte/365, RFR, iv, return_as='array')
return strike_array, price
if __name__ == '__main__':
fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
plt.grid(True)
strike_array, price = calc_PL()
option_premium = price[strike_array==PUT_STRIKE][0]
print('Option premium: {}'.format(option_premium))
ax1.plot(strike_array, price)
plt.show()
```
## Answer by Jec (score 0, accepted)
https://quant.stackexchange.com/a/77035
First, let's clarify and make some assumptions. Let's assume you're using european options and early exercise is not a concern as well as there is no dividend risk. Next, let's clarify the BS/BS-M model. Given strike_price (PUT_STRIKE), Implied Volatility (iv), current_spot (SPOT_PRICE), risk-free rate (RFR) and time to maturity (dte) we can calculate the premium of an option. You specified 'put' as the particular option type as well.
The curves of your display image are merely the options premium AT a specific time WITH a varying spot price. You can see this in the legend that each color is a specific curve of time as spot changes. Nothing else is changing.
Meaning, if spot was suddenly at 4400 in your example (AND nothing else changed) the premium of your option would be the red square in the below image. Similarly, if spot was at 4500 (AND again nothing else changed) the option premium would be reflective of the Yellow square. If you ADVANCE time 88 days (t+88) AND spot is at 4500 the reflective premium of the option at that point would be the blue square.
So how do you get to that point? Well, working backwards from the above examples you want to iterate through the BS formula for each of those strikes. Let's take the red square as an example. You'll want to calculate the option put premium for every strike from 3200 to 5300 WITHOUT changing any of the other underlying assumptions. That means you're holding all other variables constant including strike, iv, and dte. You'll notice by doing that you'll also solve for the example of the yellow square. Now, to solve for the blue square (and it's curve) you'll do the same thing as above, but you're looking at specifically t+88 or dte = 130.
Using that information you should be able to take the reply that Amit Kumar Jha posted and iterate through the process they described.
Essentially, the key element I think you were missing is that the option premium IS the P&L at a specific time, with respect to a specific spot pricing. If you open a position, and spot moves beneficially to your position, you can close that position for a profit and it will be reflective in this type of payoff graph. (notwithstanding changes in IV or other underlying assumptions).
** This reply would have been better as an addition to the above response but I'm unable to add a comment due to reputation, hopefully this suffices. **Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.