Hi QC Community
We are pleased to announce a refactor in the calculation of Option Greeks!
Previously, the Greeks were calculated by the underlying volatility estimation which was depending on the selected volatility model of the underlying security. Not only the Greeks were not matching the ones from major brokerages like IB, but also failed to present the true sensitivity to the marginal change of time decay, volatility, underlying price, interest rate, and dividend yield. But from now on, the Greeks will be calculated by the approximated implied volatility instead of the underlying one. Since IV was regressed from the option price, the Greeks calculated could overcome the above-stated issue, reflecting the accurate rate of change of the option price by the above factors.
Moreover, it does not require "warm-up" anymore. As we can obtain the IV from the instantaneous option and underlying price, we have accurate Greeks values on the first slice of data received, which would only be available on the third day of subscription previously. This would be a big improvement if you are using Greeks for filtering.
Different pricing models would result in a slightly different estimated IV. To match the Greeks from IB, the below option pricing model will be used:
- BlackScholes for European options,
- BjerksundStensland for American options
- Use the Fed interest rate as the risk-free rate (matched daily)
option.PriceModel = OptionPriceModels.BlackScholes();
option.PriceModel = OptionPriceModels.BjerksundStensland();
in which will also be set as default by now.
Note that the set volatility model for the underlying security will no longer impact the IV and Greeks, i.e. all underlying volatility models will result in the same Greeks' values, although the theoretical price is still dependent on that. Yet, it is still necessary to set up the underlying volatility model as it is needed for an initial guess of the IV approximation. If the volatility model is not defined or the defined one is not warmed up, LEAN will use Brenner and Subrahmanyam (1988) approximation.
Existing option pricing models cannot provide a closed-form solution in all situations, for example, when an underlying asset of an American put option has a discrete dividend before expiry. In this case, the IV and Greeks cannot be calculated from the option pricing model. A Black-Scholes calculator will be used to approximate the IV which might result in a slight discrepancy in the actual and estimated IV/Greeks values. American call options will not have this problem since it is not optimal for early exercise.
Please let us know if you run into any issues or queries. Enjoy and cheers!
Best
Louis
Alexandre Catarino
Hi QuantConnect Community!
We have deployed the attached algorithm in live mode, and compared the results against Interactive Brokers. The implied volatility and the Greeks were available immediately after a single loop (the first OnData method call), and their values are similar to IB's: IV of 17%, Delta of 0.50 for the SPY 221130C00395000, and -0.45 for the SPY 221130P00395000.
Best regards,
Alex
Mathpaquette
Louis Szeto  could you share a link of the Github issue/updated code ?
Derek Melchin
Hi Mathpaquette,
See LEAN PR #6720.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
.ekz.
Great work team. Thanks a ton for this update!
Mauricio Hernández Durán
Sounds great guys!
Will this be compatible before the release date ? I ask because using BjerksundStensland I get suspiciosly far out -16 PUT deltas for backtests starting 2021 while simply changing the model to CrankNicolsonFD I get more sensible strikes for the same 16 Put Deltas.
Â
Â
Â
Â
Louis Szeto
Hi MauricioÂ
American put option that having a discrete dividend before expiry cannot be handled by any existing QuantLib optional pricing models, so any values would not be accurate.Â
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Emilio Freire
Hi Guys,
Great job on this!
I was wondering about VIX Index options. Last time I checked these options were assuming spot as the underlying asset for all expiries, as opposed to their futures. We've been overriding that behavior ourselves in order to select the right strikes (moneyness based) and also to recalculate Greeks and so on.
Is this something you guys haven taken into account?
Thanks!
Â
Emilio
Â
Louis Szeto
Hi Emilio
By CBOE's fact sheet, VIX index options was not backed by any securities, but only a structured derivatives to trade the VIX index, which is its true underlying. VIX Future is just another a different type of structured product with VIX index as the underlying.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Emilio Freire
Hi Louis,
Thanks for your answer!
I agree it's confusing even in the fact sheet and description of the product, but the underlying of VIX options is the forward value of VIX at expiry, not Spot. There aren't many articles out there about this, but I found one that can help explain this (attached). You also see this in places like the Bloomberg Terminal, where each option contract is associated with its corresponding Futures underlier.
This distinction has major implications when it comes to pricing options, but in the case of QuantConnect I guess this would just affect the Greeks and anytime an algo selects contracts based on monenyess that might have been calculated using Spot (the UnderlyingPrice property of the option contracts, for example). For my algos, whenever we do VIX options, we also subscribe to the Futures, and force the options to match those expiries and override their underlier to be their corresponding Futures contract.
Thanks!
Emilio
Â
Lvroyce
According to QuantLib, their community seems didn't provide numeric greeks for american options when option does not equal to result of euro one, so I'm wondering how do we provide american option's greeks?
Ref:Â
Â
Â
Â
Lvroyce
Also for the calculation for IV, I found big gap between my approximation using Newton Raphson and numeric vega, could some one give me a hint on how we calculate IV?
Cheers,
Ashutosh
Hi lvroyceÂ
We're in the process of developing indicators for all Greeks and Implied Volatility (IV), and they should be available in the next few days. In the meantime, you can refer to online papers that I've utilized in academic projects for calculating IV
References:
Cite1
Cite2
Cite3
Please inform me if you found this helpful or if you would prefer a more detailed implementation.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Louis Szeto
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!