hello,
Does anyone know how to calculate Duration for say, a fixedrate bond in Python-QuantLib, I am not able to find the BondFunctions class in the python bindings. regards
Dagur G
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
hello, I am trying to calculate Duration for a fixedrate bond in Python-QuantLib, but I am not able to find the BondFunctions class in the python bindings.
Does anyone here have experience with this binding? Is the function-set missing from the Python Module? regards
Dagur G
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Dagur Gunnarsson-3
Dagur,
you're correct, BondFunctions is not exported. You can try adding it to the SWIG interfaces and rebuilding the bindings; you can use the CashFlows class as a model (it's in SWIG/cashflows.i). If it works, send me a patch and I'll add it to the repository. And of course, write back if you get stuck. Luigi On Thu, Jun 7, 2012 at 6:21 PM, Dagur Gunnarsson <[hidden email]> wrote: > hello, > > Does anyone know how to calculate Duration for say, a fixedrate bond in > Python-QuantLib, I am not able to find the BondFunctions class in the python > bindings. > > regards > Dagur G > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Dagur Gunnarsson-3
Hi, Some time ago I exported some of BondFunctions I needed in the following way. I don't know if it is the best approach though. Spread zSpread(const BondPtr& bond, Time duration(const BondPtr& bond,
return CashFlows::duration(boost::dynamic_pointer_cast<Bond>(bond)->cashflows(), yield, return CashFlows::bps(boost::dynamic_pointer_cast<Bond>(bond)->cashflows(), yield, Lluís Dagur, ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |