Quantlib: Java Bond Settlement Date wrong

Posted by benedict 1 on
URL: http://quantlib.414.s1.nabble.com/Quantlib-Java-Bond-Settlement-Date-wrong-tp15571.html

Hi Luigi and all,

I have a problem when trying to initialise a constructor in quantlib java using SWIG. Does anyone know if there is anything wrong with the Bond Settlement Date? 
P.S I have tried it using zerocouponbond, fixedratebond also, but it only works correctly if I set the issuedate to today's Date.


     long settlementdays = 2;
    Date issueDate = new Date(16,Month.May,2014);
    Date mat = issueDate.add(new Period(5,TimeUnit.Years));
    Calendar cal = new Singapore();
    double faceAmount = 100;

    Bond ql_bond = new Bond(settlementdays,cal,faceAmount,mat,issueDate);
    Bond ql_bond2 = new Bond(settlementdays,cal,faceAmount,mat,issueDate,myleg);
        
    System.out.println("Printing Bond information");
    System.out.println("calendar: " + ql_bond.calendar());
    System.out.println("issuedate: " + ql_bond.issueDate());
    System.out.println("settlementdate: "  + ql_bond.settlementDate());
    System.out.println("maturity date: " + ql_bond.maturityDate());

Result:

Printing Bond information
calendar: Singapore exchange calendar
issuedate: May 16th, 2014
settlementdate: July 8th, 2014
maturity date: May 16th, 2019

Thanks very much for replying,
Cheers
Benedict


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

bond error.PNG (54K) Download Attachment