Guys, I am trying to enhance the FixedRateBond function of QuantLibXL but I can't find a way to do that without breaking compatibility. Below you can see the all current arguments of the function. In order to correctly represent that NTNF bond I need that coupon rate is 10% Annual 30/360 (30/360 just to count integer months). I believe there are at least two ways to do that:
It is a bit weird because I enhanced QuantLib's FixedRateBond to include proper behavior and kept backward compatibility (test suite just ran How could I finish this work? Should I create a new function (like newFixedRateBond), generate the diff file, attach a spreadsheet use case and let maintainers decide what to do with it? I believe any object exposed to QuantLibXL may have this problem because make spreadsheet functions backward compatible is much harder than making it for C++ classes. Regards, ObjectID |
|
Description |
NTNF |
Currency |
BRL |
SettlementDays |
3 |
FaceAmount |
1000 |
ScheduleID |
obj_0000f#0003 |
Coupons |
10.0000% |
DayCounter |
Business252 |
PaymentBDC |
Following |
Redemption |
|
IssueDate |
|
Permanent |
|
Trigger |
|
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi Piter,
I don't understand your question, can you elaborate? > * Change coupons from scalar to InterestRate object - > it means that any current spreadsheet will fail because it is a new type > for the field You say "Change coupons *from scalar*", I don't understand. In the latest version of QuantLibXL (0.9.7), for function qlFixedRateBond(), the argument "Coupons" is not a scalar, it is a vector of doubles. Do you want a setup where 1) old spreadsheets call function qlFixedRateBond() and pass to argument Coupon a value of type vector<double>, and 2) new spreadsheets call the same function and pass to the same argument a value of type InterestRate? If so, this could be accomplished using coercion: http://quantlib.org/quantlibxl/coercion.html Regards, Eric ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Eric,
I am trying to make a sample Brazilian treasuries spreadsheet and started with NTNF bond. It has a 10% Annual 30/360 coupon rate paid Semi-annual, which means that it pays around 4.880884817% each semester. > the argument "Coupons" is not a scalar, it is a vector of doubles. Yes, you are right by I would like to include Compounding and Frequency as well. This should be easy using InterestRate object or including two more inputs. In order to test it, I created a qlnewFixedRateBond function with two extra inputs (Compounding and Frequency) but this is far from a good solution because of lack of backward compatibility. However, it generated the correct cash flows. > If so, this could be accomplished using coercion: > > http://quantlib.org/quantlibxl/coercion.html This is new for me and should do exactly what I want. I will try to do the same spreadsheet using it. Thanks a lot, ------------------------- Piter Dias [hidden email] ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |