Historical Options Chain, greeks and IV

#21
IV influences the greeks. Change IV in your calculations of delta, theta, gamma, vega etc and see if they change with IV or not.

Nobody is disputing that IV is just an estimation because that's the best we can do with so many moving parts in option pricing. Stock IV is calculated by taking weighted averages of ATM and OTM strikes. There is no other way to calculate IV than this method.
 
#22
IV influences the greeks. Change IV in your calculations of delta, theta, gamma, vega etc and see if they change with IV or not.

Nobody is disputing that IV is just an estimation because that's the best we can do with so many moving parts in option pricing. Stock IV is calculated by taking weighted averages of ATM and OTM strikes. There is no other way to calculate IV than this method.
Bro, you did not understood what I was saying. Of course the greeks would change with IV if you use IV as volatility input in BS or any model.

However, the reason I say that IV cannot change greeks is because I don't use it as a figure of volatility. I use some other numbers because I believe IV is not so sacred number to be used as volatility input. Of course you are free to use it in your calculations.

IV only helps me to understand the relationship between the theoretical cost and actual premium.

I know how IV is calculated and what it means can be something different to you and different to me.

All I am saying is IV is constantly changing and is not a volatility which can be relied on for study of strategy. It may be a consensus volatility but traders don't confer to get on this. Correct?
 
Last edited:

onequorauser

Well-Known Member
#23
In my opinion there is indeed something missing here. My understanding says a little different. Of course the partial derivatives spit by the Theoretical Pricing model do require the volatility to be quantified. However is this number the IV of options or IV of the spot?
Just think of it.
It should be neither. IV is just an opinion of the market place of the expected volatility of the underlying over the expiry period. What credibility does that hold? Is the market always right? If the answer is yes then use IV for calculation of greeks.

If however you put in IV of the option for calculations in the model, what we will get as theoritical price of the option is the last traded price or the actual premium we see on screen. Is it the correct price? If yes, then there is no way a option an be overpriced or underpriced because market exactly know what the volatility is going to be and that is the correct price of the option.
If no, then we are putting the incorrect volatility in our model. Which seems to be the case most often because everyone knows option are frequently mispriced which we can benefit from as a option seller or buyer. It also means that the greeks value you get after using IV may not be accurate.

The question is what should we put in the theoretical model as sigma. Many people use simple and good old standard deviations of the last one year daily returns but I use GARCH (1,1) which is a forecast of expected realized volatility. It is more reliable than using IV value as volatility.

BTW there is no major difference in using IV or any other value of volatility derived by some method when we look at greeks but the theoritical price does vary a lot and that is supposed to happen. That is what the edge is in trading. ;)

IV affects the price at which you can buy or sell your options not the actual movement of greeks. I see it as the costliness.

Not sure whether I was able to put my point across or not but I do see it working in my trading.
I agree with you on that fact that optimal option pricing may not be derived by reverse engineering the Market price to arrive at the IV. My purpose here was to try out delta hedging and backtest it especially in situations like feb and march where there were a lot of volatile movements. So I was planning to play a manual what-if based on excel to arrive at 1)frequency at which delta would need to be balanced 2.)typical imbalance that would exist in such situations. Essentially I wanted to get a feel of it before doing it live

My starting position of option selling is based on my assessment of trends and events and not the ideal price of options. So from that point of view I did not require to arrive at the optimal price. Only delta hedging and some amount of gamma balancing would have sufficed.

On a separate note I dont think one year returns of spot would be a good way to arrive at the value of sigma. If that were the case, sigma would simply be the same for all the options. We know that IV does hover more around certain prices e.g. Round numbers.

I personally am not conversant with the GARCH model so I will have a look at it. Thanks! Btw a blanket question for any model that works on predicting volatility.. How do you account for political events in such models to arrive at optimal price? Do you manually tweak the values to be say..2%+ around such periods or is there any other way?
 
Last edited:

onequorauser

Well-Known Member
#24
@onequorauser To calculate the IV when you have the market price in Excel, create a new module in the worksheet with the following code:
Code:
Option Base 1

Dim d1, d2, d3, d4, nd1, nd2, nd3, nd4, ert, eqt

Function bs(cp, S, K, v, r, T, q)

d1 = ((Log(S / K) + (r - q + 0.5 * v ^ 2) * T) / (v * Sqr(T)))
d2 = ((Log(S / K) + (r - q - 0.5 * v ^ 2) * T) / (v * Sqr(T)))
nd1 = Application.NormSDist(d1)
nd2 = Application.NormSDist(d2)
ert = Exp(-r * T)
eqt = Exp(-q * T)
bscallvalue = (S * eqt * nd1 - K * ert * nd2)

If cp = "Call" Then
  bs = bscallvalue
Else
  bs = bscallvalue - S + K * Exp(-r * T)
End If
End Function


Function IV(cp, S, K, r, T, q, optval)
    Dim epsilon As Double
    delta_x = 0.001
    epsilon = 0.00001
    cur_x = 0.5
    For i = 1 To 1000
        fx = optval - bs(cp, S, K, cur_x, r, T, q)
        cur_x_delta = cur_x - delta_x
        fx_delta = optval - bs(cp, S, K, cur_x_delta, r, T, q)
        dx = (fx - fx_delta) / delta_x
        If (Abs(dx) < epsilon) Then
            Exit For
        Else
        cur_x = cur_x - (fx / dx)
        End If
    Next i
    IV = cur_x
End Function
In the worksheet, use the custom formula '=IV(cp, S, K, r, T/365, q, optval)'

The structure is kinda like in the screenshot. If there's any help required, feel free to ask. :)

View attachment 25293
Thanks!
 
#25
Hi,

I am not a coder but I do know how to code in bits and pieces to make my quick & dirty application for any task that I am trying to automate. In 2016 I started reading about derivatives and wanted to trade options.

As options are non linear instruments I see that many things go into picking an option, like to decide when to sell/buy and what options to buy/sell we have to consider spot price/volatility, Greeks, time and IV etc along with appropriate strike. Based on this, I needed to calculate many things for options along with technical analysis of the spot to initiate a trade with high probability. Initially I used EXCEL to do all my calculations but it was very slow and as so many dimensions are to an option, I was not able to quickly update the sheets manually. So I decided to work on a web based app but could not complete. Recently I got some time and decided to complete the same.

I have built an app which can work on the historical EOD data for any stock (fetch automatically if not present already), its FnO derivatives and compute the Greeks, Implied volatility and the trend of volatility for every option (chain) and save in a database.

Right now I am regarding the IV and its trend for an option's lifetime and also the IV trend for x number of strike away from ATM to understand if it is trading at a premium or not and see if volatility will cool or not. These charts can help in analyzing the costliness of an option.
The reason for putting that importance on IV trend is because delta, gamma are dependent on the spot movement and position of spot wrt strike, theta is in one directional and rho does not even matter in such short periods of expiry. IV can really affect the premium which can be analysed in details.

As any type of chart and view can be built if we have the data, please share if you have any suggestions for manipulating the historical data and help me understand if there can be another view/chart that can visually assist to make decisions for initiating an options trade. I will implement the same in my study.

I am attaching some screenshots of my webapp. Currently it is hosted in my laptop, if it is useful, I can try to migrate online. Since the database is really huge, it will require some powerful servers.:dead:. Anyways right now I am storing the data for all FnO segment stocks (spot), all futures instruments, for options: BANKNIFTY, NIFTY, SBIN, INFY, RELIANCE, TCS, TATASTEEL, TATAMOTORS, MARUTI, PNB, FORTIS and DLF. However, it can be done for any FnO instrument.

View attachment 24913 View attachment 24914 View attachment 24915 View attachment 24916
hi, very nice work, all data in one sheet. i m learning the same, but not able to import data in one sheet if you dont mind can please tell me where i could learn the same or power query . or i wish to learn from you too. please reply. thanks...
 
#28
Bro, you did not understood what I was saying. Of course the greeks would change with IV if you use IV as volatility input in BS or any model.

However, the reason I say that IV cannot change greeks is because I don't use it as a figure of volatility. I use some other numbers because I believe IV is not so sacred number to be used as volatility input. Of course you are free to use it in your calculations.

IV only helps me to understand the relationship between the theoretical cost and actual premium.

I know how IV is calculated and what it means can be something different to you and different to me.

All I am saying is IV is constantly changing and is not a volatility which can be relied on for study of strategy. It may be a consensus volatility but traders don't confer to get on this. Correct?
Hi
It was nice chain of messages and interesting one too. I am learning options, is it possible to use your tool to get better understanding of options working. Thanks
 
#29
Hi all,

I was not active for a long time. Sorry for the delay. I've made some changes to the tool and working on improving it. Unfortunately it required a lot of time and I am not able to dedicate it due to my job.

Here is the screenshot of the changes:

1.jpg


Changes made:
  • Layout
  • Inclusion of probability of profit, IV rank and IV Percentile
  • Choice to turn the greeks on and off
  • Ditched Garch as it was un-reliable and adopted IV.
  • Model used is Black76 to account for any upcoming dividends
  • Term MIBOR as the risk-free rate
Some things are still incomplete as you can see.

Keep in mind that Godaddy is shitty as hell. I have their Deluxe hosting and their database connection keeps timing out when we check options chain for equities (as it is a huge database). The tool works fine on my laptop though.

For the time being I've gone ahead and uploaded it online for everyone to see. The data is available for every FnO contract but it may only show it for NIFTY and BANKNIFTY. The data for Stocks might not load because of the stupid slow services of Godaddy.

I can post the URL here if that is okay with the mods (fear of being marked as a spammer).
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?