|
From: Ashish B. <ash...@gm...> - 2022-03-17 12:58:51
|
Hi Matthew,
Thanks for your email with details. I didn't get a chance to look and try
it out. I am using QL in Python language and don't have much knowledge of
C++. Could this be done in Python too? Please guide how.
Thanks
Ashish
On Fri, 10 Dec 2021 at 22:33, Matthew Kolbe <mat...@gm...> wrote:
> This is an interesting question and thank you for bringing it up. One
> reason I think an impliedVolatility function is omitted from AsianOption
> instruments is that there isn't a canonical definition for what implied
> volatility means to an Asian option. Sure, there's always a definition of
> IV for Black-Scholes type models where you can solve for the volatility
> parameter, but if you notice in the VanillaOption class, impliedVolatility
> is hard coded as the solution to an AnalyticEuropeanEngine if the
> instrument has European exercise and FdBlackScholesVanillaEngine otherwise.
> QL actually ties the definition of IV to an instrument, giving no used
> control over what engine generates it. So, I would vote we never add an
> impliedVolatility function to Asian options, because there isn't a
> broadly-accepted definition of what engine should be used to define IV for
> Asian options.
>
> That said, if you want to just have some code in your local repo that
> replicates the VanillaOption behavior, add this to the
> DiscreteAveragingAsianOption header class:
>
> Volatility impliedVolatility(Real price,
> const
> ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
> Real accuracy = 1.0e-4,
> Size maxEvaluations = 100,
> Volatility minVol = 1.0e-7,
> Volatility maxVol = 4.0) const;
>
> And add this to the DiscreteAveragingAsianOption cpp file:
>
> Volatility DiscreteAveragingAsianOption::impliedVolatility(
> Real targetValue,
> const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
> Real accuracy,
> Size maxEvaluations,
> Volatility minVol,
> Volatility maxVol) const
> {
> QL_REQUIRE(!isExpired(), "option expired");
>
> ext::shared_ptr<SimpleQuote> volQuote(new SimpleQuote);
>
> ext::shared_ptr<GeneralizedBlackScholesProcess> newProcess =
> detail::ImpliedVolatilityHelper::clone(process, volQuote);
>
> std::unique_ptr<PricingEngine> engine;
> engine.reset(new
> AnalyticDiscreteGeometricAveragePriceAsianEngine(newProcess));
>
> return detail::ImpliedVolatilityHelper::calculate(*this, *engine,
> *volQuote, targetValue,
> accuracy,
> maxEvaluations, minVol, maxVol);
> }
>
> You'll need to resolve some new dependencies in those files and recompile,
> but that's it. Also note that I defaulted to using the
> AnalyticDiscreteGeometricAveragePriceAsianEngine engine, but you can use
> whatever you want there.
>
> On Tue, Dec 7, 2021 at 6:03 AM Ashish Bansal <ash...@gm...>
> wrote:
>
>> Hi,
>>
>> I am trying to evaluate the Arithmetic averaging Asian option using QL
>> class called DiscreteAveragingAsianOption. However, there is no method
>> under it to calculate the implied volatility, which is present for plain
>> vanilla and barrier options.
>>
>> Please help how can I calculate IV for Asian options.
>>
>> Regards,
>> Ashish
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
> --
> Matthew P. Kolbe
> (312) 218-6595
> mat...@gm...
>
|