Is there a method in quantlib that can calculate Z-SPREAD of bond given
price and term structure or calculate price given Z-SPREAD and term structure? (Z-Spread is the amount of basis points one has to add to forward rates implied by zero curve to equate discounted NPV of bond to the given price of bond) I'm absolute beginner to quantlib, quick grep in source code does not give any result so before reinventing the wheel I decided to ask community help. _________________________________________________________________ A new home for Mom, no cleanup required. All starts here. http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
for the latter, try: ZeroSpreadedTermStructure (const Handle< YieldTermStructure > &, const Handle< Quote > &spread, Compounding comp=Continuous, Frequency freq=NoFrequency, const DayCounter &dc=DayCounter()) in the constructor of the bond, then calculate NPV() as usual. For the former (calc z-spread from price and term structure), I think it comes out in the next release of QuantLib. Irakli Machabeli <[hidden email]> wrote: Is there a method in quantlib that can calculate Z-SPREAD of bond given
Shape Yahoo! in your own image. Join our Network Research Panel today! ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by imachabeli
Hi Irakli,
In the next release of QuantLib, bond class will have: dirtyPriceFromZSpread and cleanPriceFromZSpread, which calculate bond’s dirty and clean prices given: Z-spread, Daycounter, compounding, and frequency. The function which calculates Z-spread given bond’s market price has not been implemented yet.
Chiara -----Original Message-----
for the latter, try:
ZeroSpreadedTermStructure (const <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_handle.html">Handle< <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure > &, const <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_handle.html">Handle< <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_quote.html">Quote > &spread, Compounding comp=Continuous, <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\group__datetime.html#g6d41db8ba0ea90d22df35889df452ada">Frequency freq=NoFrequency, const <a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_day_counter.html">DayCounter &dc=<a href="file:///D:\cygwin\usr\local\src\QuantLib-docs-0.8.1-html\class_quant_lib_1_1_day_counter.html">DayCounter()) in the constructor of the bond, then calculate NPV() as usual.
For the former (calc z-spread from price and term structure), I think it comes out in the next release of QuantLib.
Shape Yahoo! in your own image. Join our Network Research Panel today! ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |