Re: exception handling on Unix

Posted by Xavier.Abulker on
URL: http://quantlib.414.s1.nabble.com/exception-handling-on-Unix-tp2545p2550.html

Hi Luigi,
this is a European Put Option

price = 0.01;
maturity =0.0986;
underlyingPrice =147.5;
 strike =1;

then I define
EuropeanOption
Europeanoptioniv(Option::Put,underlyingPrice,strike,dividend,zero_rate,maturity,implvol);



and return the implied vol in database
std::cout<<"OPTION IMPLIED VOL= "
<<Europeanoptioniv.impliedVolatility(price)

I know that the strike is crazy but unfortunately this option exists on the
market, a price is given everyday by the market place and my clients have
it in in their portfolio!



                                                                                                                       
                    Luigi Ballabio                                                                                    
                    <luigi.ballabio@fast       To:     [hidden email]                                        
                    webnet.it>                 cc:     [hidden email]                            
                                               Subject:     Re: [Quantlib-users] exception handling on Unix            
                    21/05/2003 11:12                                                                                  
                                                                                                                       
                                                                                                                       




At 10:49 AM 5/21/03 +0200, [hidden email] wrote:
>I'm using the EuropeanOption.cpp example to deduce the implied volatility
>of options.
>There's the try-catch in the source code as you explained me.
>Now everything goes fine except when it is impossible to find a solution.
>the Brent algorithm should give me an exception like:"Exception happend
for
>matrix point: root not bracketed: f[0.0001000000,4.0000000000] ->
>[0.63761133978130147000,6.27375654274655490000]" (I see that on NT) but on
>Unix I only see  a core dump.

Xavier,
         can you send me the inputs you're using? Also, what kind of option

are you analyzing? And if it is as European, are you using the old-style or

the new-style option?

Later,
         Luigi






*************************************************************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La Fimat et ses filiales declinent toute responsabilite au
titre de ce message s'il a ete altere, deforme ou falsifie.
                    ********
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither Fimat nor any of its subsidiaries or affiliates shall
be liable for the message if altered, changed or falsified.
*************************************************************************