Greeks - 5 Fundamental Option Pricing and valuation measures that you need to be aware of with Python code included!
Description, application and python example
Do you want to know more about insights and statistics behind option price and therefore guess whether it's adequately valued, estimate the amount of risk or project payoff?
Despite different applications in both buy-side as well as sell side, without option price valuation, instead of investing, we may flip the coin or play roulette. Mathematical implications connected with option pricing are fundamental in making informed investment decisions. So-called 'Greeks' metrics alongside the Black and Scholes model are used to some extent by any market-making or investment company.
Greeks metrics will help examine an option's directional risk, its sensitivity to changes in the underlying or volatility, and interest changes to give you a complete overview of an option value.
In this article, I will give you a general overview of all fundamental option valuation metrics and provide Python code to calculate each. Remember, they are highly connected with the Black and Scholes model, so you may also want to check articles about this one.
But for now, without further ado, let's expand our quant arsenal by several powerful rifles.
1. Delta - sensitivity on directional risk
Delta represents the directional risk, so the risk that the market will go in other direction than assumed, for European options (that can be exercised only at expiry date), it is expressed between 0 to 1 or 0 for calls and 0 to -1 for puts.
To better understand Delta, let's take an example:
If the price of the underlying increases by €1 (I used € but it can be any currency or even measure of quantity), my option gains €0.5, which is expressed as Delta = 0.5
As you probably thinking at the moment, is it possible to create a portfolio that is insensitive to directional risk (Delta ~ 0)? That strategy is called Delta neutral and aims for the position to not fluctuate in value over the CERTAIN range of prices of the underlying. However, the range is limited due to the crucial fact about Delta, that Delta changes over the lifetime of an option. How much that change occurs is indicated by our second metric, Gamma.
In terms of change in this measure, the Delta of a call option that is 'at the money' will have a Delta of 0.5, the more option dives 'in the money Delta for a call will rise closer to 1, and the opposite happens once the option goes out of the money.
(Note: I was trying to use the most simplistic graph just for visualization and clarity)
In order to calculate the Delta of an option, as well as all the following metrics, you will need strike price (st), spot price (k), risk-free rate (r ), time to maturity (t) and volatility (vol).
Please go ahead and examine Python code below:
#create a function, type c=call, p=put
def delta(st,k,r,t,vol, type="C"):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
#Calculate delta
try:
if type == "C":
delta = norm.cdf(d1,0,1)
elif type == "P":
delta = -norm.cdf(-d1,0,1)
except:
print('Check the type')
print('Delta: ',delta)
2. Gamma - Sensitivity on large fluctuations
Gamma often also referred to as Speed, is the rate that Delta will change based on one unit change in price. In other words, Gamma measures how many points Delta will change over time.
For example, if our call option initially has a 0.5 Delta and the underlying price will increase by $1, our option will gain $0.5 of its value. Once that will happen our new Delta will indicate, let's say 0.53, Gamma, therefore, would be Gamma is 0.03.
Price of an underlying in the above graph is €100, as you can see, the closer the option is to ATM (At The Money) level, the higher it benefits on large price movements will be.
Still considering call option (If I'm not mentioning, assume that everything works opposite with put unless), if Gamma is positive, then it means that our option takes benefit from a large movement which is positive indication. However, if the Gamma is negative, it should be a potential matter of further investigation.
Here's the python code for indication Gamma (variables same as above):
def gamma(st,k,r,t,vol):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
try:
gamma = norm.pdf(d1,0,1)/(np.sqrt(t)* vol* st)
except:
print('Check the type')
print('gamma: ',gamma)
3. Theta - Time sensitivity
If Gamma is a protagonist here, then Theta will be the villain. Theta measures the loss (or gain) in value of an option over time, so-called time decay or Theta decay.
Time decay occurs because call options have a finite lifespan, and as time passes, the probability of the underlying asset price moving above the strike price decreases. Therefore, the longer the time remaining until expiration, the more time for the underlying asset price to move in an unfavorable direction for the option holder. This reduces the call option's value because the likelihood of it being exercised decreases.
For example, if Theta at the time of purchase of a call option is equal to -0.001, its value will move towards the negative direction all the way until maturity to end up at, let's say, -0.1.
From a computational point of view, as Theta is positive, Gamma will be negative (at the call option) and vice versa at put option. It is always worth to make sure those rules are met once you are calculating your result.
Here's the python formula for Theta:
def theta(st,k,r,t,vol, type="C"):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
try:
if type == "C":
theta = -(st*norm.pdf(d1, 0, 1)*vol)/2*np.sqrt(t) - r*k*np.exp(-r*t)*norm.cdf(d2, 0 ,1)
elif type == "P":
theta = -(st*norm.pdf(d1, 0, 1)*vol)/2*np.sqrt(t) + r*k*np.exp(-r*t)*norm.cdf(-d2, 0 ,1)
except:
print('Check the type')
print('Theta: ',theta)
4. Vega - Volatility exposure
Vega indicates volatility risk, that is, approximately how much an option price will increase or decrease in the change in implied volatility.
We can distinguish two types of volatility measurements, historical or relative and implied volatility. Relative volatility can be measured by, for example, standard deviation or Beta (I will describe Beta as a bonus to this article) and indicates how the underlying price fluctuated until the measurement date. However, volatility can, and very often, change over an option's lifetime, which is the real Achilles heel of the Black and Scholes model. Therefore, we can use implied volatility to predict future volatility rather than assuming it will stay at its current level.
There are a couple of implied volatility measurements to the most popular and accurate we may include the Newton-Raphson model or bisection method. However, calculating implied volatility goes solely to monitoring how the market indicates implied volatility by simply plotting option prices to the Black and Scholes model to calculate volatility.
Having implied volatility briefly covered, in terms of our Greek letter, positive Vega benefits from the increases in volatility. Therefore the bigger the Vega is, the more option will benefit from a shift in volatility.
Here's the python code for Vega:
def vega(st,k,r,t,vol):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
try:
vega = st*norm.pdf(d1, 0, 1)*np.sqrt(t)
except:
print('Check the type')
print('Vega: ',vega)
5. Rho - Interest Rate risk exposure
Finally rho, I would say, last but not least, but that's rather not the case here. Rho measures option sensitivity on changes in interest rates. Analogically, the bigger the Rho indicator is, the more sensitive for interest rate hikes and dives the option will be.
As you know, we are implementing a risk-free rate for the calculation of option price value, which, like volatility, can vary. However, given the frequency of changes in interest rates and their overall impact on the level of risk of an option. Positive rho benefits from increases in interest rates.
And here’s the Python function for calculating Rho for you:
def rho(st,k,r,t,vol, type="C"):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
try:
if type == "C":
rho = k*np.t*np.exp(-r*t)*norm.pdf(d2, 0, 1)
elif type == "P":
rho = -k*np.t*np.exp(-r*t)*norm.pdf(-d2, 0, 1)
except:
print('Check the type')
print('Rho: ',rho)
Bonus: Alpha and Beta
Technically Alpha and Beta are not considered among Greeks measurements as they regard more underlying itself and its fundamentals; however, those two are crucial in understanding to make sense of overall market movements, and how examined underlying is positioned in all of that.
Alpha and Beta come from the famous Capital Asset Pricing Model, which was designed in the early 1960s to calculate the expected return or required return of an investment to compensate for risks an investor takes. Despite being somewhat outdated, CAPM includes Alpha and Beta, which are still widely used indicators of the performance of an investment.
Beta measures share price sensitivity on the market price movements and, therefore, all the events related to the entire market. Beta is being compared to the benchmark, often a huge index like S&P 500 or Vanguard Global, National indexes or a specific industry. Benchmark will always have a Beta equal to 1, and if the Beta of a given security is greater than that, its price fluctuates more than a benchmark, increasing the possibility of above-average returns or losses.
In order to calculate alpha and beta simply check the correlation between examined underlying and appropriate benchmark, alpha will be you the intercept while beta will be the slope.
As Beta measures the market environment, alpha measures all the price fluctuations unrelated to market movements and all other changes. Here, if alpha is positive, it means that the company rise in value no matter the market movements; however, if the alpha is negative, it means that the value decreases despite the market trend, which is a very alarming sign.
So there you have it, the most crucial indicators for option pricing that are used by many Quants on the buy and sell sides. I hope you enjoyed the content and looking forward to the next week.
Thanks, and see you soon!
Tomasz