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