Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/how-to-get-the-settlement-day-tp7873p7875.html
On Mon, 2010-12-13 at 05:15 -0500, Johnson, Cedrick W. wrote:
> Take a look at the samples, in particular Bonds.cpp:
>
> Calendar calendar = TARGET();
>
> Date settlementDate(18, September, 2008);
> // must be a business day
> settlementDate = calendar.adjust(settlementDate);
>
> Integer fixingDays = 3;
> Natural settlementDays = 3;
>
> Date todaysDate = calendar.advance(settlementDate, -fixingDays, Days);
>
But in your case, you might want it backwards:
Date settlementDate = calendar.advance(tradeDate, settlementDays, Days);
or, if you instantiated the bond already, just call
bond.settlementDate(tradeDate);
Luigi
--
Barker's Proof:
Proofreading is more effective after publication.
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users