Hi,
I am trying to build canadian overnight curve. But the discount factors and zero rates are not correct, the gaps are 10^(-5) - 10^(-6) which is not acceptable for us. I attached the complete file that how I use it. can you please kindly help? inherited a new index as this way: class CanDepo : public IborIndex { public: CanDepo(const Period& tenor, const Handle<YieldTermStructure>& h = Handle<YieldTermStructure>()); }; class CanadaON : public CanDepo { public: CanadaON(const Handle<YieldTermStructure>& h = Handle<YieldTermStructure>()) : CanDepo(Period(1, Years), h) {} }; CanDepo::CanDepo(const Period& tenor, const Handle<YieldTermStructure>& h) : IborIndex("Canada", tenor, 0, CADCurrency(), Canada(Canada::Settlement), ModifiedFollowing, true, Actual365Fixed(), h) { QL_REQUIRE(this->tenor().units()!=Days, "for daily tenors (" << this->tenor() << ") dedicated DailyTenor constructor must be used"); } test1CADOISCurve.cpp |
Hi,
you have to set the evaluation date by adding something like Date settlementDate(21, June, 2012); + Settings::instance().evaluationDate() = settlementDate; because the rate helpers are constructed relative to this date. The evaluation date is by default your machine's system date. The output of your program then is 6M Discount Factor (Target 0.9953598) 0.99535975 1Y Discount Factor (Target 0.9913474) 0.99134741 3Y Discount Factor (Target 0.9688215) 0.96882152 Just out of curiosity, where did you take the target values from ? regards Peter emmajyu <[hidden email]> writes: > Hi, > I am trying to build canadian overnight curve. But the discount factors and > zero rates are not correct, the gaps are 10^(-5) - 10^(-6) which is not > acceptable for us. > > I attached the complete file that how I use it. can you please kindly help? > inherited a new index as this way: > > class CanDepo : public IborIndex { > public: > CanDepo(const Period& tenor, > const Handle<YieldTermStructure>& h = > Handle<YieldTermStructure>()); > }; > > > class CanadaON : public CanDepo { > public: > CanadaON(const Handle<YieldTermStructure>& h = > Handle<YieldTermStructure>()) > : CanDepo(Period(1, Years), h) {} > }; > > > CanDepo::CanDepo(const Period& tenor, const Handle<YieldTermStructure>& h) > : IborIndex("Canada", tenor, 0, CADCurrency(), > Canada(Canada::Settlement), ModifiedFollowing, true, Actual365Fixed(), h) { > QL_REQUIRE(this->tenor().units()!=Days, > "for daily tenors (" << this->tenor() << > ") dedicated DailyTenor constructor must be used"); > } > > > test1CADOISCurve.cpp > <http://quantlib.10058.n7.nabble.com/file/n14353/test1CADOISCurve.cpp> > > > > > -- > View this message in context: http://quantlib.10058.n7.nabble.com/Canadian-OIS-tp14353.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |