Posted by
Xavier.Abulker on
URL: http://quantlib.414.s1.nabble.com/Help-with-fdAmericanOption-tp2452p2453.html
hi wryboy,
I've tested that timeSteps=50 and gridPoints=50 are ok for american option.
It corresponds to the discretization of the time and underlying value.
You know when you represent a plan with x axis=time and y axis = underlying
you can draw a grid if you divide x axis in 50 equally spaced intervals and
the same for y axis.
In one word, the higher is this value and the more accurate is your
pricing.
So timeSteps=500 and gridPoints=500 should give a better pricing than
timeSteps=50 and gridPoints=50 but it's so small than you are going to lose
performance for no advantage in term of pricing.
If you need to price thousands of options (I did the same but with milions
of options) I would also recommand an analytical approximation like Barone
Adesi Whaley if performance is critical to you.
I did the developpement in my Quantlib 0.3.0 and can share the code with
you if you can help me to check it and test if there's no bug.
Xavier
Wry Boy <
[hidden email]>
Sent by: To:
[hidden email]
[hidden email] cc:
eforge.net Subject: [Quantlib-users] Help with fdAmericanOption
09/04/2003 00:28
I just installed QL 0.3.1 and am just getting started
with it. My background is programming and trading,
not ph.d.-level mathematics. I would like to use the
lib to price american options primarily. Looks like
the only direct support for american options is by
using finite difference techniques (no binomial for
american?)
So, regarding fdAmericanOption, can someone please
explain the timeSteps and gridPoints variables?
FdAmericanOption(
Option::Type type,
double underlying,
double strike,
Spread dividendYield,
Rate riskFreeRate,
Time residualTime,
double volatility,
int timeSteps, // <-- how to use this??
int gridPoints // <-- how to use this??
);
I am interested in a pragmatic explanation, not a
highly mathematical or theorectical one. The docs
present the partial differential equations which does
not help me because I don't understand them.
The other question I have is about optimizing the use
of the lib to price many options. If I want to price
thousands of options, for example, holding everything
constant and varying the underlying price in small
increments, would I do this by instantiating a new
option object with each new underlying price? For
example:
for (double under=x; under<y; under+=0.25) {
fdAmericanOption option(...,under,...);
... = option.value()
}
Is that the _best_ way to rip many values out of the
lib?
tia
wryboy
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/_______________________________________________
Quantlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users*************************************************************************
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.
*************************************************************************