hello, i have the following quotes from an outside source.
how can i input these quotes and produce a complete yield curve and corresponding vector of discount factors? an example would be greatly appreciated i am trying to price an option that may expire in 23 months from now (for example). So i would need the correct rate to use for that. thanks Pavan
------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Just take this example and use depo and swap rates. drop the FRAs. -Whit On Thu, Aug 7, 2014 at 2:10 PM, Pavan Shah <[hidden email]> wrote:
------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
thank you so much Whit i was able to construct a yc per the link. however, when i call the zeroRate method i always get the first rate 0.122% that i inserted regardless of the date in the first argument. This is the first deposit rate quote Rate d1wQuote=0.00122;
the discount function also just returns 1 all the time. i believe these two functions belong to class YieldTermStructure. here is my code snippet. Assume everything is set up as in the link in your email above.
std::cout<<"the zero rate at t+8m : " << depoSwapTermStructure->zeroRate(todaysDate + 8*Months,depositDayCounter,Simple)<<std::endl; std::cout<<"the 8month zero price to be used for discounting "<<depoSwapTermStructure->discount(todaysDate + 8*Months) <<std::endl;
depoSwapTermStructure is from boost::shared_ptr<YieldTermStructure>depoSwapTermStructure(new PiecewiseYieldCurve<Discount, LogLinear>(settlementDate,depoSwapInstruments,termStructureDayCounter, tolerance)); anyone , any ideas? thanks Pavan On Thu, Aug 7, 2014 at 12:01 PM, Whit Armstrong <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
put your full code up in a gist. or a repo. On Fri, Aug 8, 2014 at 8:29 PM, Pavan Shah <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
my full code is just the link you pasted and then two lines I added above. i attached the .cpp file but interesting observations: i do get diff values for some dates. for example try
todaysDate + 33*Months in my zeroRate function above. you will get a rate closer to my 3Y input quote which makes sense how does this zeroRate function work? thanks Pavan On Fri, Aug 8, 2014 at 5:37 PM, Whit Armstrong <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users TestYC.cpp (21K) Download Attachment |
try feeding different quotes :) Peter Von meinem iPhone gesendet
------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |