Coupons and Fixed Rate Legs

Posted by John Maiden on
URL: http://quantlib.414.s1.nabble.com/Coupons-and-Fixed-Rate-Legs-tp1151.html

How exactly does the fixed rate leg work? I'm asking because I'd like to know
how it determines a coupon date (and set up my own coupon dates). For example, I
get a weird coupon schedule for a 4.75 fixed rate bond that goes from today
(July 19, 2007) to February 1, 2008. Weird as in I don't understand the logic of
how it was set up. Assuming that a zero coupon amount means a coupon payment,
the code below gives me the following coupon dates:

Aug 1, 2007
Sept 1, 2007
Nov 1, 2007
Jan 1, 2008
Feb 1, 2008
Apr 1, 2008
Jun 1, 2008
Aug 1, 2008
Sept 1, 2008
Nov 1, 2008
Jan 1, 2009
Feb 1, 2009

Here's the code:

// TestQuantLib.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <ql/quantlib.hpp>
#include <boost/timer.hpp>

using namespace std;
using namespace QuantLib;

int _tmain(int argc, _TCHAR* argv[])
{
        try{

                std::vector<Real> coupons(1, 0.0475);
                std::vector<Real> faceAmount_(1, 100);
               
                Calendar calendar = UnitedStates(UnitedStates::Market::NYSE);
                Date today = calendar.adjust(Date::todaysDate());

                BusinessDayConvention convention = Unadjusted;

                Frequency frequency = Daily;

                Date exerciseDate = Date(2, February, 2009);
               
                Schedule schedule_(today, exerciseDate, Period(frequency), calendar,
convention, convention,
                        true, false);

                DayCounter dayCount = Thirty360();

                Leg cashFlows_ = FixedRateLeg(faceAmount_, schedule_, coupons, dayCount,
                        schedule_.businessDayConvention());

                for(int i = 0; i < cashFlows_.size(); i++){
                        cout << cashFlows_[i]->amount() << endl;
                        if(i % 10 == 0)
                                system("PAUSE");
                }
       
        } catch (std::exception& e) {
                cout << e.what() << endl;
        }

        system("PAUSE");
        return 0;
}

Thanks in advance for any help.



-------------------------------------------------------------------------
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