Re: How to calculate bond yield

Posted by Enrico Gargiulo on
URL: http://quantlib.414.s1.nabble.com/How-to-calculate-bond-yield-tp786p788.html


Enrico,
        the discount curve is only used if you want to calculate a
theoretical price based on such curve. For price/yield calculations, you
don't need to provide one---the yield will be used for discounting instead.

Later,
        Luigi


----------------------------------------

Green's Law of Debate:
Anything is possible if you don't know what you're talking about.


Luigi,
my problem is that when I create the object without curve I have the
following results:

        Real faceAmount = 98.0;
        Date issueDate(30, April, 2006);
        Date maturityDate(30, April, 2007);
        Date deliveryDate(18, April, 2007);
        Integer settlementDays = 3;
        Calendar calendar = NullCalendar();
        DayCounter dayCountConvention = Actual365Fixed();
        BusinessDayConvention businessDayConvention = Unadjusted;
        Real redemption = 100.0;
       
        Date settlementDate(18, April, 2007);
       
        ZeroCouponBond bot(faceAmount, issueDate, maturityDate,
settlementDays,
            dayCountConvention, calendar, businessDayConvention,
redemption);
           
           
        std::cout << "Underlying bond clean price: " << bot.cleanPrice() <<
std::endl;

The results are:

        Underlying bond clean price: no discounting term structure set

Where is the mistake?

Thanks
Enrico


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users