|
From: Luigi B. <lui...@gm...> - 2021-04-16 07:12:51
|
Hello,
no, in general the parameters that describe the contract for the
instrument (as opposed to market quotes) can't be changed once the
instrument is created.
Luigi
On Mon, Apr 12, 2021 at 7:58 PM jian Xu <jia...@gm...> wrote:
> Make sense. So is there a way to change the spread of a
> floatingRateBond after the object is constructed? If yes, then I can
> bump the spread up and down to avoid bumping the index up and down.
> This should have the same impact, and it won't affect other bonds.
>
> On Mon, Apr 12, 2021 at 9:09 AM Luigi Ballabio <lui...@gm...>
> wrote:
> >
> > Jian,
> > the idea behind it is that, if that were possible, one could be
> given a bond and through that be able to affect any other bonds that use
> the same index or forecast curve. We thought that this made it too easy to
> do the wrong thing without realizing it.
> >
> > Luigi
> >
> >
> > On Mon, Apr 12, 2021 at 3:30 PM jian Xu <jia...@gm...> wrote:
> >>
> >> I see. I know how to use the original curve to calculate the interest
> >> rate sensitivity. But not being able to extract it from the index
> >> seems a bit surprising to me. Because for a fixedRateBond, the IR
> >> sensitivity interface is simply
> >>
> >> def sensitivity(fixedRatebond, y):
> >>
> >> But for a floating rate bond, it becomes:
> >>
> >> def sensitivity(floatingRateBond, y, forecast_curve):
> >>
> >> If we can extract the forecast_curve from the index from the
> >> floatingRateBond, then the two API could be unified, which seems more
> >> reasonable to me.
> >>
> >> Jian
> >>
> >> On Mon, Apr 12, 2021 at 2:24 AM Luigi Ballabio <
> lui...@gm...> wrote:
> >> >
> >> > Hello,
> >> > the term structure that you can retrieve from the index can't be
> relinked. Instead, you should keep hold of the one you originally used to
> build the index and bump that one. The index will react accordingly.
> >> >
> >> > Hope this helps,
> >> > Luigi
> >> >
> >> >
> >> > On Sun, Apr 11, 2021 at 4:42 PM jian Xu <jia...@gm...> wrote:
> >> >>
> >> >> Can anyone help here? I think I'm already very close. There ought
> to
> >> >> be a way to bump the index, either buy relink it to a bumped curve,
> or
> >> >> by some other means. This should be a common practice when we want
> to
> >> >> calculate the interest rate sensitivity of a floating rate bond,
> >> >> shouldn't it?
> >> >>
> >> >> Thanks.
> >> >>
> >> >> On Fri, Apr 9, 2021 at 2:49 PM jian Xu <jia...@gm...> wrote:
> >> >> >
> >> >> > But after I get the index, how to bump the index? What I'm trying
> to
> >> >> > do is to calculate the cashflows when the index curve is bumped up,
> >> >> > say 0.0001, in parallel. I have the floating rate bond already
> >> >> > constructed, then
> >> >> >
> >> >> > bond = ql.FloatingRateBond(...)
> >> >> > cpn = ql.as_floating_rate_coupon(bond.cashflows()[0])
> >> >> > ibor = ql.as_iborindex(cpn.index())
> >> >> > forecast_curve = ibor.forwardingTermStructure()
> >> >> >
> >> >> > But how do I bump the forecast_curve? I can create a bumped
> forecast
> >> >> > curve like the following:
> >> >> >
> >> >> > forecast_curve_bumped =
> ql.ZeroSpreadedTermStructure(forecast_curve,
> >> >> > ql.QuoteHandle(ql.SimpleQuote(.0001)))
> >> >> >
> >> >> > But then how do I link the index to this bumped curve, so that the
> >> >> > bond's cashflow will be impacted? Thanks.
> >> >> >
> >> >> >
> >> >> > On Fri, Apr 9, 2021 at 11:57 AM jian Xu <jia...@gm...>
> wrote:
> >> >> > >
> >> >> > > I see. Thanks!
> >> >> > >
> >> >> > > On Fri, Apr 9, 2021 at 4:31 AM Luigi Ballabio <
> lui...@gm...> wrote:
> >> >> > > >
> >> >> > > > As David said — or you can avoid the map by selecting the
> first coupon before conversion:
> >> >> > > >
> >> >> > > > c = ql.as_floating_rate_coupon(bnd.cashflows()[0])
> >> >> > > > myindex = c.index()
> >> >> > > >
> >> >> > > >
> >> >> > > > On Fri, Apr 9, 2021 at 10:25 AM David Duarte <nh...@gm...>
> wrote:
> >> >> > > >>
> >> >> > > >> Hi,
> >> >> > > >>
> >> >> > > >> I'm not sure the index is exposed for the bond object, but
> you can extract it from the cashflows.
> >> >> > > >> Maybe not the easiest way to go about it, but hopefully
> you'll get the idea:
> >> >> > > >>
> >> >> > > >> bnd = ql.FloatingRateBond(...)
> >> >> > > >> c = [*map(ql.as_floating_rate_coupon, bnd.cashflows())][0]
> >> >> > > >> myindex = c.index()
> >> >> > > >>
> >> >> > > >> Regards,
> >> >> > > >> David
> >> >> > > >>
> >> >> > > >> On Fri, 9 Apr 2021 at 03:03, jian Xu <jia...@gm...>
> wrote:
> >> >> > > >>>
> >> >> > > >>> Hi,
> >> >> > > >>>
> >> >> > > >>> An index is passed in duration the construction of a
> FloatingRateBond,
> >> >> > > >>> But after that, given the FloatingRateBond object, how do I
> get the
> >> >> > > >>> index back (in Python)? Thanks.
> >> >> > > >>>
> >> >> > > >>> Jian
> >> >> > > >>>
> >> >> > > >>>
> >> >> > > >>> _______________________________________________
> >> >> > > >>> QuantLib-users mailing list
> >> >> > > >>> Qua...@li...
> >> >> > > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >> >> > > >>
> >> >> > > >> _______________________________________________
> >> >> > > >> QuantLib-users mailing list
> >> >> > > >> Qua...@li...
> >> >> > > >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|