You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
| 2002 |
Jan
(18) |
Feb
(20) |
Mar
(22) |
Apr
(41) |
May
(28) |
Jun
(25) |
Jul
(10) |
Aug
(7) |
Sep
(5) |
Oct
(20) |
Nov
(13) |
Dec
(11) |
| 2003 |
Jan
(28) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(17) |
Jun
(6) |
Jul
(45) |
Aug
(35) |
Sep
(24) |
Oct
(50) |
Nov
(53) |
Dec
(6) |
| 2004 |
Jan
(4) |
Feb
(10) |
Mar
(52) |
Apr
(46) |
May
(8) |
Jun
(25) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2005 |
Jan
(18) |
Feb
(60) |
Mar
(19) |
Apr
(26) |
May
(14) |
Jun
(27) |
Jul
(8) |
Aug
(15) |
Sep
(19) |
Oct
(53) |
Nov
(20) |
Dec
(23) |
| 2006 |
Jan
(16) |
Feb
(27) |
Mar
(33) |
Apr
(51) |
May
(36) |
Jun
(25) |
Jul
(54) |
Aug
(30) |
Sep
(25) |
Oct
(67) |
Nov
(43) |
Dec
(13) |
| 2007 |
Jan
(23) |
Feb
(27) |
Mar
(55) |
Apr
(79) |
May
(60) |
Jun
(66) |
Jul
(46) |
Aug
(30) |
Sep
(90) |
Oct
(49) |
Nov
(85) |
Dec
(74) |
| 2008 |
Jan
(68) |
Feb
(59) |
Mar
(64) |
Apr
(28) |
May
(66) |
Jun
(35) |
Jul
(73) |
Aug
(76) |
Sep
(65) |
Oct
(46) |
Nov
(41) |
Dec
(19) |
| 2009 |
Jan
(46) |
Feb
(90) |
Mar
(51) |
Apr
(104) |
May
(13) |
Jun
(24) |
Jul
(20) |
Aug
(39) |
Sep
(109) |
Oct
(101) |
Nov
(117) |
Dec
(57) |
| 2010 |
Jan
(55) |
Feb
(42) |
Mar
(39) |
Apr
(22) |
May
(33) |
Jun
(41) |
Jul
(25) |
Aug
(52) |
Sep
(75) |
Oct
(60) |
Nov
(62) |
Dec
(52) |
| 2011 |
Jan
(70) |
Feb
(31) |
Mar
(26) |
Apr
(28) |
May
(17) |
Jun
(38) |
Jul
(51) |
Aug
(35) |
Sep
(27) |
Oct
(35) |
Nov
(10) |
Dec
(20) |
| 2012 |
Jan
(21) |
Feb
(29) |
Mar
(13) |
Apr
(37) |
May
(33) |
Jun
(12) |
Jul
(34) |
Aug
(27) |
Sep
(29) |
Oct
(35) |
Nov
(58) |
Dec
(27) |
| 2013 |
Jan
(27) |
Feb
(16) |
Mar
(40) |
Apr
(16) |
May
(34) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(49) |
Nov
(13) |
Dec
(12) |
| 2014 |
Jan
(15) |
Feb
(21) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(60) |
Jul
(19) |
Aug
(29) |
Sep
(20) |
Oct
(28) |
Nov
(41) |
Dec
(15) |
| 2015 |
Jan
(33) |
Feb
(29) |
Mar
(26) |
Apr
(17) |
May
(2) |
Jun
(13) |
Jul
(21) |
Aug
(30) |
Sep
(22) |
Oct
(15) |
Nov
(46) |
Dec
(20) |
| 2016 |
Jan
(6) |
Feb
(5) |
Mar
(9) |
Apr
(15) |
May
(9) |
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(39) |
Oct
(8) |
Nov
(5) |
Dec
(8) |
| 2017 |
Jan
(4) |
Feb
(14) |
Mar
(4) |
Apr
(16) |
May
(5) |
Jun
(10) |
Jul
(25) |
Aug
(2) |
Sep
(5) |
Oct
(11) |
Nov
(8) |
Dec
(11) |
| 2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(1) |
May
(4) |
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(5) |
Mar
(18) |
Apr
(9) |
May
(5) |
Jun
(21) |
Jul
(25) |
Aug
(25) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2021 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(5) |
| 2022 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(1) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2024 |
Jan
(8) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2026 |
Jan
(1) |
Feb
(12) |
Mar
|
Apr
(2) |
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Luigi B. <lui...@fa...> - 2004-04-15 11:46:49
|
Hi all, tarballs for the 0.3.6 release (basically 0.3.5 with the implied-volatility bug fixed) are available at http://quantlib.org/gm Since the bug was a serious one, we're releasing the tarballs immediately. Unfortunately, this implies that Win32, Debian, Fink and RPM packages will lag a few days behind. But I trust this won't be a problem. Later, Luigi |
|
From: Dirk E. <ed...@de...> - 2004-04-14 15:21:32
|
On Wed, Apr 14, 2004 at 05:13:50PM +0200, Luigi Ballabio wrote:
>
> Hi all,
> this was a nasty one. I'm flirting with the idea of fixing the
> bug on the 0.3.5 branch and re-releasing it as 0.3.6. Thoughts?
Go for it! As they say: "Release early, release often".
No harm in finding bugs and fixing them, only in keeping'em under the carpet.
Dirk
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|
|
From: Luigi B. <lui...@fa...> - 2004-04-14 15:13:59
|
Hi all, this was a nasty one. I'm flirting with the idea of fixing the bug on the 0.3.5 branch and re-releasing it as 0.3.6. Thoughts? Later, Luigi |
|
From: Luigi B. <lui...@fa...> - 2004-04-14 15:09:51
|
Hi all, I just fixed in CVS a serious bug in the impliedVolatility() method of all classes derived from OneAssetOption (you can check the documentation to see the affected classes) which slipped through the test suite and could cause wrong results to be returned if a certain sequence of actions were performed. We might consider releasing QuantLib 0.3.6 sooner than we thought. In the meantime, here is the way to avoid triggering the bug: a) if you mean to call the impliedVolatility() method on such an option, do not pass it a Handle<StochasticProcess> you already passed (or intend to pass) to another instrument. Create a new Handle containing a newly-allocated process. b) impliedVolatility() will return the right result. However, after calling impliedVolatility(), the option is broken. You might as well throw it away and instantiate a new one. Sorry for the inconvenience, Luigi |
|
From: SourceForge.net <no...@so...> - 2004-04-14 00:09:04
|
Bugs item #934626, was opened at 2004-04-13 17:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=934626&group_id=12740 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=934626&group_id=12740 |
|
From: Luigi B. <lui...@fa...> - 2004-04-09 15:03:12
|
Cheers, Luigi |
|
From: SourceForge.net <no...@so...> - 2004-04-09 14:45:13
|
Feature Requests item #931122, was opened at 2004-04-07 17:14 Message generated for change (Comment added) made by lballabio You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=362740&aid=931122&group_id=12740 Category: None Group: None >Status: Closed Priority: 5 Submitted By: Jorge Godoy (godoy) Assigned to: Nobody/Anonymous (nobody) Summary: RPM SPEC change Initial Comment: It should be interesting to add '-f' to the lines that 'rm' the testing suit from the building directory. Those lines make the building fail if there's no prior copy of QuantLib. Such a change causes no collateral damage, also. I'm adding a patch that will do such a change. Thanks for the software! :-) Jorge Godoy. ---------------------------------------------------------------------- >Comment By: Luigi Ballabio (lballabio) Date: 2004-04-09 16:45 Message: Logged In: YES user_id=75450 Jorge, it's fixed in CVS now. Thanks, Luigi ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=362740&aid=931122&group_id=12740 |
|
From: SourceForge.net <no...@so...> - 2004-04-07 19:03:17
|
Feature Requests item #931122, was opened at 2004-04-07 12:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=362740&aid=931122&group_id=12740 Category: None Group: None Status: Open Priority: 5 Submitted By: Jorge Godoy (godoy) Assigned to: Nobody/Anonymous (nobody) Summary: RPM SPEC change Initial Comment: It should be interesting to add '-f' to the lines that 'rm' the testing suit from the building directory. Those lines make the building fail if there's no prior copy of QuantLib. Such a change causes no collateral damage, also. I'm adding a patch that will do such a change. Thanks for the software! :-) Jorge Godoy. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=362740&aid=931122&group_id=12740 |
|
From: Dirk E. <ed...@de...> - 2004-04-06 16:38:15
|
Luigi,
On Tue, Apr 06, 2004 at 05:23:17PM +0200, Luigi Ballabio wrote:
>
> Dirk,
> it was impliedVolatility() that gave problems with the old
> American, right? What happens if you edit ql/argsandresults.hpp and
Not that I recall :) Maybe at a point in time way back; right now I was
just trying to use binomial pricer analytics that don't exist. But I have
to go over RQL in more detail anyway...
> change line 27 to
> #define QL_MIN_VOLATILITY 1.0e-5
> (apart from a big recompilation, that is :)
I'll keep that in mind.
Dirk
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|
|
From: Ferdinando A. <na...@am...> - 2004-04-06 16:33:53
|
At 05:09 PM 4/6/2004, Luigi Ballabio wrote: >On 2004.04.05 17:15, Ferdinando Ametrano wrote: >>BTW I hope to provide delta/gamma/theta for all the binomial engines >>before 0.3.7 > >Nando, > stop making promises you won't be able to maintain. That's what >marketing people do :) Ok, so this means that now you've cornered me and I really have to do it, isn't it? :) ciao -- Nando |
|
From: Luigi B. <lui...@fa...> - 2004-04-06 15:23:27
|
Dirk, it was impliedVolatility() that gave problems with the old American, right? What happens if you edit ql/argsandresults.hpp and change line 27 to #define QL_MIN_VOLATILITY 1.0e-5 (apart from a big recompilation, that is :) Later, Luigi |
|
From: Luigi B. <lui...@fa...> - 2004-04-06 15:09:29
|
On 2004.04.05 17:15, Ferdinando Ametrano wrote: > BTW I hope to provide delta/gamma/theta for all the binomial engines > before 0.3.7 Nando, stop making promises you won't be able to maintain. That's what marketing people do :) Later, Luigi |
|
From: Ferdinando A. <na...@am...> - 2004-04-06 14:59:31
|
Hi Dirk >Ok, how about if we put it on alioth.debian.org then? Non-debianers get >accounts there too, and the codebase is the common sourceforge code before >it went non-free. it is OK for me. ciao -- Nando |
|
From: Dirk E. <ed...@de...> - 2004-04-06 14:51:00
|
On Tue, Apr 06, 2004 at 04:31:43PM +0200, Ferdinando Ametrano wrote: > Hi Dirk > > >> if we could have the R extension code in a CVS repository I would try > >> to take care of its code requirements while developing/changing > >QuantLib. > > > >That's probably a good idea. Shall we add it as a branch in the main QL > >repository, or should we keep it apart? > > On one hand I would prefer to have it in the main QL repository, on the > other hand the R extension is GPL, so there could be some confusion > about/with the QuantLib (BSD) license. > > My opinion is that unless you release the R extension under the QuantLib > license it would be better to have a dedicated SourceForge project. It > could be a QuantLibR project or even a QuantLibGNU project to host any > present and future GPL extension for QuantLib. > > What is your preference Dirk? Ok, how about if we put it on alioth.debian.org then? Non-debianers get accounts there too, and the codebase is the common sourceforge code before it went non-free. Dirk -- The relationship between the computed price and reality is as yet unknown. -- From the pac(8) manual page |
|
From: Ferdinando A. <na...@am...> - 2004-04-06 14:31:56
|
Hi Dirk > > if we could have the R extension code in a CVS repository I would try > > to take care of its code requirements while developing/changing QuantLib. > >That's probably a good idea. Shall we add it as a branch in the main QL >repository, or should we keep it apart? On one hand I would prefer to have it in the main QL repository, on the other hand the R extension is GPL, so there could be some confusion about/with the QuantLib (BSD) license. My opinion is that unless you release the R extension under the QuantLib license it would be better to have a dedicated SourceForge project. It could be a QuantLibR project or even a QuantLibGNU project to host any present and future GPL extension for QuantLib. What is your preference Dirk? ciao -- Nando |
|
From: Dirk E. <ed...@de...> - 2004-04-06 11:38:30
|
On Mon, Apr 05, 2004 at 06:45:01PM +0200, Ferdinando Ametrano wrote:
> Dirk: if we could have the R extension code in a CVS repository I would try
> to take care of its code requirements while developing/changing QuantLib.
That's probably a good idea. Shall we add it as a branch in the main QL
repository, or should we keep it apart?
I have RQuantLib 0.1.8 (for QL 0.3.5) almost ready. Once I roll that, we
could insert its tarball.
Dirk
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|
|
From: Luigi B. <lui...@fa...> - 2004-04-06 08:19:52
|
On 2004.04.06 04:09, Mark Treiber wrote: > I've attached a patch that adds darwin support to QuantLib-Ruby. Applied, thanks. Later, Luigi |
|
From: Mark T. <mrt...@en...> - 2004-04-06 02:09:13
|
I've attached a patch that adds darwin support to QuantLib-Ruby. The patch does two things. The first is that it converts the Binaries array (which was an array with a single value anyways) into a string so that it supports compiling to a .so as well as a .bundle for darwin. The binaries variable then replaces all instances of QuantLibc.so. The second part is that darwin now follows the linux build branches which requires additionally modifications to the cfg['LDFLAGS'] variable. The changes shouldn't affect the linux build but it should be test anyways. Mark. |
|
From: Ferdinando A. <na...@am...> - 2004-04-05 16:45:15
|
Hi Dirk >Could we possibly settle on an understanding that while they are net yet >available in the new framework, we do not nuke the old one? Of course this is the approach we have adopted. Even more: when a new feature is available in a new release the old equivalent feature is just deprecated, not nuked. Then in the next release it will be removed. >As you had gently nudged me to convert my few functions to the new pricers >(which I did, and I can live with barrieroptions without greeks), I would >prefer to release the American option code with greeks. Which requires the >old pricer. to the best of my knowledge the old pricer FdAmericanOption is still there: I use it for QuantLibXL! Please let me know if you have problems with it. Dirk: if we could have the R extension code in a CVS repository I would try to take care of its code requirements while developing/changing QuantLib. ciao -- Nando |
|
From: Dirk E. <ed...@de...> - 2004-04-05 15:37:45
|
Nando,
On Mon, Apr 05, 2004 at 05:10:25PM +0200, Ferdinando Ametrano wrote:
> >Do any of the other engines provide greeks? Would be nice to
> >still provide them for American options as I used to before 0.3.5.
>
> The (old) Finite Difference pricers provide greeks. Unfortunately they
> haven't been upgraded to the (new) pricing engine framework yet.
Could we possibly settle on an understanding that while they are net yet
available in the new framework, we do not nuke the old one?
As you had gently nudged me to convert my few functions to the new pricers
(which I did, and I can live with barrieroptions without greeks), I would
prefer to release the American option code with greeks. Which requires the
old pricer.
Dirk
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|
|
From: Ferdinando A. <na...@am...> - 2004-04-05 15:15:12
|
>Do any of the other engines provide greeks? Would be nice to >still provide them for American options as I used to before 0.3.5. BTW I hope to provide delta/gamma/theta for all the binomial engines before 0.3.7 I would like to implement the 3-nodes trick, that is to have a tree with three nodes instead of one at the t=0.0 root: this should provide delta and gamma, then use Black-Scholes for theta. ciao -- Nando |
|
From: Ferdinando A. <na...@am...> - 2004-04-05 15:10:35
|
Hi Dirk >Do any of the other engines provide greeks? Would be nice to >still provide them for American options as I used to before 0.3.5. The (old) Finite Difference pricers provide greeks. Unfortunately they haven't been upgraded to the (new) pricing engine framework yet. ciao -- Nando |
|
From: Dirk E. <ed...@de...> - 2004-04-05 11:31:07
|
Luigi,
On Mon, Apr 05, 2004 at 01:07:28PM +0200, Luigi Ballabio wrote:
> and the segfault will go away. What happens is that the current
> implementation of binomial engines do not provide greeks, and QuantLib
Ah.
> signals it by throwing an exception when delta() is called.
Ok, thanks. Do any of the other engines provide greeks? Would be nice to
still provide them for American options as I used to before 0.3.5.
Dirk
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|
|
From: Luigi B. <lui...@fa...> - 2004-04-05 11:07:43
|
On 2004.04.05 05:54, Dirk Eddelbuettel wrote:
> This is similar to the one I reported last week concerning barrier
> options.
> In this case a simple delta() call on an American option leads to a
> seg.fault. There is a fair chance that I am setting this up the
> wrong--suggestions would be welcome -- but I guess QL should not
> segfault.
Dirk,
write your main() as:
int main() {
try {
... your stuff here ...
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
}
and the segfault will go away. What happens is that the current
implementation of binomial engines do not provide greeks, and QuantLib
signals it by throwing an exception when delta() is called.
HTH,
Luigi
|
|
From: Dirk E. <ed...@de...> - 2004-04-05 03:54:46
|
All,
This is similar to the one I reported last week concerning barrier options.
In this case a simple delta() call on an American option leads to a
seg.fault. There is a fair chance that I am setting this up the wrong --
suggestions would be welcome -- but I guess QL should not segfault.
Here is how I am building and running the example leading to the segfault:
edd@basebud:/tmp> g++ -Wall -o ao_segfault ao_segfault.cc -lQuantLib
edd@basebud:/tmp> ./ao_segfault
Value: 11.3656
Aborted (core dumped)
edd@basebud:/tmp>
The code is below.
Regards, Dirk
#include <ql/quantlib.hpp> // make QuantLib known
using namespace QuantLib;
extern "C" {
Handle<TermStructure> makeFlatCurve(const Handle<Quote>& forward,
DayCounter dc) {
Date today = Date::todaysDate();
return Handle<TermStructure>(
new FlatForward(today, today,
RelinkableHandle<Quote>(forward), dc));
}
Handle<BlackVolTermStructure> makeFlatVolatility(const Handle<Quote>& vol,
DayCounter dc) {
Date today = Date::todaysDate();
return Handle<BlackVolTermStructure>(
new BlackConstantVol(today,
RelinkableHandle<Quote>(vol), dc));
}
enum EngineType { Analytic,
JR, CRR, EQP, TGEO, TIAN, LR,
PseudoMonteCarlo, QuasiMonteCarlo };
Handle<VanillaOption>
makeOption(const Handle<StrikedTypePayoff>& payoff,
const Handle<Exercise>& exercise,
const Handle<Quote>& u,
const Handle<TermStructure>& q,
const Handle<TermStructure>& r,
const Handle<BlackVolTermStructure>& vol,
EngineType engineType) {
Size binomialSteps = 251;
Handle<PricingEngine> engine;
switch (engineType) {
case Analytic:
engine = Handle<PricingEngine>(new AnalyticEuropeanEngine);
break;
case JR:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<JarrowRudd>(binomialSteps));
break;
case CRR:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<CoxRossRubinstein>(binomialSteps));
case EQP:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<AdditiveEQPBinomialTree>(
binomialSteps));
break;
case TGEO:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<Trigeorgis>(binomialSteps));
break;
case TIAN:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<Tian>(binomialSteps));
break;
case LR:
engine = Handle<PricingEngine>(
new BinomialVanillaEngine<LeisenReimer>(binomialSteps));
break;
case PseudoMonteCarlo:
engine = MakeMCEuropeanEngine<PseudoRandom>().withStepsPerYear(1)
.withTolerance(0.05)
.withSeed(42);
break;
case QuasiMonteCarlo:
engine = MakeMCEuropeanEngine<LowDiscrepancy>().withStepsPerYear(1)
.withSamples(1023);
break;
default:
QL_FAIL("Unknown engine type");
}
Handle<BlackScholesStochasticProcess>
stochProcess(new
BlackScholesStochasticProcess(
RelinkableHandle<Quote>(u),
RelinkableHandle<TermStructure>(q),
RelinkableHandle<TermStructure>(r),
RelinkableHandle<BlackVolTermStructure>(vol)));
return
Handle<VanillaOption>(new
VanillaOption(stochProcess, payoff, exercise, engine));
}
int main(void) {
Option::Type optionType = Option::Call;
Date today = Date::todaysDate();
double underlying = 100;
double strike = 100;
Spread dividendYield = 0.02;
Rate riskFreeRate = 0.03;
Time maturity = 0.5;
int length = int(maturity * 360); // FIXME: this could be better
double volatility = 0.4;
// new framework as per QuantLib 0.3.5
DayCounter dc = Actual360();
Handle<SimpleQuote> spot(new SimpleQuote(0.0));
Handle<SimpleQuote> vol(new SimpleQuote(0.0));
Handle<BlackVolTermStructure> volTS = makeFlatVolatility(vol,dc);
Handle<SimpleQuote> qRate(new SimpleQuote(0.0));
Handle<TermStructure> qTS = makeFlatCurve(qRate, dc);
Handle<SimpleQuote> rRate(new SimpleQuote(0.0));
Handle<TermStructure> rTS = makeFlatCurve(rRate, dc);
Date exDate = today.plusDays(length);
Handle<Exercise> exercise(new EuropeanExercise(exDate));
//Handle<Exercise> exercise(new AmericanExercise(today, exDate));
Handle<StrikedTypePayoff>
payoff(new PlainVanillaPayoff(optionType, strike));
Handle<VanillaOption> option = makeOption(payoff, exercise, spot,
qTS, rTS, volTS,
JR); // engine
//TGEO); // engine
spot->setValue(underlying);
qRate->setValue(dividendYield);
rRate->setValue(riskFreeRate);
vol->setValue(volatility);
std::cout << "Value: " << option->NPV() << std::endl;
std::cout << "Delta: " << option->delta() << std::endl;
}
}
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
|