Hi guys, Right now, I have the bond trade date( for example, today ). How could I get the bond settlement date? Let’s say settlement days =3. Does Quantlib has some API to add days depending on business schedule? Thank you all! ------------------------------------------------------------------------------ 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 |
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); Also the Calendar class under ql/time/Calendar may be of assistance in specifying local holidays, etc. HTH, C On 12/10/2010 03:53 PM, Le Shi wrote: > > Hi guys, > > Right now, I have the bond trade date( for example, today ). How could > I get the bond settlement date? Let’s say settlement days =3. > > Does Quantlib has some API to add days depending on business schedule? > > Thank you all! > > > ------------------------------------------------------------------------------ > 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 ------------------------------------------------------------------------------ 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 |
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 |
Free forum by Nabble | Edit this page |