Option Greeks in Python

 How to apply Option Greeks in Python?

Options Greeks are a set of risk measures that help traders and investors understand the various factors influencing the price and behavior of options contracts. These Greeks are calculated using mathematical models and are used to assess and manage the risk associated with options trading. There are several Greek letters used to represent these measures, each corresponding to a different aspect of an option's pricing and sensitivity to market changes.

Five Greeks Delta, Gamma, Theta, Vega, and Rho

Delta (Δ): is the most commonly referred to in Greek and probably the easiest to understand. Delta measures the sensitivity of an option's price to changes in the price of the underlying asset. It quantifies how much an option's price is expected to change for a one-point move in the underlying asset's price. A call option typically has a positive delta (between 0 and 1), indicating that its price rises as the underlying asset's price goes up. A put option has a negative delta (between -1 and 0), meaning its price moves inversely to the underlying asset's price. The delta of an option indicates how much the price of an option should change in response to the $1 change in the underlying security. Since a call option benefits when the underlying rises in price, The delta for the call is positive. similarly since of put option loses value when the underlying arises in price, The delta for put options is -ve.
Gamma (Γ): Gamma measures the rate of change of an option's delta with respect to changes in the underlying asset's price. It helps traders assess how the delta might change as the underlying asset's price moves. High gamma indicates that the delta is more sensitive to small price changes in the underlying asset, while low gamma suggests that the delta is less responsive. .Gama is directly related to the delta. Major stops around The delta will move higher or lower. Gama indicates how much delta changes with a $1 change in the underlying security. Unlikely Delta Gamma is positive for both the call option and the put option. this is a function of rage in the underlying forcing The delta of both calls is higher and puts a decrease in the underlying to post delta lower for both calls and put option. when a put option delta is pushed higher it becomes less negative and when it goes lower it is more negative therefore the sign of Gamma is always positive.
Theta (Θ): relates to the effect that the passage of time will have on the value of an option. Theta has a negative impact on both call and put options due to the passage of time decreasing the value of an option be it a call or put. the value of theta indicates how much value an option will lose from day to day or sometimes over the number of days. in the case of theta, the unit of change could be based on something other than one day. Theta measures the rate of time decay of an option's value. It quantifies how much an option's price is expected to decrease as time passes, assuming all other factors remain constant. Theta is particularly important for option sellers (writers) because it represents their potential profit as the option's time to expiration decreases.
Vega (ν): indicates how much the price of an option will increase or decrease with a 1% increase or 1% decrease in the implied volatility of the option works the same for both call option and put option with an increase in implied volatility hits the same for both call option and put option with an increase in implied volatility increases the value of the call or put option for a decrease in implied volatility has a negative impact on the value of calls and puts. Vega measures an option's sensitivity to changes in implied volatility, which is a measure of the market's expectations for future price volatility of the underlying asset. A higher vega indicates that the option's price is more responsive to changes in implied volatility, while a lower vega suggests the opposite.
Rho (ρ): Rho measures the sensitivity of an option's price to changes in interest rates. It's particularly relevant for traders of options on interest rate-sensitive assets. An increase in interest rates generally benefits call options and hurts put options. Rho indicates how much an option will increase or decrease in value based on a 1% change in the risk-free interest rate.
Lambda (Λ): Lambda is not as commonly used as the other Greeks, but it represents the percentage change in the option's price for a 1% change in the implied volatility.

These Greeks are essential tools for options traders and investors to assess and manage their positions effectively. By understanding how options are influenced by changes in underlying price, time decay, volatility, interest rates, and more, market participants can make informed decisions and develop strategies to meet their financial objectives while managing risk.
option greeks python in derivative market


Code python
!pip install mibian
import mibian
from tabulate import tabulate
Put price calculation python

stock_price=18141
strick_price=18050
interest_rate=10
day_to_expiry=1
volatility=14

print(tabulate([['Delta',greeks.putDelta],
               ['Gamma',greeks.gamma],
               ['Vega',greeks.vega],
               ['Theta',greeks.putTheta],
               ['Rho',greeks.putRho]
               ],headers=['Greeks','Value'],
tablefmt='orgtbl'))
print("")
print('The put price is',greeks.putPrice)
| Greeks | Value | |----------+--------------| | Delta | -0.271958 | | Gamma | 0.00249844 | | Vega | 3.14818 | | Theta | -20.6807 | | Rho | -0.135657 | The put price is 22.23591721073535

Call price calculation python
greeks=
mibian.BS([stock_price,strick_price,interest_rate,day_to_expiry],
volatility=volatility)
print(tabulate([['Delta',greeks.callDelta],
               ['Gamma',greeks.gamma],
               ['Vega',greeks.vega],
               ['Theta',greeks.callTheta],
               ['Rho',greeks.callRho]
               ],headers=['Greeks','Value'],tablefmt='orgtbl'))
print("")
print('The call price is',greeks.callPrice)

| Greeks | Value | |----------+--------------| | Delta | 0.766483 | | Gamma | 0.00230356 | | Vega | 2.90775 | | Theta | -24.1325 | | Rho | 0.377825 | The call price is 114.14080597325301

BANKNIFTY 14 NOV

| Greeks | Value |

|----------+---------------| | Delta | -0.287968 | | Gamma | 0.000439314 | | Vega | 11.8443 | | Theta | -41.0996 | | Rho | -0.917959 | The put 37900 price is 141.35753092334926
| Greeks | Value | |----------+---------------| | Delta | 0.395048 | | Gamma | 0.000604113 | | Vega | 13.3677 | | Theta | -45.0014 | | Rho | 1.22884 | The call 38500 price is 176.7195478090489

Post a Comment

0 Comments