|
From: Luigi B. <lui...@gm...> - 2025-03-07 15:09:21
|
Hi Martin,
your excerpt seems to miss some possible combinations (European option
with actual dividend data), or to allow some that wouldn't work correctly
(DividendVanillaOption with BinomialVanillaEngine) but that might be
because it's an excerpt, and you have other checks elsewhere. Anyway,
trying to summarize the current status:
a) always use ql.VanillaOption(payoff, exercise), because
ql.DividendVanillaOption has been absorbed into it;
b) choose the engine depending on exercise and whether you have actual
dividend data:
- for European options without dividend data, use
ql.AnalyticEuropeanEngine(process);
- for European options with dividend data, use
ql.AnalyticDividendEuropeanEngine(process, dividends);
- for American options without dividend data, use
either ql.FdBlackScholesVanillaEngine(process)
or ql.BinomialVanillaEngine(process, ...);
- for American options with dividend data, use
ql.FdBlackScholesVanillaEngine(process, dividends). The binomial engine
doesn't support dividends.
In short, if you have actual dividend data, pass them to an engine that can
take care of them.
Hope this helps,
Luigi
On Tue, Mar 4, 2025 at 6:00 PM Martin Adamec via QuantLib-users <
qua...@li...> wrote:
> Hi quantlib-users,
>
> I am reaching out to ask you guys for some hints on proper transitioning
> to the newly refactored classes and methods related to equity option
> valuation calcs.
>
> We have in our code the older and now apparently outdated construct based
> on previous organization of the code. It is semi-clear to us how to proceed
> with the code available in version 1.37 (and most probably and hopefully up
> for quite a long time).
>
> I attached an excerpt of the code that is dealing with the instantiation
> and proper setup of the option object depending on the exercise style,
> preselection of the engine, and finally the distinction between the
> presence of discrete dividend data vs. dividend yield.
>
> My understanding is that the new code should be used in somehow simpler
> fashion but cannot quit clearly figure out the proper way (and maybe order)
> of setup steps to do to hit all of the input data variations we are
> considering in our current code.
>
> Any hint or advice is going to be highly appreciated,
>
> Thank you
>
>
> Martin Adamec
> CTO, DataDock Solutions
> datadocksolutions.com
>
>
> 862-221-1246 | ma...@da...
> 40 Wall St, FL 43 | New York, NY 10005 | USA <https://maps.google.com/?q=40%20Wall%20St,%20FL%2042%20%7C%20New%20York,%20NY%2010005%20%7C%20USA>
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|