Posted by
Jay Walters on
URL: http://quantlib.414.s1.nabble.com/Question-on-floating-cashflows-tp5229.html
I am looking at the QL 0.8.1 source code, so perhaps this has changed in SVN.
In the class Schedule, the constructor adjusts each of the dates given the calendar and business day convention specified as arguments. Later on in the lifecycle of this object I will use it to create a FloatingLeg using the code in cashflowvectors.cpp. In the method
template <typename IndexType,
typename FloatingCouponType,
typename CappedFlooredCouponType>
Leg FloatingLeg(const std::vector<Real>& nominals,
const Schedule& schedule,
const boost::shared_ptr<IndexType>& index,
const DayCounter& paymentDayCounter,
BusinessDayConvention paymentAdj,
Natural fixingDays,
const std::vector<Real>& gearings,
const std::vector<Spread>& spreads,
const std::vector<Rate>& caps,
const std::vector<Rate>& floors,
bool isInArrears) {
The code once again adjusts the dates using the calendar from the schedule (which shouldn't do anything), and there is a comment
// the following is not always correct
Calendar calendar = schedule.calendar();
A few questions.
#1 - Why do we adjust the dates twice, they are adjusted already in the Schedule constructor.
#2 - Market convention on a CDS (which isn't currently in QL) is apparently to have an unadjusted start date, there is currently not an option to do this in the current Schedule object.
#3 - What does the comment mean, and should a different calendar object be passed in to the FixedLeg method? When is using the calendar from Schedule incorrect?
#4 - I am building USD Libor swaps and am using the joint UK, US calendar as the calendar in the Schedule. This appears to generate the proper sequence of reset/pay dates. The Swap example in testsuite/swapvaluation.cpp only deals with a Euro swap which is a simpler case due to only needing the Target calendar.
Jay
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users