|
From: Martin A. <ma...@da...> - 2025-03-07 17:52:02
|
Hi Luigi, Thank you for your response and useful hints. It it very helpful summary and it it matches our general understanding that we formed after checking of few previous posts in the mailing list as well as some other resources that we could find online. The only thing on which I couldn’t find more clarity is the way of “packaging” discrete dividends vs. dividend yield before sending it to either ql.AnalyticDividendEuropeanEngine or ql.FdBlackScholesVanillaEngine exercise engines. I noticed that some shifts in data preparation paradigm happened specifically in that area and that is actually the main reason why I sent this question to the mailing list. I know I should be more specific in my first email, but I hope I clarified my concern now. Please send me a few hints as how to proceed in either case when preparing dividend information to be passed to the exercise engine. Once more, thank you very much Martin Martin Adamec CTO, DataDock Solutions datadocksolutions.com 862-221-1246 | ma...@da... 40 Wall St, FL 43 | New York, NY 10005 | USA On Mar 7, 2025 at 10:09 AM -0500, Luigi Ballabio <lui...@gm...>, wrote: > 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 > > > > > > > > _______________________________________________ > > QuantLib-users mailing list > > Qua...@li... > > https://lists.sourceforge.net/lists/listinfo/quantlib-users |