[ quantlib-Bugs-934626 ] Excel is hung when calling qlAmericanOption_FD

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Bugs-934626 ] Excel is hung when calling qlAmericanOption_FD

SourceForge.net
Bugs item #934626, was opened at 2004-04-14 02:09
Message generated for change (Comment added) made by nando
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=934626&group_id=12740

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Ferdinando Ametrano (nando)
Summary: Excel is hung when calling qlAmericanOption_FD

Initial Comment:
it seems it only happens when the Type = C, and when
the function template is used.

XL version = 0.35,
OS = XP Professional SP1;
QuantLib & QuantLibXL are compiled off the source code
by the user using the 0.35 release.



----------------------------------------------------------------------

>Comment By: Ferdinando Ametrano (nando)
Date: 2004-07-12 17:22

Message:
Logged In: YES
user_id=34616

The bug is now fixed in CVS.
Thank you for the report.


----------------------------------------------------------------------

Comment By: Ferdinando Ametrano (nando)
Date: 2004-07-12 17:22

Message:
Logged In: YES
user_id=34616

Fixed in CVS. Fixed in the forthcoming 0.3.7 release

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-06-25 01:53

Message:
Logged In: NO

Excel's function template invokes the function each time you
tab through the input fields.  Excel hangs when you enter
the expiry date (the 8th of the 10 input parameters).  The
reason that Excel does not hang before then is because the
relevant QuantLibXL function (xlAmericanOption_FD in file
QuantLibXL\qlxl\pricers.cpp) contains the line
                                                           
                                                           
double maturity      = Actual365().yearFraction(valueDate,
maturityDate);            
                                                           
                                                     which
throws an exception when either or both date is null,
causing the function to return #N/A to Excel.  Once both
dates are provided, the above line completes successfully,
and the code proceeds to call the underlying Quantlib
constructor FdAmericanOption(), which hangs because the
remaining input parameters are still null.          
                                                           
                                                     The
problem can be corrected by validating the input parameters
at the beginning of function xlAmericanOption_FD() and
exiting if any is missing:                                
                                                           
             
    if (xltype.IsMissing() ||    
    xlunderlying.IsMissing() ||    
    ... etc ...    
    xlgridPoints.IsMissing())
        throw("missing inputs"); // returns #N/A to Excel  
     
                                                           
                                                         but
I'm not sure that's the right thing to do, there may be
times when you legitimately want to call a function with
some parameters missing, in which case the validation would
have to be more elaborate.

this bug occurs regardless of whether the type is C or P.

eric at ehlers dot plus dot com.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=934626&group_id=12740