Greeks calculation in Blueshift

Hey,
I’m working on something related to options, where i want to calculate greeks values. I’ve used this piece of code on Blueshift

Greek =  ["DELTA", "VEGA","THETA" , "GAMMA"]
    Greeks_values = {}

    option_type = option_type  # Change to "PUT" where required

    imp_vol = models.bs.bs_implied_vol(underlying,strike_price, close , time , option_type)
    # print(imp_vol)
    # imp_vol = imp_vol_Call if option_type == "CALL" else imp_vol_Put
    # print(f"Implied Volatility : {imp_vol}")
    Greeks_values["imp_vol"] = imp_vol
    for greek in Greek:
        
        Greeks_values[greek] = models.bs.bs_plain_vanilla_greek(
            underlying,  # ATMF
            strike_price,  # Strike 
            imp_vol,  # Implied Volatility
            time,
            option_type,
            greek,  # Pass each Greek individually
            252
        )

but i’m getting very high values of greeks, Can anyone please help me out with this ?
Long Call Greeks : {'imp_vol': 0.148363, 'DELTA': 0.4984362146830037, 'VEGA': 1216.0295564870519, 'THETA': 90.20689654454424, 'GAMMA': 0.0008821526056771637}

Hi Manaswini, can you share the inputs you have used → underlying (atmf), strike_price, close (close price of the options), time and option_type. We will definitely check and get back to you!

Hey,
I’ve run the code again
Input :

underlying : 24464.3
stirke : 24400
Close : 129.099917
Option type : CALL
time : i've used timedelta, 2 days 06:10:00

Output :

{'imp_vol': 0.155954, 'DELTA': 0.4685322988597659, 'VEGA': 920.9351811085179, 'THETA': 71.8117626172989, 'GAMMA': 0.0011012524186285295}

vega is coming out to be too high and theta should be -ve which is not happening here.

Thank you for your help so far! If you need to look at more details or if there are any specific areas where you think I might be going wrong, I’d be happy to share it

Hi Manaswini, thanks for sharing this. I see a bit different numbers than yours → imp vol comes to 0.101311 with your quoted underlying, strike, close price and time to expiry. Similarly I see 0.609988 for delta, 0.00163577 for gamma and 888.31127 for vega. These all looks good to me. The theta I get is wrong. On further check I see a bug in our theta calc. You are also right we are not adding a negative sign to it. We will release a fix soon. Also, please note we use Black 76 models, so the underlying should be the futures price, and not spot.

Hey,
I’ve kept the underlying as futures price itself, so, can i assume that there’s an issue with the BS model on blueshift for now.
And could you suggest please me any other method i could go with, I’ve tried mibian , but it seems Blueshift doesn’t support mibian.

Thanks !!

umm, I think I was not clear enough! Open a notebook on the Blueshift platform and run the following in a cell

from blueshift.library.models import bs_plain_vanilla_option, bs_plain_vanilla_greek, bs_implied_vol
import pandas as pd

t = pd.Timedelta(days=2, hours=6, minutes=10)
v = bs_implied_vol(24464.3, 24400, 129.099917, t, 'call')
delta = bs_plain_vanilla_greek(24464.3, 24400, v, t, 'call', 'delta')
gamma = bs_plain_vanilla_greek(24464.3, 24400, v, t, 'call', 'gamma')
vega = bs_plain_vanilla_greek(24464.3, 24400, v, t, 'call', 'vega')
theta = bs_plain_vanilla_greek(24464.3, 24400, v, t, 'call', 'theta')

print(v, delta, gamma, vega, theta)

This prints below

0.101311 0.6099880244856387 0.001635771565560875 888.3112706557757 
44.997851570703645

All these are correct - except the theta. If you see different numbers on Blueshift, please share your notebook so that we can reproduce your results. If you see the same numbers and think they are not correct, you can double check them on any other Black Scholes options greek calculator (remember to put interest rate and dividend yields to 0 and convert the time from time-delta to time.total_seconds()/86400/252) .

For the theta, we will release a fix soon.

the bug fix for theta calculation is released now.

‘THETA’: -7231.238370700716
how can i understand this value of theta ?