|
From: Peter C. <pca...@gm...> - 2022-02-17 18:37:17
|
In addition, you might take a look at https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/termstructures/blackvolsurfacebfrr.cpp which is not QuantLib, but uses Dimitri's DeltaVolQuote and BlackDeltaCalcuator at its heart to construct a vol smile from 10 and 25 BF / RR quotes, so there might be some inspiration there for you. Best Regards Peter On Wed, 16 Feb 2022 at 14:41, Luigi Ballabio <lui...@gm...> wrote: > Hello Goutham, > I'm not very familiar with that part of the code, but I think you can > do something similar to what's done in the vanna-volga barrier engine: > > > https://github.com/lballabio/QuantLib/blob/master/ql/experimental/barrieroption/vannavolgabarrierengine.cpp#L97-L130 > > First, it uses the BlackDeltaCalculator class to calculate the strike > corresponding to the quotes (lines 97-113); then it creates an > interpolation between them (117-127; it uses vanna-volga interpolation, but > I guess you can choose another one if you want); then it extracts from the > interpolation the volatility corresponding to the option strike. > > Hope this helps, > Luigi > > > > On Wed, Feb 16, 2022 at 10:28 AM Goutham Mahesh < > gou...@gm...> wrote: > >> Hi all, >> >> I am pricing FX options and was going through the Quantlib Python Guide >> to assist me. >> I came to this section on DeltaVolQuotes: >> >> deltaType = ql.DeltaVolQuote.Fwd # Also supports: Spot, PaSpot, PaFwd >> atmType = ql.DeltaVolQuote.AtmFwd # Also supports: AtmSpot, >> AtmDeltaNeutral, AtmVegaMax, AtmGammaMax,␣ >> ˓→AtmPutCall50 >> maturity = 1.0 >> volAtm, vol25DeltaCall, vol25DeltaPut = 0.08, 0.075, 0.095 >> atmDeltaQuote = ql.DeltaVolQuote(ql.QuoteHandle(ql.SimpleQuote(volAtm)), >> deltaType, maturity, atmType) >> vol25DeltaPutQuote = ql.DeltaVolQuote(-0.25, >> ql.QuoteHandle(ql.SimpleQuote(vol25DeltaPut)), maturity,␣ >> ˓→deltaType) >> vol25DeltaCallQuote = ql.DeltaVolQuote(0.25, >> ql.QuoteHandle(ql.SimpleQuote(vol25DeltaCall)), maturity,␣ >> ˓→deltaType) >> >> I have the ATMf and 25DRR and 25D Fly quotes for various tenors as >> attached in the table below. My doubt is using the code above, is there any >> way I can construct the volatility smile curve using QuantLib to derive the >> implied volatility of an option. >> >> Vol Table: >> ATMF Vol 25D RR 25D Std 10D RR 10 Std >> Bid Ask >> 1m 6.1 6.45 0.25 0.5 0.05 0.15 0.45 0.9 0.16 0.48 >> 2m 6.05 6.4 0.3 0.55 0.1 0.25 0.54 0.99 0.32 0.8 >> 3m 6.05 6.3 0.35 0.6 0.15 0.35 0.63 1.08 0.48 1.12 >> 6m 5.9 6.1 0.45 0.65 0.2 0.35 0.81 1.17 0.64 1.12 >> 9m 5.9 6.1 0.45 0.7 0.2 0.35 0.81 1.26 0.64 1.12 >> 1y 5.9 6.1 0.5 0.7 0.2 0.4 0.9 1.26 0.64 1.28 >> 2y 5.5 6 0.3 0.7 0.25 0.55 0.54 1.26 0.8 1.76 >> 3y 5.2 5.7 0.3 0.7 0.3 0.7 0.54 1.26 0.96 2.24 >> 4y 5.1 5.6 0.1 0.7 0.35 0.85 0.18 1.26 1.12 2.72 >> 5y 5 5.5 -0.1 0.4 0.5 0.9 -0.18 0.72 1.6 2.88 >> >> Thank You, >> Best, >> Goutham >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |