Login  Register

Re: Adding new functions to blackcalculator

Posted by Dimathematician on Apr 18, 2009; 1:34pm
URL: http://quantlib.414.s1.nabble.com/Adding-new-functions-to-blackcalculator-tp13518p13523.html


Ok, after ages I've started working on this, I plan to add some new FX machinery to QuantLib. 

Question: 

In the BlackCalculator constructor we have

 if (stdDev_>=QL_EPSILON) {
   ...
}    
else{

if (forward>strike_) {
                cum_d1_ = 1.0;
                cum_d2_= 1.0;
            } else {
                cum_d1_ = 0.0;
                cum_d2_= 0.0;
            }
}

I wonder if that's 100% right or if I've overlooked something. But if forward==strike,
then we have log(f/K)=0, 

so, if vol is not zero, we should rather have

 cum_d1=N (0*5*stdDev_)

which would be approximately 0.5 for very small vols. Opinions?







2008/11/14 Ferdinando Ametrano <[hidden email]>
On Thu, Nov 13, 2008 at 8:33 PM, Dima <[hidden email]> wrote:
> After thinking about it I'd suggest
> to code the delta calculations in a new class called BlackDeltaCalculator
> with a similar constructor as the BlackCalculator class. This might look
> like
> overkill (an own class for Delta calculation) on first sight, but my reasons
> are
> as follows: [...]

Not sure I agree, anyway it could be the right way to start: code it
the way it best suits you, provide unit tests (!!!!!), we quickly add
it to the experimental folder, gather feedback, and then maybe later
refactor the code

ciao -- Nando


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev