Historical Options Chain, greeks and IV

pannet1

Well-Known Member
#11
Thanks @TraderGYO for your question. The answer is: Yes, I will implement that. That is something already in the pipeline. I have a detailed tool in my mind that will give good insights on the custom options strategy build along with the other aspects/values/parameters about the strategy that is not visible generally. I see that such detailed tools are not available online anywhere, especially for Indian options.

Its just that I am also doing a full time very demanding job and also pursuing studies. On top of that as I am interested in options so I am reading books on that too. So all the time I get is on weekends. It seems that in this month we will take the charts online.

To Build:
Max Pain Analyser,
PCR Analyser,
Detailed Strategy Builder and Insights,
IVP/IVR of every option at every strike (Low priority since my chart already shows the past trend of IV visually)
Volatility Cone (Again, low priority as the charts are doing it)
Delta Neutral Opportunities, Calendar Spreads and other Arbitrage Finder
Finally making all of this real time.

Please share thoughts.
if you are not using any PHP framework and only raw PHP, try fatfree PHP.
 

TraderGYO

Well-Known Member
#12
Thanks @TraderGYO for your question. The answer is: Yes, I will implement that. That is something already in the pipeline. I have a detailed tool in my mind that will give good insights on the custom options strategy build along with the other aspects/values/parameters about the strategy that is not visible generally. I see that such detailed tools are not available online anywhere, especially for Indian options.

Its just that I am also doing a full time very demanding job and also pursuing studies. On top of that as I am interested in options so I am reading books on that too. So all the time I get is on weekends. It seems that in this month we will take the charts online.

To Build:
Max Pain Analyser,
PCR Analyser,
Detailed Strategy Builder and Insights,
IVP/IVR of every option at every strike (Low priority since my chart already shows the past trend of IV visually)
Volatility Cone (Again, low priority as the charts are doing it)
Delta Neutral Opportunities, Calendar Spreads and other Arbitrage Finder
Finally making all of this real time.

Please share thoughts.
That's great even under pressure you are pursuing your passion. I may not be qualified to say this but here are my thoughts
Since I am a futures trader, I can read chart directions with good probability and in that case I only need a program that can calculate the P&L diagram given various spot scenarios. IV rank, Probability of profit,POP are much more important to me than PCR, Max Pain. Every trader is different so continue to do what you find best suites you.
When you take it online let us know, Good luck on you endeavour.
 

onequorauser

Well-Known Member
#13
Yes I can. I may create a new dashboard page with the same this weekend but in a different way. I fail to see it being of a lot of help if being used on just spot IVs. Let me share my thoughts on IVP/IVR.

Quoting: https://tastytrade.com/tt/blog/implied-volatility-rank-and-percentile


I do not see myself making decisions of whether to initiate a trade in a stock just by looking these spot IV calculated numbers. It is again just a general opinion of the public on spot, does not necessarily means which direction the spot will move.

I think I will find it helpful if these numbers are shared for every strike of every CE/PE. That will help understand after my study is concluded ( study to decide if I want to initiate a trade in this instrument or not) if I want to be a seller or buyer of CE/PE in the direction of my concluded analysis of stock movement based on the costliness. Now this general opinion of the public (IV) is a real time difference making factor in terms of how much money I should put on the table or how much I could gain.

However, the graph I already created depicting the IVs over the past period is a detailed strike analysis of the IV trend and reflects the costliness. It helps at the time of actually initiating a trade. I understand right now you have to click actually to get the entire graph however that is why I have highlighted automatically the options where there may be a large variation of the actual price of option as compared to the theoretical price. That gives the place to look at to open the graph and look more into the IV trend.

I may still add IVR and IVP to each individual strike price for every CE and PE.

Please share your thoughts. I may be wrong.
Hi Rusty_Banks..This seems like a nice idea. I have been trying to work on something similar for back testing and paper trading. Although it is pretty manual but that was the point of doing it.
However, I have been struggling to work out the strategy to get IV for an option that had expired in the past. Technically, IV would be volatility of that option and NOT the underlying asset. This value is required to get delta and gamma both of which are required for the testing.
Can you suggest how you have arrived at the IV for each of these options? I am not looking for the code.. just a high level idea should be good enough.
 
#15
Hi Rusty_Banks..This seems like a nice idea. I have been trying to work on something similar for back testing and paper trading. Although it is pretty manual but that was the point of doing it.
However, I have been struggling to work out the strategy to get IV for an option that had expired in the past. Technically, IV would be volatility of that option and NOT the underlying asset. This value is required to get delta and gamma both of which are required for the testing.
Can you suggest how you have arrived at the IV for each of these options? I am not looking for the code.. just a high level idea should be good enough.
Yup that is the IV for the option based on its premium and not the spot volatility which is something different. The premium amount used to calculate the IV is the EOD LTP.

Basically it is just reverse calculating the Black-Scholes as we already have price so we need to work for the Volatility. I use Newton–Raphson method as the algorithm which essentially finds the roots or IV in our case.

This is the exact same way that NSE reports IV on the chain.

BTW, IV does not go into calculations of Greeks. It's the future realized volatility which is used estimated using GARCH or other methods. It may come close to IV which could make the theoritical price of options close to actual prices but not always. That is why options may be overpriced or underpriced. So yeah, IV is not used for greeks calculations ideally.

Still building the strategy analyzer and I think it will be really useful once done.
 
Last edited:

onequorauser

Well-Known Member
#16
Yup that is the IV for the option based on its premium and not the spot volatility which is something different. The premium amount used to calculate the IV is the EOD LTP.

Basically it is just reverse calculating the Black-Scholes as we already have price so we need to work for the Volatility. I use Newton–Raphson method as the algorithm which essentially finds the roots or IV in our case.

This is the exact same way that NSE reports IV on the chain.

BTW, IV does not go into calculations of Greeks. It's the future realized volatility which is used estimated using GARCH or other methods. It may come close to IV which could make the theoritical price of options close to actual prices but not always. That is why options may be overpriced or underpriced. So yeah, IV is not used for greeks calculations ideally.

Still building the strategy analyzer and I think it will be really useful once done.
Both delta and gamma need the values of d1 and d2 which in turn require Sigma which measures the volatility so I think it will be required. Let me know if you think I am missing something.

Basically I am dont want to go back and get the volatility from the historic option values. So I am kind of looking for some way to reverse engineer it without having to code or anything. basically through some excel formula

Btw glad to actually see someone using Newton Raphson method so long after college days :)
 
#17
Both delta and gamma need the values of d1 and d2 which in turn require Sigma which measures the volatility so I think it will be required. Let me know if you think I am missing something.
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.

Basically I am dont want to go back and get the volatility from the historic option values. So I am kind of looking for some way to reverse engineer it without having to code or anything. basically through some excel formula
I will post the excel VBA here for Newton Raphson for you here. I think I have it on my computer.

Btw glad to actually see someone using Newton Raphson method so long after college days
:) Bhai, I hated maths. Seems maths is not going away in our business.
 
Last edited:
#18
I will post the excel VBA here for Newton Raphson for you here. I think I have it on my computer.
@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. :)

Capture.JPG
 
Last edited:
#19
You have to use options derived volatility for the delta, sigma and other greeks calculation. Using GARCH, historical volatility or any other volatility will not be accurate or recommended.

IV is most of the time either over-priced or under-priced and this is where opportunity or edge lies. IV derived from options is the real IV that needs to be taken in all options related calculation.
 
#20
You have to use options derived volatility for the delta, sigma and other greeks calculation. Using GARCH, historical volatility or any other volatility will not be accurate or recommended.

IV is most of the time either over-priced or under-priced and this is where opportunity or edge lies. IV derived from options is the real IV that needs to be taken in all options related calculation.
Disagree on that. IV cannot influence greeks. Volatility is an estimate you calculate. IV is just an additional information based on supply and demand equilibrium. Already explained why.

If however, you are trying to calculate spot IV using the ATM, and options around ATM per some weight allocations, that still may be one calculation of volatility. Not accurate but still something you can substitute Volatility for but IMHO your study should give you a better number of volatility than just calculating spot IV.

If one uses a particular strike implied volatility for greeks then God be with him/her.
 
Last edited:

Similar threads