You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(18) |
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
|
Jun
(12) |
Jul
(48) |
Aug
(6) |
Sep
(3) |
Oct
(24) |
Nov
(15) |
Dec
(18) |
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
(80) |
Apr
(72) |
May
(46) |
Jun
(27) |
Jul
(23) |
Aug
(34) |
Sep
(65) |
Oct
(71) |
Nov
(19) |
Dec
(14) |
| 2003 |
Jan
(44) |
Feb
(59) |
Mar
(18) |
Apr
(62) |
May
(54) |
Jun
(27) |
Jul
(46) |
Aug
(15) |
Sep
(44) |
Oct
(36) |
Nov
(19) |
Dec
(12) |
| 2004 |
Jan
(26) |
Feb
(33) |
Mar
(47) |
Apr
(63) |
May
(36) |
Jun
(65) |
Jul
(80) |
Aug
(163) |
Sep
(65) |
Oct
(39) |
Nov
(36) |
Dec
(39) |
| 2005 |
Jan
(97) |
Feb
(78) |
Mar
(64) |
Apr
(64) |
May
(48) |
Jun
(55) |
Jul
(89) |
Aug
(57) |
Sep
(51) |
Oct
(111) |
Nov
(86) |
Dec
(76) |
| 2006 |
Jan
(84) |
Feb
(103) |
Mar
(143) |
Apr
(92) |
May
(55) |
Jun
(58) |
Jul
(71) |
Aug
(57) |
Sep
(74) |
Oct
(59) |
Nov
(8) |
Dec
(32) |
| 2007 |
Jan
(60) |
Feb
(40) |
Mar
(50) |
Apr
(26) |
May
(61) |
Jun
(120) |
Jul
(119) |
Aug
(48) |
Sep
(121) |
Oct
(66) |
Nov
(103) |
Dec
(43) |
| 2008 |
Jan
(60) |
Feb
(109) |
Mar
(92) |
Apr
(106) |
May
(82) |
Jun
(59) |
Jul
(67) |
Aug
(118) |
Sep
(131) |
Oct
(56) |
Nov
(37) |
Dec
(69) |
| 2009 |
Jan
(75) |
Feb
(76) |
Mar
(103) |
Apr
(78) |
May
(61) |
Jun
(35) |
Jul
(66) |
Aug
(69) |
Sep
(166) |
Oct
(46) |
Nov
(72) |
Dec
(65) |
| 2010 |
Jan
(48) |
Feb
(57) |
Mar
(93) |
Apr
(85) |
May
(123) |
Jun
(82) |
Jul
(98) |
Aug
(121) |
Sep
(146) |
Oct
(86) |
Nov
(72) |
Dec
(34) |
| 2011 |
Jan
(96) |
Feb
(55) |
Mar
(73) |
Apr
(57) |
May
(33) |
Jun
(74) |
Jul
(89) |
Aug
(71) |
Sep
(103) |
Oct
(76) |
Nov
(52) |
Dec
(61) |
| 2012 |
Jan
(48) |
Feb
(54) |
Mar
(78) |
Apr
(60) |
May
(75) |
Jun
(59) |
Jul
(33) |
Aug
(66) |
Sep
(43) |
Oct
(46) |
Nov
(75) |
Dec
(51) |
| 2013 |
Jan
(112) |
Feb
(72) |
Mar
(49) |
Apr
(48) |
May
(42) |
Jun
(44) |
Jul
(80) |
Aug
(19) |
Sep
(33) |
Oct
(37) |
Nov
(38) |
Dec
(98) |
| 2014 |
Jan
(113) |
Feb
(93) |
Mar
(49) |
Apr
(106) |
May
(97) |
Jun
(155) |
Jul
(87) |
Aug
(127) |
Sep
(85) |
Oct
(48) |
Nov
(41) |
Dec
(37) |
| 2015 |
Jan
(34) |
Feb
(50) |
Mar
(104) |
Apr
(80) |
May
(82) |
Jun
(66) |
Jul
(41) |
Aug
(84) |
Sep
(37) |
Oct
(65) |
Nov
(83) |
Dec
(52) |
| 2016 |
Jan
(68) |
Feb
(35) |
Mar
(42) |
Apr
(35) |
May
(54) |
Jun
(75) |
Jul
(45) |
Aug
(52) |
Sep
(60) |
Oct
(52) |
Nov
(36) |
Dec
(64) |
| 2017 |
Jan
(92) |
Feb
(59) |
Mar
(35) |
Apr
(53) |
May
(83) |
Jun
(43) |
Jul
(65) |
Aug
(68) |
Sep
(46) |
Oct
(75) |
Nov
(40) |
Dec
(49) |
| 2018 |
Jan
(68) |
Feb
(54) |
Mar
(48) |
Apr
(58) |
May
(51) |
Jun
(44) |
Jul
(40) |
Aug
(68) |
Sep
(35) |
Oct
(15) |
Nov
(7) |
Dec
(37) |
| 2019 |
Jan
(43) |
Feb
(7) |
Mar
(22) |
Apr
(21) |
May
(31) |
Jun
(39) |
Jul
(73) |
Aug
(45) |
Sep
(47) |
Oct
(89) |
Nov
(19) |
Dec
(69) |
| 2020 |
Jan
(52) |
Feb
(63) |
Mar
(45) |
Apr
(59) |
May
(42) |
Jun
(57) |
Jul
(30) |
Aug
(29) |
Sep
(75) |
Oct
(64) |
Nov
(96) |
Dec
(22) |
| 2021 |
Jan
(14) |
Feb
(24) |
Mar
(35) |
Apr
(58) |
May
(36) |
Jun
(15) |
Jul
(18) |
Aug
(31) |
Sep
(30) |
Oct
(33) |
Nov
(27) |
Dec
(16) |
| 2022 |
Jan
(35) |
Feb
(22) |
Mar
(14) |
Apr
(20) |
May
(44) |
Jun
(53) |
Jul
(25) |
Aug
(56) |
Sep
(11) |
Oct
(47) |
Nov
(22) |
Dec
(36) |
| 2023 |
Jan
(30) |
Feb
(17) |
Mar
(31) |
Apr
(48) |
May
(31) |
Jun
(7) |
Jul
(25) |
Aug
(26) |
Sep
(61) |
Oct
(66) |
Nov
(19) |
Dec
(21) |
| 2024 |
Jan
(37) |
Feb
(29) |
Mar
(26) |
Apr
(26) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(13) |
Sep
(15) |
Oct
(25) |
Nov
(13) |
Dec
(8) |
| 2025 |
Jan
(13) |
Feb
(1) |
Mar
(16) |
Apr
(17) |
May
(8) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(6) |
Oct
(15) |
Nov
(6) |
Dec
|
| 2026 |
Jan
(6) |
Feb
(4) |
Mar
(20) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Brian S. <bri...@gm...> - 2023-10-19 13:43:30
|
I used this
EoniaTermStructure = ql.PiecewiseLogCubicDiscount(TodaysDate,
EoniaInstruments, TermStructureDayCounter)
But then I cant use this in SwapRateHelper as discount curve
When I ran the code,
ql.SwapRateHelper(
ql.QuoteHandle(ql.SimpleQuote(0.004240)),
ql.Period( 3, ql.Years),
Calendar,
ql.Annual,
ql.Unadjusted,
ql.Thirty360(ql.Thirty360.European),
ql.Euribor6M(),
ql.QuoteHandle(ql.SimpleQuote(0)),
ql.Period(0, ql.Days),
EoniaTermStructure
)
I get below error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
line 26589, in __init__
_QuantLib.SwapRateHelper_swiginit(self, _QuantLib.new_SwapRateHelper(*args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wrong number or type of arguments for overloaded function
'new_SwapRateHelper'.
Possible C/C++ prototypes are:
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const
&,Natural,Pillar::Choice,Date,bool,ext::optional< bool >)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const
&,Natural,Pillar::Choice,Date,bool)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const
&,Natural,Pillar::Choice,Date)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const
&,Natural,Pillar::Choice)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const &,Natural)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &,Handle< YieldTermStructure > const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const
&,Period const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &,Handle< Quote > const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const &,Period
const &,Calendar const &,Frequency,BusinessDayConvention,DayCounter
const &,ext::shared_ptr< IborIndex > const &)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const
&,Natural,Pillar::Choice,Date,bool,ext::optional< bool >)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Natural,Pillar::Choice,Date,bool)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Natural,Pillar::Choice,Date)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Natural,Pillar::Choice)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Natural)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &,Period const &)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &,Handle< Quote > const &)
SwapRateHelper::SwapRateHelper(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,ext::shared_ptr<
IborIndex > const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &,Handle< YieldTermStructure > const
&,Pillar::Choice,Date,bool,ext::optional< bool >)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &,Handle< YieldTermStructure > const &,Pillar::Choice,Date,bool)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &,Handle< YieldTermStructure > const &,Pillar::Choice,Date)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &,Handle< YieldTermStructure > const &,Pillar::Choice)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &,Handle< YieldTermStructure > const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &,Period
const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &,Handle< Quote > const &)
SwapRateHelper::SwapRateHelper(Handle< Quote > const
&,ext::shared_ptr< SwapIndex > const &)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Pillar::Choice,Date,bool,ext::optional<
bool >)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Pillar::Choice,Date,bool)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Pillar::Choice,Date)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &,Pillar::Choice)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &,Handle<
YieldTermStructure > const &)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &,Period const &)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex >
const &,Handle< Quote > const &)
SwapRateHelper::SwapRateHelper(Rate,ext::shared_ptr< SwapIndex > const &)
On Thu, 19 Oct 2023 at 18:44, Trent Maetzold <tr...@ma...> wrote:
>
> The docs use PiecewiseYieldCurve as a placeholder for the plethora of actual piecewise constructors. Use ql.PiecewiseLogCubicDiscount and see if that works.
>
> Sent from Proton Mail for iOS
>
>
> On Thu, Oct 19, 2023 at 07:12, Brian Smith <bri...@gm...> wrote:
>
> Hi Luigi,
>
> Thanks for this reference.
>
> However in line number 194 ans onwards, following codes are written
>
> auto eoniaTermStructure =
> ext::make_shared<PiecewiseYieldCurve<Discount, Cubic>>(
> todaysDate, eoniaInstruments, termStructureDayCounter);
>
> eoniaTermStructure->enableExtrapolation();
>
> // This curve will be used for discounting cash flows
> RelinkableHandle<YieldTermStructure> discountingTermStructure;
> discountingTermStructure.linkTo(eoniaTermStructure);
>
> However I wonder how can I implement above code in python?
>
> In https://quantlib-python-docs.readthedocs.io/en/latest/termstructures/yield.html,
> there is one instruction which reads as,
>
> ql.PiecewiseYieldCurve(referenceDate, instruments, dayCounter, jumps,
> jumpDate, i=Interpolator(), bootstrap=bootstrap_type())
>
> However, with this I am getting below error
>
> ql.PiecewiseYieldCurve(todaysDate, eoniaInstruments, termStructureDayCounter)
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
>
> AttributeError: module 'QuantLib' has no attribute 'PiecewiseYieldCurve'
>
> Any workaround will be very helpful.
>
> Thanks for your time.
>
> On Wed, 11 Oct 2023 at 19:21, Luigi Ballabio <lui...@gm...> wrote:
> >
> > To get started, a simpler version is also in the examples:
> >
> > https://github.com/lballabio/QuantLib/blob/master/Examples/MulticurveBootstrapping/MulticurveBootstrapping.cpp
> >
> > Luigi
> >
> >
> > On Fri, Sep 29, 2023 at 6:57 PM Mike DelMedico <mik...@gm...> wrote:
> >>
> >> Hi there,
> >>
> >> I started here to get familiar with everything in the library:
> >>
> >> https://leanpub.com/quantlibpythoncookbook/
> >>
> >> Note that if you want to make the stairstepped front end of the curve you will have to do some tricks with zero coupon rate helpers, but it’s not crazy complicated once you get the ball rolling. There might be a more efficient way to do it but that would be best answered by someone else that knows the library better.
> >>
> >> Another helpful source for the front end would be this:
> >>
> >> https://www.cmegroup.com/market-data/files/cme-term-sofr-reference-rates-benchmark-methodology.pdf
> >>
> >> Hope that helps.
> >>
> >> -Mike
> >>
> >>
> >>
> >> On Fri, Sep 29, 2023 at 11:35 Brian Smith <bri...@gm...> wrote:
> >>>
> >>> Hi,
> >>>
> >>> Appreciate, if someone can provide some insight on below request.
> >>>
> >>> Thanks and regards,
> >>>
> >>> On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> wrote:
> >>> >
> >>> > Hi,
> >>> >
> >>> > I am looking for some work-out examples on construction of SOFT curve
> >>> > given various market instruments (mostly OIS) either with Python or
> >>> > C++
> >>> >
> >>> > Could you please point some useful sources on construction of SOFR
> >>> > curve using QL?
> >>> >
> >>> > Many thanks for your time.
> >>>
> >>>
> >>> _______________________________________________
> >>> 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
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: Trent M. <tr...@ma...> - 2023-10-19 13:14:32
|
The docs use PiecewiseYieldCurve as a placeholder for the plethora of actual piecewise constructors. Use ql.PiecewiseLogCubicDiscount and see if that works. Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Thu, Oct 19, 2023 at 07:12, Brian Smith <[bri...@gm...](mailto:On Thu, Oct 19, 2023 at 07:12, Brian Smith <<a href=)> wrote: > Hi Luigi, > > Thanks for this reference. > > However in line number 194 ans onwards, following codes are written > > auto eoniaTermStructure = > ext::make_shared<PiecewiseYieldCurve<Discount, Cubic>>( > todaysDate, eoniaInstruments, termStructureDayCounter); > > eoniaTermStructure->enableExtrapolation(); > > // This curve will be used for discounting cash flows > RelinkableHandle<YieldTermStructure> discountingTermStructure; > discountingTermStructure.linkTo(eoniaTermStructure); > > However I wonder how can I implement above code in python? > > In https://quantlib-python-docs.readthedocs.io/en/latest/termstructures/yield.html, > there is one instruction which reads as, > > ql.PiecewiseYieldCurve(referenceDate, instruments, dayCounter, jumps, > jumpDate, i=Interpolator(), bootstrap=bootstrap_type()) > > However, with this I am getting below error > > ql.PiecewiseYieldCurve(todaysDate, eoniaInstruments, termStructureDayCounter) > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > AttributeError: module 'QuantLib' has no attribute 'PiecewiseYieldCurve' > > Any workaround will be very helpful. > > Thanks for your time. > > On Wed, 11 Oct 2023 at 19:21, Luigi Ballabio <lui...@gm...> wrote: >> >> To get started, a simpler version is also in the examples: >> >> https://github.com/lballabio/QuantLib/blob/master/Examples/MulticurveBootstrapping/MulticurveBootstrapping.cpp >> >> Luigi >> >> >> On Fri, Sep 29, 2023 at 6:57 PM Mike DelMedico <mik...@gm...> wrote: >>> >>> Hi there, >>> >>> I started here to get familiar with everything in the library: >>> >>> https://leanpub.com/quantlibpythoncookbook/ >>> >>> Note that if you want to make the stairstepped front end of the curve you will have to do some tricks with zero coupon rate helpers, but it’s not crazy complicated once you get the ball rolling. There might be a more efficient way to do it but that would be best answered by someone else that knows the library better. >>> >>> Another helpful source for the front end would be this: >>> >>> https://www.cmegroup.com/market-data/files/cme-term-sofr-reference-rates-benchmark-methodology.pdf >>> >>> Hope that helps. >>> >>> -Mike >>> >>> >>> >>> On Fri, Sep 29, 2023 at 11:35 Brian Smith <bri...@gm...> wrote: >>>> >>>> Hi, >>>> >>>> Appreciate, if someone can provide some insight on below request. >>>> >>>> Thanks and regards, >>>> >>>> On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> wrote: >>>> > >>>> > Hi, >>>> > >>>> > I am looking for some work-out examples on construction of SOFT curve >>>> > given various market instruments (mostly OIS) either with Python or >>>> > C++ >>>> > >>>> > Could you please point some useful sources on construction of SOFR >>>> > curve using QL? >>>> > >>>> > Many thanks for your time. >>>> >>>> >>>> _______________________________________________ >>>> 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 > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Brian S. <bri...@gm...> - 2023-10-19 12:12:44
|
Hi Luigi,
Thanks for this reference.
However in line number 194 ans onwards, following codes are written
auto eoniaTermStructure =
ext::make_shared<PiecewiseYieldCurve<Discount, Cubic>>(
todaysDate, eoniaInstruments, termStructureDayCounter);
eoniaTermStructure->enableExtrapolation();
// This curve will be used for discounting cash flows
RelinkableHandle<YieldTermStructure> discountingTermStructure;
discountingTermStructure.linkTo(eoniaTermStructure);
However I wonder how can I implement above code in python?
In https://quantlib-python-docs.readthedocs.io/en/latest/termstructures/yield.html,
there is one instruction which reads as,
ql.PiecewiseYieldCurve(referenceDate, instruments, dayCounter, jumps,
jumpDate, i=Interpolator(), bootstrap=bootstrap_type())
However, with this I am getting below error
ql.PiecewiseYieldCurve(todaysDate, eoniaInstruments, termStructureDayCounter)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'QuantLib' has no attribute 'PiecewiseYieldCurve'
Any workaround will be very helpful.
Thanks for your time.
On Wed, 11 Oct 2023 at 19:21, Luigi Ballabio <lui...@gm...> wrote:
>
> To get started, a simpler version is also in the examples:
>
> https://github.com/lballabio/QuantLib/blob/master/Examples/MulticurveBootstrapping/MulticurveBootstrapping.cpp
>
> Luigi
>
>
> On Fri, Sep 29, 2023 at 6:57 PM Mike DelMedico <mik...@gm...> wrote:
>>
>> Hi there,
>>
>> I started here to get familiar with everything in the library:
>>
>> https://leanpub.com/quantlibpythoncookbook/
>>
>> Note that if you want to make the stairstepped front end of the curve you will have to do some tricks with zero coupon rate helpers, but it’s not crazy complicated once you get the ball rolling. There might be a more efficient way to do it but that would be best answered by someone else that knows the library better.
>>
>> Another helpful source for the front end would be this:
>>
>> https://www.cmegroup.com/market-data/files/cme-term-sofr-reference-rates-benchmark-methodology.pdf
>>
>> Hope that helps.
>>
>> -Mike
>>
>>
>>
>> On Fri, Sep 29, 2023 at 11:35 Brian Smith <bri...@gm...> wrote:
>>>
>>> Hi,
>>>
>>> Appreciate, if someone can provide some insight on below request.
>>>
>>> Thanks and regards,
>>>
>>> On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> wrote:
>>> >
>>> > Hi,
>>> >
>>> > I am looking for some work-out examples on construction of SOFT curve
>>> > given various market instruments (mostly OIS) either with Python or
>>> > C++
>>> >
>>> > Could you please point some useful sources on construction of SOFR
>>> > curve using QL?
>>> >
>>> > Many thanks for your time.
>>>
>>>
>>> _______________________________________________
>>> 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
|
|
From: Luigi B. <lui...@gm...> - 2023-10-19 07:11:10
|
Hi,
unfortunately it seems that the SWIG wrappers have some trouble with
numpy-defined types such as numpy.int64 (which is what is returned from
DepoQuotes.loc[0, 'Settlement_D']). If you convert it to a regular Python
int, as in:
ql.DepositRateHelper(
ql.QuoteHandle(DepoQuotes.loc[0, 'Quote']),
ql.Period(1,ql.Days), int(DepoQuotes.loc[0, 'Settlement_D']),
ql.TARGET(),
ql.Following, False, ql.Actual360()
)
then the constructor call works.
Luigi
On Thu, Oct 19, 2023 at 12:19 AM Christofer Bogaso <
bog...@gm...> wrote:
> Hi,
>
> I have below code
>
> import QuantLib as ql
> import pandas as pd
>
> DepoQuotes = pd.DataFrame({'Quote' : [ql.SimpleQuote(0.0004)],
> 'Settlement_D' : [0]})
>
> ql.DepositRateHelper(ql.QuoteHandle(DepoQuotes.loc[0, 'Quote']),
> ql.Period(1,ql.Days), DepoQuotes.loc[0, 'Settlement_D'], ql.TARGET(),
> ql.Following, False, ql.Actual360())
>
> Above code generates below error
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
>
> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
> line 26529, in __init__
>
> _QuantLib.DepositRateHelper_swiginit(self,
> _QuantLib.new_DepositRateHelper(*args))
>
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> TypeError: Wrong number or type of arguments for overloaded function
> 'new_DepositRateHelper'.
>
> Possible C/C++ prototypes are:
>
> DepositRateHelper::DepositRateHelper(Handle< Quote > const
> &,Period const &,Natural,Calendar const
> &,BusinessDayConvention,bool,DayCounter const &)
>
> DepositRateHelper::DepositRateHelper(Rate,Period const
> &,Natural,Calendar const &,BusinessDayConvention,bool,DayCounter const
> &)
>
> DepositRateHelper::DepositRateHelper(Handle< Quote > const
> &,ext::shared_ptr< IborIndex > const &)
>
> DepositRateHelper::DepositRateHelper(Rate,ext::shared_ptr<
> IborIndex > const &)
>
> Could you please to resolve above error?
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Trent M. <tr...@ma...> - 2023-10-19 03:41:50
|
I'm not totally sure why the objects from the DataFrame aren't expanding correctly, but I get the same result. My advice is just skip the DataFrame. The below should work just fine. import QuantLib as ql quote = ql.SimpleQuote(0.0004) helper = ql.DepositRateHelper( ql.QuoteHandle(quote), ql.Period(1, ql.Days), 0, ql.TARGET(), ql.Following, False, ql.Actual360(),) Sent with [Proton Mail](https://proton.me/) secure email. ------- Original Message ------- On Wednesday, October 18th, 2023 at 20:26, Trent Maetzold <tr...@ma...> wrote: > Check the python docs here: > > https://quantlib-python-docs.readthedocs.io/en/latest/thelpers.html#depositratehelper > > Sent from [Proton Mail](https://proton.me/mail/home) for iOS > > On Wed, Oct 18, 2023 at 17:15, Christofer Bogaso <[bog...@gm...](mailto:On Wed, Oct 18, 2023 at 17:15, Christofer Bogaso <<a href=)> wrote: > >> Hi, >> >> I have below code >> >> import QuantLib as ql >> import pandas as pd >> >> DepoQuotes = pd.DataFrame({'Quote' : [ql.SimpleQuote(0.0004)], >> 'Settlement_D' : [0]}) >> >> ql.DepositRateHelper(ql.QuoteHandle(DepoQuotes.loc[0, 'Quote']), >> ql.Period(1,ql.Days), DepoQuotes.loc[0, 'Settlement_D'], ql.TARGET(), >> ql.Following, False, ql.Actual360()) >> >> Above code generates below error >> >> Traceback (most recent call last): >> >> File "<stdin>", line 1, in <module> >> >> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", >> line 26529, in __init__ >> >> _QuantLib.DepositRateHelper_swiginit(self, >> _QuantLib.new_DepositRateHelper(*args)) >> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> TypeError: Wrong number or type of arguments for overloaded function >> 'new_DepositRateHelper'. >> >> Possible C/C++ prototypes are: >> >> DepositRateHelper::DepositRateHelper(Handle< Quote > const >> &,Period const &,Natural,Calendar const >> &,BusinessDayConvention,bool,DayCounter const &) >> >> DepositRateHelper::DepositRateHelper(Rate,Period const >> &,Natural,Calendar const &,BusinessDayConvention,bool,DayCounter const >> &) >> >> DepositRateHelper::DepositRateHelper(Handle< Quote > const >> &,ext::shared_ptr< IborIndex > const &) >> >> DepositRateHelper::DepositRateHelper(Rate,ext::shared_ptr< >> IborIndex > const &) >> >> Could you please to resolve above error? >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Trent M. <tr...@ma...> - 2023-10-19 01:51:48
|
Check the python docs here: https://quantlib-python-docs.readthedocs.io/en/latest/thelpers.html#depositratehelper Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Wed, Oct 18, 2023 at 17:15, Christofer Bogaso <[bog...@gm...](mailto:On Wed, Oct 18, 2023 at 17:15, Christofer Bogaso <<a href=)> wrote: > Hi, > > I have below code > > import QuantLib as ql > import pandas as pd > > DepoQuotes = pd.DataFrame({'Quote' : [ql.SimpleQuote(0.0004)], > 'Settlement_D' : [0]}) > > ql.DepositRateHelper(ql.QuoteHandle(DepoQuotes.loc[0, 'Quote']), > ql.Period(1,ql.Days), DepoQuotes.loc[0, 'Settlement_D'], ql.TARGET(), > ql.Following, False, ql.Actual360()) > > Above code generates below error > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > line 26529, in __init__ > > _QuantLib.DepositRateHelper_swiginit(self, > _QuantLib.new_DepositRateHelper(*args)) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > TypeError: Wrong number or type of arguments for overloaded function > 'new_DepositRateHelper'. > > Possible C/C++ prototypes are: > > DepositRateHelper::DepositRateHelper(Handle< Quote > const > &,Period const &,Natural,Calendar const > &,BusinessDayConvention,bool,DayCounter const &) > > DepositRateHelper::DepositRateHelper(Rate,Period const > &,Natural,Calendar const &,BusinessDayConvention,bool,DayCounter const > &) > > DepositRateHelper::DepositRateHelper(Handle< Quote > const > &,ext::shared_ptr< IborIndex > const &) > > DepositRateHelper::DepositRateHelper(Rate,ext::shared_ptr< > IborIndex > const &) > > Could you please to resolve above error? > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Christofer B. <bog...@gm...> - 2023-10-18 22:16:10
|
Hi,
I have below code
import QuantLib as ql
import pandas as pd
DepoQuotes = pd.DataFrame({'Quote' : [ql.SimpleQuote(0.0004)],
'Settlement_D' : [0]})
ql.DepositRateHelper(ql.QuoteHandle(DepoQuotes.loc[0, 'Quote']),
ql.Period(1,ql.Days), DepoQuotes.loc[0, 'Settlement_D'], ql.TARGET(),
ql.Following, False, ql.Actual360())
Above code generates below error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
line 26529, in __init__
_QuantLib.DepositRateHelper_swiginit(self,
_QuantLib.new_DepositRateHelper(*args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wrong number or type of arguments for overloaded function
'new_DepositRateHelper'.
Possible C/C++ prototypes are:
DepositRateHelper::DepositRateHelper(Handle< Quote > const
&,Period const &,Natural,Calendar const
&,BusinessDayConvention,bool,DayCounter const &)
DepositRateHelper::DepositRateHelper(Rate,Period const
&,Natural,Calendar const &,BusinessDayConvention,bool,DayCounter const
&)
DepositRateHelper::DepositRateHelper(Handle< Quote > const
&,ext::shared_ptr< IborIndex > const &)
DepositRateHelper::DepositRateHelper(Rate,ext::shared_ptr<
IborIndex > const &)
Could you please to resolve above error?
|
|
From: Luigi B. <lui...@gm...> - 2023-10-17 13:11:52
|
There are a couple of examples in the test suite; see e.g. < https://github.com/lballabio/QuantLib/blob/v1.31.1/test-suite/piecewiseyieldcurve.cpp#L1218 >. I honestly don't know why the compiler sees the curve as an incomplete type if you don't instantiate it first; some C++ lawyers might help. However, you can work around this in the same way that the example does. Once you have a typedef for your curve, such as `this_curve` in your code, `this_curve::bootstrap_type` gives you a way to create the bootstrap object and pass it to the constructor at the same time. Hope this helps, Luigi On Tue, Oct 17, 2023 at 2:19 PM <fre...@sw...> wrote: > If I understand correctly, accuracy parameter moved some time ago from > initialization of curve to bootstrap. However, I am struggling a bit how to > specify it since the curve depends on bootstrap, which depends on curve… > > > > Here is a minimal example: > > void test() > > { > > auto eonia = ext::make_shared<Eonia>(); > > auto referenceDate = Date(17, Oct, 2023); > > auto tenor = 1 * Months; > > auto simple_quote = ext::make_shared<SimpleQuote>(0.01); > > auto quote = Handle<Quote>(simple_quote); > > auto instrument = ext::make_shared<OISRateHelper>(2, tenor, quote, > eonia); > > std::vector<ext::shared_ptr<RateHelper>> instruments = { instrument }; > > > > typedef PiecewiseYieldCurve<Discount, Cubic, IterativeBootstrap> > this_curve; > > > > // Here I initilize the PiecewiseYieldCurve without specifying > bootstrap. This works > > //auto termstructure1 = this_curve(referenceDate, instruments, > Actual365Fixed()); > > > > > > // First we make a bootstrap object with a PieceWiseYieldCurve as > template parameter > > // We pass the IterativeBootstrap object to the PieceWiseYieldCurce > constructor > > Real accuracy = 0.0001; > > auto myIterativeBootstrap = IterativeBootstrap<this_curve>(accuracy); > > auto termstructure3 = this_curve(referenceDate, instruments, > Actual365Fixed(), myIterativeBootstrap); > > > > return; > > } > > > > However, this does not work but give me an error (at least using Clang on > Visual Studio). > > > > field has incomplete type > 'IterativeBootstrap<QuantLib::PiecewiseYieldCurve<QuantLib::Discount, > QuantLib::Cubic, QuantLib::IterativeBootstrap>::this_curve>' (aka > 'IterativeBootstrap<PiecewiseYieldCurve<QuantLib::Discount, > QuantLib::Cubic, QuantLib::IterativeBootstrap>>') > > > > Oddly enough, If I uncomment the definition of termstructure1, it compiles. > > > > I can make an even more minimal example: > > // minimal example for clang/gcc incomplete class error: > > void test2() > > { > > Real accuracy = 0.0001; > > auto bootstrap_ex = IterativeBootstrap<PiecewiseYieldCurve<Discount, > LogLinear>>(accuracy); > > } > > > > I strongly suspect I have misunderstood something here. How are you > supposed to set the accuracy parameter for a curve? > > > > BR > > //Fredrik > > > > > > > > > > > > *From:* Marcin Rybacki <mry...@gm...> > *Sent:* den 7 september 2023 17:56 > *To:* Jonathan George <Jon...@ni...> > *Cc:* qua...@li... > *Subject:* Re: [Quantlib-users] Bootstrapped Yield Curve extrapolation > help > > > > *External email. *Do not click on links or attachments unless you > recognize the sender. > > Hi Jonathan, > > > > I think that, at the moment, the library only offers flat forward > extrapolation. > > However, you could use the following workaround: > > > > 1) Build the curve, based on the original input rates, using linear > log-discount interpolation without enabling the extrapolation > > 2) Retrieve the nodes of the curve, which I assume will be (in Python) a > list of tuples with dates and discount factors > > 2) From this curve calculate a zero rate for the last node: last_zero_rate > = crv.zeroRate(crv.maxTime(), ql.Continuous).rate() > 3) Calculate a discount factor for the very last QuantLib date: max_dt = > ql.Date.maxDate() By taking the exponent of the year fraction from the > reference date to max date, times last zero rate and times -1. And append > the nodes with this last tuple (date and discount factor) > > 4) Reconstruct the curve using ql.DiscountCurve(dates, discounts, > day_counter) and enable extrapolation. > > > > I think this should give the outcome you're looking for. > > > > Please note that the above approach will only work for linear schemes. > Applying it with e.g. cubic splines will lead to a different solution of > the tridiagonal system, and the resulting curves will be slightly different. > > Another downside is that bumping quote handles to obtain sensitivities > will yield incorrect outcomes in the extrapolation region - so instead you > would have to rebuild the curve to get the deltas. > > > > Hope this helps. > > > > Kind regards, > > Marcin > > > > On Thu, 24 Aug 2023 at 15:32, Jonathan George < > Jon...@ni...> wrote: > > Hi All, > > > > I am hoping that I might be able to get some help from this forum. > > > > Context: > > I am trying to bootstrap a yield curve using piecewise flat forward > interpolation between market obtained rates. Here is my output: > > > > > > I am using python and my curve construction is quite straight forward with > extrapolation enabled(I understand I am committing the cardinal sin by not > posting my code, but hoping that this is theoretical enough a question for > a straight forward answer) > > > > Question: > > Is it possible to fix the final zero rate post maturity of the last bond? > It seems that enableExtrapolation is fixing the final forward rate making > the zero rate decay over time. I am trying to avoid creating a custom > function to return zero and forward rates post maturity of the final bond. > > I have tried create two curves (a linear flat forward curve and a regular > flat forward curve) and combining using CompositeZeroYieldStructure however > I’m not sure which binary function to pass into the function. > > > > Any help would be appreciated. > > Regards > > *Jonathan George* > > *Quantitative Developer* > > > > T: > > +27 21 901 1363 <+27%2021%20901%201363> > > > > > > 36 Hans Strijdom Avenue > Foreshore, Cape Town, 8001 > > www.ninetyone.com | <http://ninetyone.com/> > > <https://www.linkedin.com/company/ninetyone/> > > Follow us <https://www.linkedin.com/company/ninetyone> > > <https://ninetyone.com/> > > > > _______________________________________________ > 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 > |
|
From: <fre...@sw...> - 2023-10-17 12:16:12
|
If I understand correctly, accuracy parameter moved some time ago from initialization of curve to bootstrap. However, I am struggling a bit how to specify it since the curve depends on bootstrap, which depends on curve…
Here is a minimal example:
void test()
{
auto eonia = ext::make_shared<Eonia>();
auto referenceDate = Date(17, Oct, 2023);
auto tenor = 1 * Months;
auto simple_quote = ext::make_shared<SimpleQuote>(0.01);
auto quote = Handle<Quote>(simple_quote);
auto instrument = ext::make_shared<OISRateHelper>(2, tenor, quote, eonia);
std::vector<ext::shared_ptr<RateHelper>> instruments = { instrument };
typedef PiecewiseYieldCurve<Discount, Cubic, IterativeBootstrap> this_curve;
// Here I initilize the PiecewiseYieldCurve without specifying bootstrap. This works
//auto termstructure1 = this_curve(referenceDate, instruments, Actual365Fixed());
// First we make a bootstrap object with a PieceWiseYieldCurve as template parameter
// We pass the IterativeBootstrap object to the PieceWiseYieldCurce constructor
Real accuracy = 0.0001;
auto myIterativeBootstrap = IterativeBootstrap<this_curve>(accuracy);
auto termstructure3 = this_curve(referenceDate, instruments, Actual365Fixed(), myIterativeBootstrap);
return;
}
However, this does not work but give me an error (at least using Clang on Visual Studio).
field has incomplete type 'IterativeBootstrap<QuantLib::PiecewiseYieldCurve<QuantLib::Discount, QuantLib::Cubic, QuantLib::IterativeBootstrap>::this_curve>' (aka 'IterativeBootstrap<PiecewiseYieldCurve<QuantLib::Discount, QuantLib::Cubic, QuantLib::IterativeBootstrap>>')
Oddly enough, If I uncomment the definition of termstructure1, it compiles.
I can make an even more minimal example:
// minimal example for clang/gcc incomplete class error:
void test2()
{
Real accuracy = 0.0001;
auto bootstrap_ex = IterativeBootstrap<PiecewiseYieldCurve<Discount, LogLinear>>(accuracy);
}
I strongly suspect I have misunderstood something here. How are you supposed to set the accuracy parameter for a curve?
BR
//Fredrik
From: Marcin Rybacki <mry...@gm...>
Sent: den 7 september 2023 17:56
To: Jonathan George <Jon...@ni...>
Cc: qua...@li...
Subject: Re: [Quantlib-users] Bootstrapped Yield Curve extrapolation help
External email. Do not click on links or attachments unless you recognize the sender.
Hi Jonathan,
I think that, at the moment, the library only offers flat forward extrapolation.
However, you could use the following workaround:
1) Build the curve, based on the original input rates, using linear log-discount interpolation without enabling the extrapolation
2) Retrieve the nodes of the curve, which I assume will be (in Python) a list of tuples with dates and discount factors
2) From this curve calculate a zero rate for the last node: last_zero_rate = crv.zeroRate(crv.maxTime(), ql.Continuous).rate()
3) Calculate a discount factor for the very last QuantLib date: max_dt = ql.Date.maxDate() By taking the exponent of the year fraction from the reference date to max date, times last zero rate and times -1. And append the nodes with this last tuple (date and discount factor)
4) Reconstruct the curve using ql.DiscountCurve(dates, discounts, day_counter) and enable extrapolation.
I think this should give the outcome you're looking for.
Please note that the above approach will only work for linear schemes. Applying it with e.g. cubic splines will lead to a different solution of the tridiagonal system, and the resulting curves will be slightly different.
Another downside is that bumping quote handles to obtain sensitivities will yield incorrect outcomes in the extrapolation region - so instead you would have to rebuild the curve to get the deltas.
Hope this helps.
Kind regards,
Marcin
On Thu, 24 Aug 2023 at 15:32, Jonathan George <Jon...@ni...<mailto:Jon...@ni...>> wrote:
Hi All,
I am hoping that I might be able to get some help from this forum.
Context:
I am trying to bootstrap a yield curve using piecewise flat forward interpolation between market obtained rates. Here is my output:
I am using python and my curve construction is quite straight forward with extrapolation enabled(I understand I am committing the cardinal sin by not posting my code, but hoping that this is theoretical enough a question for a straight forward answer)
Question:
Is it possible to fix the final zero rate post maturity of the last bond? It seems that enableExtrapolation is fixing the final forward rate making the zero rate decay over time. I am trying to avoid creating a custom function to return zero and forward rates post maturity of the final bond.
I have tried create two curves (a linear flat forward curve and a regular flat forward curve) and combining using CompositeZeroYieldStructure however I’m not sure which binary function to pass into the function.
Any help would be appreciated.
Regards
Jonathan George
Quantitative Developer
T:
+27 21 901 1363<tel:+27%2021%20901%201363>
36 Hans Strijdom Avenue
Foreshore, Cape Town, 8001
www.ninetyone.com |<http://ninetyone.com/>
<https://www.linkedin.com/company/ninetyone/>
Follow us<https://www.linkedin.com/company/ninetyone>
<https://ninetyone.com/>
_______________________________________________
QuantLib-users mailing list
Qua...@li...<mailto:Qua...@li...>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: Luigi B. <lui...@gm...> - 2023-10-11 13:51:32
|
To get started, a simpler version is also in the examples: https://github.com/lballabio/QuantLib/blob/master/Examples/MulticurveBootstrapping/MulticurveBootstrapping.cpp Luigi On Fri, Sep 29, 2023 at 6:57 PM Mike DelMedico <mik...@gm...> wrote: > Hi there, > > I started here to get familiar with everything in the library: > > https://leanpub.com/quantlibpythoncookbook/ > > Note that if you want to make the stairstepped front end of the curve you > will have to do some tricks with zero coupon rate helpers, but it’s not > crazy complicated once you get the ball rolling. There might be a more > efficient way to do it but that would be best answered by someone else that > knows the library better. > > Another helpful source for the front end would be this: > > > https://www.cmegroup.com/market-data/files/cme-term-sofr-reference-rates-benchmark-methodology.pdf > > Hope that helps. > > -Mike > > > > On Fri, Sep 29, 2023 at 11:35 Brian Smith <bri...@gm...> > wrote: > >> Hi, >> >> Appreciate, if someone can provide some insight on below request. >> >> Thanks and regards, >> >> On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> >> wrote: >> > >> > Hi, >> > >> > I am looking for some work-out examples on construction of SOFT curve >> > given various market instruments (mostly OIS) either with Python or >> > C++ >> > >> > Could you please point some useful sources on construction of SOFR >> > curve using QL? >> > >> > Many thanks for your time. >> >> >> _______________________________________________ >> 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 > |
|
From: Luigi B. <lui...@gm...> - 2023-10-11 13:20:43
|
Hi Steve,
the fixing rate is not used per se—none of the coupons uses it as a
stored fixing—but as Marcin says, its presence causes the bootstrapped
forecasting curve to be slightly different, and therefore the future
fixings calculated off that curve will be different.
I wouldn't make two instances of the index, though. If the fixing was
available at the time the swap rates were quoted, it should be included for
consistency since it was taken into account; and for instrument valuation,
you'll also need the fixing in case one of your instruments requires it.
Hope this helps,
Luigi
On Wed, Sep 13, 2023 at 12:10 PM Steve Hsieh <war...@gm...>
wrote:
> Hi Marcin
> Thanks for the reply. It does provide valuable information. According to
> your previous discussion, it looks like I have to make two independent
> instance of index. One is for build term structure, and the other one is
> for instrument valuation. However, I still have confusion on the valuation
> part. When calling NPV in my example, the fixing rate on valuation date
> should not be used, since it’s not the applicable fixing date for the
> relevant cash flows. I will try to look deeper into this by review the
> source code. Many Thanks for the help.
>
> Best,
> Steve
>
>
> On Wed, Sep 13, 2023 at 5:17 PM Marcin Rybacki <mry...@gm...>
> wrote:
>
>> Hi Steve,
>>
>> That fixing that you are passing on 2019/11/12 (also the evaluation date)
>> is actually quite important, because it is being set on the swap
>> instruments you are using to bootstrap the curve. Hence, it will affect the
>> NPV of the swap, which might not necessarily need that particular fixing.
>>
>> See this related issue for more color:
>> https://github.com/lballabio/QuantLib/issues/1213
>>
>> Hope this helps.
>>
>> Kind regards,
>> Marcin
>>
>> On Wed, 13 Sept 2023 at 10:44, Steve Hsieh <war...@gm...>
>> wrote:
>>
>>> Dear all,
>>>
>>> I have a question regarding addfixing. I try to value a portfolio of
>>> interest rate swaps, I add all the existing and required fixing rate of my
>>> swaps to the index, however I get unexpected npv and dv01 for some trades.
>>> My original code is in C++, for conenience, I try to reproduce it in python
>>> as below. The story is that I add a fixing rate on 2019/11/12 which is
>>> actually unnecessary for this swap. and it change the NPV of this swap. I
>>> think the pricer will automatically choose pastfixing or forecasting by
>>> swap’s fixing dates. Since it’s not the required fixing rate, adding such a
>>> rate should have no impact to the NPV.
>>> Do I miss anything or I make any mistake?
>>> Need your advice and help.
>>> Many Thanks.
>>>
>>> Best,
>>> Steve
>>>
>>>
>>>
>>> from IPython.display import display
>>>
>>> import QuantLib as ql
>>>
>>> import pandas as pd
>>>
>>>
>>>
>>> ql.Settings.instance().evaluationDate= ql.Date(12, 11, 2019)
>>>
>>> refDate=ql.Settings.instance().evaluationDate
>>>
>>> cashFlowCdr = ql.JointCalendar(ql.UnitedStates(ql.UnitedStates.Settlement),
>>> ql.UnitedStates(ql.UnitedStates.LiborImpact))
>>>
>>> yts = ql.RelinkableYieldTermStructureHandle()
>>>
>>>
>>>
>>> instruments = [
>>>
>>> ('depo', '3M', 0.020),
>>>
>>> ('swap', '1Y', 0.031),
>>>
>>> ('swap', '2Y', 0.032),
>>>
>>> ('swap', '5Y', 0.035)
>>>
>>> ]
>>>
>>>
>>>
>>> helpers = ql.RateHelperVector()
>>>
>>> index = ql.USDLibor(ql.Period('3M'),yts)
>>>
>>> for instrument, tenor, rate in instruments:
>>>
>>> if instrument == 'depo':
>>>
>>> helpers.append( ql.DepositRateHelper(rate, index) )
>>>
>>> if instrument == 'fra':
>>>
>>> monthsToStart = ql.Period(tenor).length()
>>>
>>> helpers.append( ql.FraRateHelper(rate, monthsToStart, index) )
>>>
>>> if instrument == 'swap':
>>>
>>> swapIndex = ql.UsdLiborSwapIsdaFixAm(ql.Period(tenor))
>>>
>>> helpers.append( ql.SwapRateHelper(rate, swapIndex))
>>>
>>> curve = ql.PiecewiseLogCubicDiscount(0, cashFlowCdr, helpers, ql.
>>> ActualActual())
>>>
>>>
>>>
>>> yts.linkTo(curve)
>>>
>>> engine = ql.DiscountingSwapEngine(yts)
>>>
>>> calendar = ql.TARGET()
>>>
>>> start = ql.Date(11,9,2019)
>>>
>>> maturity = calendar.advance(start, ql.Period('4y'))
>>>
>>> fixedSchedule = ql.MakeSchedule(start, maturity, ql.Period('3M'))
>>>
>>> floatSchedule = ql.MakeSchedule(start, maturity, ql.Period('3M'))
>>>
>>>
>>>
>>> index.addFixing( ql.Date(9, 9, 2019), 0.020)
>>>
>>> index.addFixing( ql.Date(12, 11, 2019), 0.030)
>>>
>>>
>>>
>>> swap = ql.VanillaSwap(
>>>
>>> ql.VanillaSwap.Payer, 1000000,
>>>
>>> fixedSchedule, 0.01, ql.Thirty360(),
>>>
>>> floatSchedule, index, 0, ql.Actual360()
>>>
>>> )
>>>
>>> swap.setPricingEngine(engine)
>>>
>>> npv=swap.NPV()
>>>
>>> print(npv)
>>>
>> _______________________________________________
>>> 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
>
|
|
From: Luigi B. <lui...@gm...> - 2023-10-06 18:03:24
|
Sure—I'll reply privately to minimise noise on the list. Luigi On Fri, Oct 6, 2023 at 7:55 PM Tom Anderson <tw...@ur...> wrote: > I can try. It will be easiest if i build from source myself, but if you > would like to suggest a few commits between 1.31 and 1.32, i can try those > rather than picking randomly. Sadly, the process is too manual to simply > do a git bisect. > > tom > > On Fri, 6 Oct 2023, Luigi Ballabio wrote: > > > Hmm. Thanks for reporting this—would you mind trying to see when the > > performance got worse? I can send you a few tarballs from different > points > > between 1.31.1 and now. > > > > Luigi > > > > > > On Fri, Oct 6, 2023 at 7:09 PM Tom Anderson <tw...@ur...> > wrote: > > > >> Hi Luigi, > >> > >> On Wed, 4 Oct 2023, Luigi Ballabio wrote: > >> > >>> Hello everybody, > >>> I just published sources for a release candidate for 1.32 at < > >>> https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you > have > >>> some time, please try them out this week or the next and report any > >>> problems here. Thanks! > >> > >> I tried it. It builds, my app builds (after a few changes needed due to > >> the introduction of the FixedVsFloatingSwap), and then produces the same > >> results as with 1.31. > >> > >> However, it seems to be much slower in some places. I haven't dug into > why > >> yet. But for example, the job which builds an ESTR curve and prices a > load > >> of swaps off it went from 92 ms to 328 ms, and the job which does the > same > >> for Euribor went from 210 ms to 631 ms. Pricing our swap inventory went > >> from 85 ms to 257 ms, and calculating risk metrics went from 15,270 ms > to > >> 50,037 ms. This is all based on a single run with each version, so i > have > >> no error bars on these numbers, but the random variance is much smaller > >> than these differences. > >> > >> The inventory and risk jobs do not build curves, but use the curves > built > >> by the previous jobs, so this looks like it could be a big slowdown in > >> pricing swaps. > >> > >> I built QuantLib with GCC 7.2.0, and my app with GCC 13.1.0. I am > building > >> QuantLib with GCC 7 because when i last tried to built it with GCC 13, > it > >> was much slower! > >> > >> Regards, > >> tom > >> > >> > >> -- > >> Subvert normality. > >> > > > > -- > Subvert normality. |
|
From: Tom A. <tw...@ur...> - 2023-10-06 17:56:11
|
I can try. It will be easiest if i build from source myself, but if you would like to suggest a few commits between 1.31 and 1.32, i can try those rather than picking randomly. Sadly, the process is too manual to simply do a git bisect. tom On Fri, 6 Oct 2023, Luigi Ballabio wrote: > Hmm. Thanks for reporting this—would you mind trying to see when the > performance got worse? I can send you a few tarballs from different points > between 1.31.1 and now. > > Luigi > > > On Fri, Oct 6, 2023 at 7:09 PM Tom Anderson <tw...@ur...> wrote: > >> Hi Luigi, >> >> On Wed, 4 Oct 2023, Luigi Ballabio wrote: >> >>> Hello everybody, >>> I just published sources for a release candidate for 1.32 at < >>> https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you have >>> some time, please try them out this week or the next and report any >>> problems here. Thanks! >> >> I tried it. It builds, my app builds (after a few changes needed due to >> the introduction of the FixedVsFloatingSwap), and then produces the same >> results as with 1.31. >> >> However, it seems to be much slower in some places. I haven't dug into why >> yet. But for example, the job which builds an ESTR curve and prices a load >> of swaps off it went from 92 ms to 328 ms, and the job which does the same >> for Euribor went from 210 ms to 631 ms. Pricing our swap inventory went >> from 85 ms to 257 ms, and calculating risk metrics went from 15,270 ms to >> 50,037 ms. This is all based on a single run with each version, so i have >> no error bars on these numbers, but the random variance is much smaller >> than these differences. >> >> The inventory and risk jobs do not build curves, but use the curves built >> by the previous jobs, so this looks like it could be a big slowdown in >> pricing swaps. >> >> I built QuantLib with GCC 7.2.0, and my app with GCC 13.1.0. I am building >> QuantLib with GCC 7 because when i last tried to built it with GCC 13, it >> was much slower! >> >> Regards, >> tom >> >> >> -- >> Subvert normality. >> > -- Subvert normality. |
|
From: Tom A. <tw...@ur...> - 2023-10-06 17:49:58
|
Hi Luigi, On Wed, 4 Oct 2023, Luigi Ballabio wrote: > Hello everybody, > I just published sources for a release candidate for 1.32 at < > https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you have > some time, please try them out this week or the next and report any > problems here. Thanks! I tried it. It builds, my app builds (after a few changes needed due to the introduction of the FixedVsFloatingSwap), and then produces the same results as with 1.31. However, it seems to be much slower in some places. I haven't dug into why yet. But for example, the job which builds an ESTR curve and prices a load of swaps off it went from 92 ms to 328 ms, and the job which does the same for Euribor went from 210 ms to 631 ms. Pricing our swap inventory went from 85 ms to 257 ms, and calculating risk metrics went from 15,270 ms to 50,037 ms. This is all based on a single run with each version, so i have no error bars on these numbers, but the random variance is much smaller than these differences. The inventory and risk jobs do not build curves, but use the curves built by the previous jobs, so this looks like it could be a big slowdown in pricing swaps. I built QuantLib with GCC 7.2.0, and my app with GCC 13.1.0. I am building QuantLib with GCC 7 because when i last tried to built it with GCC 13, it was much slower! Regards, tom -- Subvert normality. |
|
From: Luigi B. <lui...@gm...> - 2023-10-06 17:30:03
|
Also, if you can share some of the code that shows the slowdown (or something similar like "bootstrap n curves, price m swaps") I can try adding that to the CI builds to check that a change doesn't degrade performance too much, at least for those tasks. On Fri, Oct 6, 2023 at 7:23 PM Luigi Ballabio <lui...@gm...> wrote: > Hmm. Thanks for reporting this—would you mind trying to see when the > performance got worse? I can send you a few tarballs from different points > between 1.31.1 and now. > > Luigi > > > On Fri, Oct 6, 2023 at 7:09 PM Tom Anderson <tw...@ur...> wrote: > >> Hi Luigi, >> >> On Wed, 4 Oct 2023, Luigi Ballabio wrote: >> >> > Hello everybody, >> > I just published sources for a release candidate for 1.32 at < >> > https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you >> have >> > some time, please try them out this week or the next and report any >> > problems here. Thanks! >> >> I tried it. It builds, my app builds (after a few changes needed due to >> the introduction of the FixedVsFloatingSwap), and then produces the same >> results as with 1.31. >> >> However, it seems to be much slower in some places. I haven't dug into >> why >> yet. But for example, the job which builds an ESTR curve and prices a >> load >> of swaps off it went from 92 ms to 328 ms, and the job which does the >> same >> for Euribor went from 210 ms to 631 ms. Pricing our swap inventory went >> from 85 ms to 257 ms, and calculating risk metrics went from 15,270 ms to >> 50,037 ms. This is all based on a single run with each version, so i have >> no error bars on these numbers, but the random variance is much smaller >> than these differences. >> >> The inventory and risk jobs do not build curves, but use the curves built >> by the previous jobs, so this looks like it could be a big slowdown in >> pricing swaps. >> >> I built QuantLib with GCC 7.2.0, and my app with GCC 13.1.0. I am >> building >> QuantLib with GCC 7 because when i last tried to built it with GCC 13, it >> was much slower! >> >> Regards, >> tom >> >> >> -- >> Subvert normality. >> > |
|
From: Luigi B. <lui...@gm...> - 2023-10-06 17:24:11
|
Hmm. Thanks for reporting this—would you mind trying to see when the performance got worse? I can send you a few tarballs from different points between 1.31.1 and now. Luigi On Fri, Oct 6, 2023 at 7:09 PM Tom Anderson <tw...@ur...> wrote: > Hi Luigi, > > On Wed, 4 Oct 2023, Luigi Ballabio wrote: > > > Hello everybody, > > I just published sources for a release candidate for 1.32 at < > > https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you have > > some time, please try them out this week or the next and report any > > problems here. Thanks! > > I tried it. It builds, my app builds (after a few changes needed due to > the introduction of the FixedVsFloatingSwap), and then produces the same > results as with 1.31. > > However, it seems to be much slower in some places. I haven't dug into why > yet. But for example, the job which builds an ESTR curve and prices a load > of swaps off it went from 92 ms to 328 ms, and the job which does the same > for Euribor went from 210 ms to 631 ms. Pricing our swap inventory went > from 85 ms to 257 ms, and calculating risk metrics went from 15,270 ms to > 50,037 ms. This is all based on a single run with each version, so i have > no error bars on these numbers, but the random variance is much smaller > than these differences. > > The inventory and risk jobs do not build curves, but use the curves built > by the previous jobs, so this looks like it could be a big slowdown in > pricing swaps. > > I built QuantLib with GCC 7.2.0, and my app with GCC 13.1.0. I am building > QuantLib with GCC 7 because when i last tried to built it with GCC 13, it > was much slower! > > Regards, > tom > > > -- > Subvert normality. > |
|
From: Luigi B. <lui...@gm...> - 2023-10-04 15:35:19
|
Prerelease Python wheels for most platforms are also available by running
pip install -i https://test.pypi.org/simple/ QuantLib==1.32rc0
On Wed, Oct 4, 2023 at 2:57 PM Luigi Ballabio <lui...@gm...>
wrote:
> Hello everybody,
> I just published sources for a release candidate for 1.32 at <
> https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you have
> some time, please try them out this week or the next and report any
> problems here. Thanks!
>
> Luigi
>
>
|
|
From: Luigi B. <lui...@gm...> - 2023-10-04 12:57:59
|
Hello everybody,
I just published sources for a release candidate for 1.32 at <
https://github.com/lballabio/QuantLib/releases/tag/1.32rc>. If you have
some time, please try them out this week or the next and report any
problems here. Thanks!
Luigi
|
|
From: Trent M. <tr...@ma...> - 2023-10-03 21:24:54
|
Python below for Camara. You'll need blp, blpapi, and QuantLib installed in your environment and the Bloomberg terminal running (otherwise skip the blp parts and put your quotes in the _data dictionary.
import
QuantLib
as
ql
from
blp
import
blp
class
Quotes
:
_data: dict[str, ql.SimpleQuote] = {} # put quotes here if you don't have BBG. e.g. {"
CHSWPA Curncy": ql.SimpleQuote(9.3), ...}
def
get
(self, ticker: str)
->
ql
.
SimpleQuote
:
if
ticker
not
in
self._data:
self._data[ticker] = ql.SimpleQuote(
0.0
)
return
self._data[ticker]
def
set
(self, ticker: str, value: float)
->
None
:
self.get(ticker).setValue(value)
def
update
(self)
->
None
:
with
blp.BlpQuery(host=
"localhost"
)
as
bq:
data = bq.bdp(list(self._data.keys()), [
"px_last"
])
for
_, row
in
data.iterrows():
ticker = row[
"security"
]
px_last = row[
"px_last"
]
self.set(ticker, px_last)
def
main
()
:
quotes = Quotes()
calendar = ql.Chile()
accr_handle = ql.RelinkableYieldTermStructureHandle()
disc_handle = ql.RelinkableYieldTermStructureHandle()
tickers = [
(
"1M"
,
"CHSWPA Curncy"
),
(
"2M"
,
"CHSWPB Curncy"
),
(
"3M"
,
"CHSWPC Curncy"
),
(
"6M"
,
"CHSWPF Curncy"
),
(
"9M"
,
"CHSWPI Curncy"
),
(
"1Y"
,
"CHSWP1 Curncy"
),
(
"18M"
,
"CHSWP1F Curncy"
),
(
"2Y"
,
"CHSWP2 Curncy"
),
(
"3Y"
,
"CHSWP3 Curncy"
),
(
"4Y"
,
"CHSWP4 Curncy"
),
(
"5Y"
,
"CHSWP5 Curncy"
),
(
"6Y"
,
"CHSWP6 Curncy"
),
(
"7Y"
,
"CHSWP7 Curncy"
),
(
"8Y"
,
"CHSWP8 Curncy"
),
(
"9Y"
,
"CHSWP9 Curncy"
),
(
"10Y"
,
"CHSWP10 Curncy"
),
(
"12Y"
,
"CHSWP12 Curncy"
),
(
"15Y"
,
"CHSWP15 Curncy"
),
(
"20Y"
,
"CHSWP20 Curncy"
),
]
index = ql.OvernightIndex(
"CLP Camara"
,
0
, ql.CLPCurrency(), calendar, ql.Actual360(), accr_handle)
helpers = [
ql.OISRateHelper(
2
,
ql.Period(tenor),
ql.QuoteHandle(ql.DerivedQuote(ql.QuoteHandle(quotes.get(ticker)),
lambda
x: x /
100
)),
index,
disc_handle,
False
,
0
,
ql.ModifiedFollowing,
ql.Semiannual
if
ql.Period(tenor) > ql.Period(
"18M"
)
else
ql.Once,
calendar,
)
for
tenor, ticker
in
tickers
]
curve = ql.PiecewiseLogCubicDiscount(
0
, calendar, helpers, ql.Actual360())
accr_handle.linkTo(curve)
disc_handle.linkTo(curve)
quotes.update()
for
date
in
curve.dates():
print(date.to_date(), curve.zeroRate(date, ql.Actual365Fixed(), ql.Continuous).rate())
if
__name__ ==
"__main__"
:
main()
------- Original Message -------
On Tuesday, October 3rd, 2023 at 12:32, Trent Maetzold <tr...@ma...> wrote:
> What Chile curve are you trying to build? Camara is built using only OISRateHelper (Semiannual after 18m, Once 18m and under). Pretty straightforward construction. Use PiecewiseLogCubicDiscount for the curve constructor.
>
> Sent from [Proton Mail](https://proton.me/mail/home) for iOS
>
> On Sun, Oct 1, 2023 at 18:14, Gabriel Campolina <[cam...@gm...](mailto:On Sun, Oct 1, 2023 at 18:14, Gabriel Campolina <<a href=)> wrote:
>
>> Hello.
>>
>> I'm trying to build a SwapRateHelper for a Swap of bullet 18M tenor, using the function "SwapRateHelper2" and when I use "FixedLegFrequency" of "Once" and "Annual", it gives me the same result of Zero Rate, and it's quite different from the correct zero rate. (I'm trying to build a yield curve using chilean IRS)
>>
>> Also, when I build a yield curve using an IborIndex built with a forward curve using the FlatForward function with "Simple" compounding, it gives me the same result as using "Continuous" and "Compounded" arguments.
>>
>> Is there something that might be missing in the functions, or am I getting something wrong?
>>
>> Thanks in advance, I would really appreciate your help !
>> --
>>
>> Gabriel Assumpção Campolina |
|
From: Trent M. <tr...@ma...> - 2023-10-03 17:49:56
|
What Chile curve are you trying to build? Camara is built using only OISRateHelper (Semiannual after 18m, Once 18m and under). Pretty straightforward construction. Use PiecewiseLogCubicDiscount for the curve constructor. Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Sun, Oct 1, 2023 at 18:14, Gabriel Campolina <[cam...@gm...](mailto:On Sun, Oct 1, 2023 at 18:14, Gabriel Campolina <<a href=)> wrote: > Hello. > > I'm trying to build a SwapRateHelper for a Swap of bullet 18M tenor, using the function "SwapRateHelper2" and when I use "FixedLegFrequency" of "Once" and "Annual", it gives me the same result of Zero Rate, and it's quite different from the correct zero rate. (I'm trying to build a yield curve using chilean IRS) > > Also, when I build a yield curve using an IborIndex built with a forward curve using the FlatForward function with "Simple" compounding, it gives me the same result as using "Continuous" and "Compounded" arguments. > > Is there something that might be missing in the functions, or am I getting something wrong? > > Thanks in advance, I would really appreciate your help ! > -- > > Gabriel Assumpção Campolina |
|
From: Gabriel C. <cam...@gm...> - 2023-10-01 23:14:46
|
Hello. I'm trying to build a SwapRateHelper for a Swap of bullet 18M tenor, using the function "SwapRateHelper2" and when I use "FixedLegFrequency" of "Once" and "Annual", it gives me the same result of Zero Rate, and it's quite different from the correct zero rate. (I'm trying to build a yield curve using chilean IRS) Also, when I build a yield curve using an IborIndex built with a forward curve using the FlatForward function with "Simple" compounding, it gives me the same result as using "Continuous" and "Compounded" arguments. Is there something that might be missing in the functions, or am I getting something wrong? Thanks in advance, I would really appreciate your help ! -- Gabriel Assumpção Campolina |
|
From: Mike D. <mik...@gm...> - 2023-09-29 16:54:10
|
Hi there, I started here to get familiar with everything in the library: https://leanpub.com/quantlibpythoncookbook/ Note that if you want to make the stairstepped front end of the curve you will have to do some tricks with zero coupon rate helpers, but it’s not crazy complicated once you get the ball rolling. There might be a more efficient way to do it but that would be best answered by someone else that knows the library better. Another helpful source for the front end would be this: https://www.cmegroup.com/market-data/files/cme-term-sofr-reference-rates-benchmark-methodology.pdf Hope that helps. -Mike On Fri, Sep 29, 2023 at 11:35 Brian Smith <bri...@gm...> wrote: > Hi, > > Appreciate, if someone can provide some insight on below request. > > Thanks and regards, > > On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> > wrote: > > > > Hi, > > > > I am looking for some work-out examples on construction of SOFT curve > > given various market instruments (mostly OIS) either with Python or > > C++ > > > > Could you please point some useful sources on construction of SOFR > > curve using QL? > > > > Many thanks for your time. > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Brian S. <bri...@gm...> - 2023-09-29 16:32:27
|
Hi, Appreciate, if someone can provide some insight on below request. Thanks and regards, On Thu, 28 Sept 2023 at 01:51, Brian Smith <bri...@gm...> wrote: > > Hi, > > I am looking for some work-out examples on construction of SOFT curve > given various market instruments (mostly OIS) either with Python or > C++ > > Could you please point some useful sources on construction of SOFR > curve using QL? > > Many thanks for your time. |
|
From: Brian S. <bri...@gm...> - 2023-09-27 20:21:58
|
Hi, I am looking for some work-out examples on construction of SOFT curve given various market instruments (mostly OIS) either with Python or C++ Could you please point some useful sources on construction of SOFR curve using QL? Many thanks for your time. |
|
From: <Gre...@ca...> - 2023-09-27 14:39:48
|
Thank you Giuseppe and Aleksis!
This is indeed my problem. Switching to vol spread rather than absolute vol now produces expected vols and swaption pricing with my cube (at least for ATM swaptions) looks roughly correct.
From: Giuseppe Trapani <tr...@gm...>
Sent: Wednesday, September 27, 2023 7:28 AM
To: Gregory Zuroff (GQQZ) <Gre...@ca...>
Cc: Aleksis Ali Raza <ale...@go...>; QuantLib users <qua...@li...>
Subject: Re: [Quantlib-users] Quantlib-Python Swaption Volatility Cube
Hi Greg,
The fact that you are getting "double" of what is expected makes me think in the object otm_vol_spreads you don't have the spreads (that is, vol(ATM) - vol(Strike)) but you have the actual vols or at least you have them for the strike spread = 0. In that case indeed you would get exactly double the true ATM vol because you would be summing the ATM vol from the vol matrix with a "spread" that is not 0 but the ATM vol again.
In summary, check whether in otm_vol_spreads you have a column of Zeros for the strike spread = 0.
Il Mer 27 Set 2023, 16:10 Gre...@ca...<mailto:Gre...@ca...> <Gre...@ca...<mailto:Gre...@ca...>> ha scritto:
Hi Aleksis,
Thank you for confirming how the strike is determined for the vol cube, I was not positive if it should be relative to ATM or absolute. However, neither seem to produce the correct vol.
When I plug my forward rate into the vol cube to represent ATM, I still get a different number. I wasn’t positive if it should be in percent or decimal, so I am showing both here. Interestingly, the vol cube is roughly double what I am expecting. Are you able to advise if I am doing something else wrong with building my cube?
Thanks again,
Greg
From: Aleksis Ali Raza <ale...@go...<mailto:ale...@go...>>
Sent: Wednesday, September 27, 2023 1:12 AM
To: Gregory Zuroff (GQQZ) <Gre...@ca...<mailto:Gre...@ca...>>
Cc: qua...@li...<mailto:qua...@li...>
Subject: Re: [Quantlib-users] Quantlib-Python Swaption Volatility Cube
hi, you seem to be enquiring for a 0 strike 3m10y swaption volatility. the third (rate) parameter in the volatility attribute is absolute strike level, not spread to atm.
because the swaption vol matrix doesn’t include skew data while the volcube does, these would agree on ATM vols, but the cube would return a skew adjusted vol for an off-strike enquiry (as in your case) while the swaption matrix would just give the ATM vol in both cases.
On Sep 27, 2023, at 1:49 AM, Gre...@ca...<mailto:Gre...@ca...> wrote:
Hello,
I am hoping you can help me better understand how to create a swaption vol cube using normal vols.
I successfully create the ATM vol surface
swaption_vol_matrix = ql.SwaptionVolatilityMatrix(
calendar,
bdc,
option_tenors,
swap_tenors,
ql.Matrix(normal_atm_vols),
day_counter,
False,
ql.Normal
)
I am able to confirm that the vols are as expected
swaption_vol_matrix.volatility(today + ql.Period('3m'), ql.Period('10y'), 0)
This volatility function returns the same vol for 3m10y that I supplied.
I then format all of my swaption vols into a cube such that I have one row for each expiry X swap tenor combination and one column for each strike spread [-2.25, 2.25]
swaptions.query('cusip.str.startswith("SR")').pivot(index=['expiry', 'tenor'], columns='strike', values='vol')
I convert this dataframe to numpy such that I have a 2d numpy array of size (120, 19) which is (num expiries * num tenors, num strike spreads).
These are SOFR swaptions, so I create an OvernightIndexedSwapIndex.
base_index = ql.OvernightIndexedSwapIndex('SOFR', ql.Period('1d'), 2, ql.USDCurrency(), sofr_handle)
Finally, I try to actually create the vol cube
vol_cube = ql.SwaptionVolatilityStructureHandle(
ql.InterpolatedSwaptionVolatilityCube(
ql.SwaptionVolatilityStructureHandle(swaption_vol_matrix),
option_tenors,
swap_tenors,
strikes,
otm_vol_spreads,
base_index,
base_index,
False
)
)
However, when I check the same point on the cube that I confirmed on the ATM surface, the vol is wrong.
vol_cube.volatility(today + ql.Period('3m'), ql.Period('10y'), 0)
Could you please help me understand what I am doing wrong in creating my vol cube?
Thanks,
Greg
Gregory Zuroff, CFA
Fundamental Research Group
Direct: (310) 996-9413
Email: Gre...@ca...<mailto:Gre...@ca...>
11100 Santa Monica Blvd. Los Angeles, CA 90025
<image002.png>
Your privacy and security are important to us. See our privacy policy (Canada<https://www.capitalgroup.com/individual/ca/en/about/legal.html>, Europe & Asia<https://www.capitalgroup.com/content/sites/the-capital-group/entry-page/shared/privacy.html>, United States<https://www.capitalgroup.com/individual/privacy.html>).
_______________________________________________
QuantLib-users mailing list
Qua...@li...<mailto:Qua...@li...>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Your privacy and security are important to us. See our privacy policy (Canada<https://www.capitalgroup.com/individual/ca/en/about/legal.html>, Europe & Asia<https://www.capitalgroup.com/content/sites/the-capital-group/entry-page/shared/privacy.html>, United States<https://www.capitalgroup.com/individual/privacy.html>).
_______________________________________________
QuantLib-users mailing list
Qua...@li...<mailto:Qua...@li...>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Your privacy and security are important to us. See our privacy policy (Canada https://www.capitalgroup.com/individual/ca/en/about/legal.html, Europe & Asia https://www.capitalgroup.com/content/sites/the-capital-group/entry-page/shared/privacy.html, United States https://www.capitalgroup.com/individual/privacy.html).
|