|
From: Francois B. <ig...@gm...> - 2020-10-08 08:44:43
|
Hi Isilay,
To add to Ben's comment, if you're using pure QuantLib (not QuantLibXL),
you can use InterpolatedZeroCurve<> template class. You'll have to choose
your interpolation method, but Linear is the typical choice. Here is a
small code sample..
Snippet
// SET UP YIELD CURVEstd::vector<Date> dates;std::vector<Real> rates;
for (std::map<Date, Real>::iterator iter = i.yieldCurve.begin(); iter
!= i.yieldCurve.end(); ++iter) {
dates.push_back(iter->first);
rates.push_back(iter->second);}
ext::shared_ptr<YieldTermStructure> yieldTermStructure =
ext::shared_ptr<YieldTermStructure>(
new InterpolatedZeroCurve<Linear>(dates, rates, dc));
RelinkableHandle<YieldTermStructure>
yieldHandle;yieldHandle.linkTo(yieldTermStructure);
regards
Francois Botha
On Thu, 8 Oct 2020 at 10:29, <ben...@ma...> wrote:
> QuantlibXL has qlInterpolatedYieldCurve which takes dates and either discount
> factors, Zero rates, or Forward Rates
>
>
>
> That curve is then able to sued for pricing or calculating forwards.
>
>
>
> Regards
>
>
>
> Ben
>
>
>
> *From:* isilay erol <ero...@gm...>
> *Sent:* Thursday, 8 October 2020 4:38 PM
> *To:* qua...@li...
> *Subject:* [Quantlib-users] Calculating forward rates and forward rate
> coupons with the yield curve which I already have
>
>
>
> Dear Luigi,
>
> I just met with quantlib.
>
> I try to understand from the examples how cash flows of floating rate
> bonds are created.
>
> But in the examples, I always see that yield curves are established from
> scratch.
>
>
>
> I want to calculate forward rates and forward rate coupons with the yield
> curve which I already have.
>
> (I don't want to construct a yield curve from scratch again - I have a
> zero coupon yield curve)
>
> And this way I want to create the cash flows of the floating bond. But I
> could not understand how I could do this.
>
> Can you help me on this issue?
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|