Delta and Gamma of FD american Option

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Delta and Gamma of FD american Option

ravi agrawal-2
Hi,
Where are the greeks for American Option using finite differences calculated?
At many places am getting americanOption.delta() and americanOption.gamma() as  -1.#IND        1.#QNB respectively.
Any help would be appreciated.

Thanks
Ravi

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

ravi agrawal-2
To be precise am getting these values of delta and gamma only when volatility is 0%.


On Tue, Mar 2, 2010 at 3:23 PM, ravi agrawal <[hidden email]> wrote:
Hi,
Where are the greeks for American Option using finite differences calculated?
At many places am getting americanOption.delta() and americanOption.gamma() as  -1.#IND        1.#QNB respectively.
Any help would be appreciated.

Thanks
Ravi


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

Tawanda Gwena
In reply to this post by ravi agrawal-2
I'm using the 1.0 engine. From how I understand this program, all calls for greeks are going through the file oneassetoption.cpp. This oneassetoption calls calculate(), and the fdamericanengine doesn't have this calculate function(). Perhaps you might try to see if the code defined in fdeuropeanengine.hpp can be easily adapted to the american case. (Right now I can't see why it shouldn't be possible.)


 
On Mar 2, 2010, at 5:37 PM, ravi agrawal wrote:

I am using 0.9.9 version. The value is being printed out delta and gamma.
Am doing something similiar as mentioned in equityOption.cpp
I can see fdamericanengine.hpp to be emptier than fdeuropeanengine.hpp thats why i was wondering where are the values coming from. I think both of these are using fdvanillaengine.cpp as far as construction of grid is concerned?



On Tue, Mar 2, 2010 at 4:21 PM, Tawanda Gwena <[hidden email]> wrote:
From looking at the fdamericanengine.hpp it looks like the greeks are not defined (compare with fdeurpeanengine.hpp).
My quick test bears it out, I get the output "delta not provided".



On Mar 2, 2010, at 4:23 PM, ravi agrawal wrote:

Hi,
Where are the greeks for American Option using finite differences calculated?
At many places am getting americanOption.delta() and americanOption.gamma() as  -1.#IND        1.#QNB respectively.
Any help would be appreciated.

Thanks
Ravi
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

Luigi Ballabio
On Wed, 2010-03-03 at 08:02 -0500, Tawanda Gwena wrote:
> I'm using the 1.0 engine. From how I understand this program, all
> calls for greeks are going through the file oneassetoption.cpp. This
> oneassetoption calls calculate(), and the fdamericanengine doesn't
> have this calculate function().

It does. It's inherited from FDStepConditionEngine. See
<ql/pricingengines/vanilla/fdstepconditionengine.hpp>

Luigi


--

Don't say "yes" until I finish talking.
-- Darryl F. Zanuck



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

Tawanda Gwena
Thanks, I hadn't seen that. So why are greeks not computed?

On Mar 3, 2010, at 8:13 AM, Luigi Ballabio wrote:

> On Wed, 2010-03-03 at 08:02 -0500, Tawanda Gwena wrote:
>> I'm using the 1.0 engine. From how I understand this program, all
>> calls for greeks are going through the file oneassetoption.cpp. This
>> oneassetoption calls calculate(), and the fdamericanengine doesn't
>> have this calculate function().
>
> It does. It's inherited from FDStepConditionEngine. See
> <ql/pricingengines/vanilla/fdstepconditionengine.hpp>
>
> Luigi
>
>
> --
>
> Don't say "yes" until I finish talking.
> -- Darryl F. Zanuck
>
>


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

Luigi Ballabio
In reply to this post by ravi agrawal-2
On Tue, 2010-03-02 at 17:06 -0600, ravi agrawal wrote:
> To be precise am getting these values of delta and gamma only when
> volatility is 0%.

Looks like a division by zero or something like it. Can you try running
the thing through a debugger?

Later,
        Luigi



> On Tue, Mar 2, 2010 at 3:23 PM, ravi agrawal
> <[hidden email]> wrote:
>         Hi,
>         Where are the greeks for American Option using finite
>         differences calculated?
>         At many places am getting americanOption.delta() and
>         americanOption.gamma() as  -1.#IND        1.#QNB respectively.
>         Any help would be appreciated.
>        
>         Thanks
>         Ravi
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

Green's Law of Debate:
Anything is possible if you don't know what you're talking about.



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Delta and Gamma of FD american Option

Luigi Ballabio
In reply to this post by Tawanda Gwena
On Wed, 2010-03-03 at 08:20 -0500, Tawanda Gwena wrote:
> Thanks, I hadn't seen that. So why are greeks not computed?

Delta and Gamma are computed.  Theta is not, but it's probably an
oversight.  If you have some time, you could add theta calculation to
FDStepConditionEngine (which would take one line of code) and test it
(which might take a bit longer.  You should re-enable the calculations
currently commented out in <test-suite/americanoption.cpp>.)

Luigi


> On Mar 3, 2010, at 8:13 AM, Luigi Ballabio wrote:
>
> > On Wed, 2010-03-03 at 08:02 -0500, Tawanda Gwena wrote:
> >> I'm using the 1.0 engine. From how I understand this program, all
> >> calls for greeks are going through the file oneassetoption.cpp. This
> >> oneassetoption calls calculate(), and the fdamericanengine doesn't
> >> have this calculate function().
> >
> > It does. It's inherited from FDStepConditionEngine. See
> > <ql/pricingengines/vanilla/fdstepconditionengine.hpp>
> >
> > Luigi
> >
> >
> > --
> >
> > Don't say "yes" until I finish talking.
> > -- Darryl F. Zanuck
> >
> >
>



--

Don't say "yes" until I finish talking.
-- Darryl F. Zanuck



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users