Option Greeks in Python

 How to apply Option Greeks in Python?

Five Greeks delta, Gamma, theta, Vega and Rho
 are apply in financial market.
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

Greeks

There are Five Greeks delta, Gamma, theta, Vega and Rho.
Delta is the most commonly  referred to Greek and probably the easiest to understand. 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 raises 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 a put options are -ve.
Gamma is directly related to the delta. Major stop 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 call option and put option.this is a function of rage in the underlying forcing The delta of both calls higher and puts of a decrease in the underlying to post delta lower for both call and put option.when a put option delta is pushed higher it becomes less negative and when it goes lower it 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.cheetah has a negative impact on both call and put option 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 on the number of days.in the case of theta the unit of change could be based on something other than one day.
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.

Rho indicates how much an option will increase or decrease in value based on a 1% change in the risk-free interest rate.


Post a Comment

0 Comments