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: Christofer B. <bog...@gm...> - 2023-10-25 21:40:01
|
Hi, I have a broad framework of an IRS contract which is as below. In this IRS, the cashflows from fixed and floating legs (assuming quarterly payment based on some LIBOR kind index) is derived in one currency. However swap's NPV will be based on some other currency, typically USD, and also discounting will be based on USD SOFR. Typically this type of contracts are termed as Non deliverable IRS. I am looking for a way how I can use Swap-bulder in QL to contract and calculate NPV of this contract? I am also not sure what the valuation formula is for this contract. So any book and/or online resources would be highly appreciated. Thanks, |
|
From: Jonathan S. <sw...@gm...> - 2023-10-25 21:39:56
|
The ${HOME} in your prefix looks out of place. Can you try removing it?
If that doesn’t fix it then I would try escaping the ampersands in the
directory name, or even better renaming the directory.
By the way, the warning message means you can safely remove —with-boost-lib
because it’s no longer required.
2023년 10월 26일 (목) 05:13, George Sebastine via QuantLib-users <
qua...@li...>님이 작성:
> Hi,
>
> I am following the instructions in
> https://www.quantlib.org/install/macosx.shtml to install QL in custom
> folder. So I tried following
>
> ./configure
> --with-boost-include='/Users/DDD/Library/CloudStorage/Dropbox/AAA &
> BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/include/' \
>
> --with-boost-lib='/Users/DDD/Library/CloudStorage/Dropbox/AAA
> & BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/lib/' \
>
> --prefix=${HOME}'/Users/DDD/Library/CloudStorage/Dropbox/AAA &
> BBB/Programs/QuantLib/QL_INSTALL' \
>
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
>
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9'
>
>
> However with this, I am getting below error
>
> configure: WARNING: unrecognized options: --with-boost-lib
>
> checking for a BSD-compatible install... /usr/bin/install -c
>
> checking whether build environment is sane... configure: error: unsafe
> absolute working directory name
>
>
> I am using iMac with MacOS version 13.6 (22G120)
>
>
> Could you please guide what went wrong and the correct approach to install
> QL in some custom folder.
>
>
> Thanks for your time.
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: George S. <geo...@ao...> - 2023-10-25 20:11:01
|
Hi, I am following the instructions in https://www.quantlib.org/install/macosx.shtml to install QL in custom folder. So I tried following ./configure --with-boost-include='/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/include/' \ --with-boost-lib='/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/lib/' \ --prefix=${HOME}'/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL' \ CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \ LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9' However with this, I am getting below error configure: WARNING: unrecognized options: --with-boost-lib checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... configure: error: unsafe absolute working directory name I am using iMac with MacOS version 13.6 (22G120) Could you please guide what went wrong and the correct approach to install QL in some custom folder. Thanks for your time. |
|
From: George S. <geo...@ao...> - 2023-10-25 20:00:02
|
Hi, I am following the instructions in https://www.quantlib.org/install/macosx.shtml to install QL in custom folder. So I tried following ./configure --with-boost-include='/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/include/' \ --with-boost-lib='/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL/BOOST/b2-4.10.1/lib/' \ --prefix=${HOME}'/Users/DDD/Library/CloudStorage/Dropbox/AAA & BBB/Programs/QuantLib/QL_INSTALL' \ CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \ LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9' However with this, I am getting below error configure: WARNING: unrecognized options: --with-boost-lib checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... configure: error: unsafe absolute working directory name I am using iMac with MacOS version 13.6 (22G120) Could you please guide what went wrong and the correct approach to install QL in some custom folder. Thanks for your time. |
|
From: Mike D. <mik...@gm...> - 2023-10-25 17:21:37
|
He has to override the original cashflow though after the swap is created though correct? I think he’s asking how to efficiently do that. I would be curious as well. Thanks, Mike On Wed, Oct 25, 2023 at 12:10 Giuseppe Trapani <tr...@gm...> wrote: > Hi Trent, > > > The fixing for the stub is left as a "pricing choice" since it's typically > a contractual feature. > > For the Front stub you can use the the actual fixing of your index, or you > can use a weighted one with a year-fraction based allocation (for example > if you have a 5 months stub on a Euribor6M indexed contract you can do 1/3 > of the Euribor3M + 2/3 of the Euribor6M). > > For the Back stub I know of no direct way for weighted fixings, I assume > you can do the same with with the forward rates from both curves and create > an extra cashflow with that. > > Il Mer 25 Ott 2023, 15:16 Trent Maetzold <tr...@ma...> ha scritto: > >> Seems I need a way to pass the fixing for the stub. I’m not seeing a way >> to do that directly. I’m using MakeVanillaSwap if it matters. Any help >> would be appreciated. >> >> Sent from Proton Mail <https://proton.me/mail/home> for iOS >> >> >> On Tue, Oct 24, 2023 at 10:04, Trent Maetzold <tr...@ma... >> <On+Tue,+Oct+24,+2023+at+10:04,+Trent+Maetzold+%3C%3Ca+href=>> wrote: >> >> Hi all, >> >> I've been looking at CZK and market practice for the Ibors there seems to >> be to switch to one of the shorter dated Ibor Indexes when there is a stub >> (believe they are actually just interpolated and put into a quote in >> Bloomberg). The QuantLib model is spot on at pricing swaps except when >> there is a stub, since QuantLib is using my 3m or 6m index interpolation >> for the stub. What is the recommended way of handling this? It seems that a >> brute force way would be to build all the various indexes and then write a >> index chooser function to pick which one to use to forecast the fixings, >> but I'm wondering if there's a more straightforward way. >> >> Thanks in advance, >> Trent Maetzold >> >> _______________________________________________ >> 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: Giuseppe T. <tr...@gm...> - 2023-10-25 17:07:40
|
Hi Trent, The fixing for the stub is left as a "pricing choice" since it's typically a contractual feature. For the Front stub you can use the the actual fixing of your index, or you can use a weighted one with a year-fraction based allocation (for example if you have a 5 months stub on a Euribor6M indexed contract you can do 1/3 of the Euribor3M + 2/3 of the Euribor6M). For the Back stub I know of no direct way for weighted fixings, I assume you can do the same with with the forward rates from both curves and create an extra cashflow with that. Il Mer 25 Ott 2023, 15:16 Trent Maetzold <tr...@ma...> ha scritto: > Seems I need a way to pass the fixing for the stub. I’m not seeing a way > to do that directly. I’m using MakeVanillaSwap if it matters. Any help > would be appreciated. > > Sent from Proton Mail <https://proton.me/mail/home> for iOS > > > On Tue, Oct 24, 2023 at 10:04, Trent Maetzold <tr...@ma... > <On+Tue,+Oct+24,+2023+at+10:04,+Trent+Maetzold+%3C%3Ca+href=>> wrote: > > Hi all, > > I've been looking at CZK and market practice for the Ibors there seems to > be to switch to one of the shorter dated Ibor Indexes when there is a stub > (believe they are actually just interpolated and put into a quote in > Bloomberg). The QuantLib model is spot on at pricing swaps except when > there is a stub, since QuantLib is using my 3m or 6m index interpolation > for the stub. What is the recommended way of handling this? It seems that a > brute force way would be to build all the various indexes and then write a > index chooser function to pick which one to use to forecast the fixings, > but I'm wondering if there's a more straightforward way. > > Thanks in advance, > Trent Maetzold > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: sanfranciscofogg <san...@gm...> - 2023-10-25 13:27:59
|
All,
After going through the FinGPT documentation, it occurred to me that
QuantLib equivalent output might result from a properly formatted query.
The code which might be output from such a query, was the specific
interest.
Are there any participants of FinGPT who might offer commentary?
Cordially,
S.F.Fogg
*★ San Francisco Fogg ★*
* Mercury Algorithmics*
* Fogg Spirits*
* ecurie Foggio*
|
|
From: Trent M. <tr...@ma...> - 2023-10-25 13:14:41
|
Seems I need a way to pass the fixing for the stub. I’m not seeing a way to do that directly. I’m using MakeVanillaSwap if it matters. Any help would be appreciated. Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Tue, Oct 24, 2023 at 10:04, Trent Maetzold <[tr...@ma...](mailto:On Tue, Oct 24, 2023 at 10:04, Trent Maetzold <<a href=)> wrote: > Hi all, > > I've been looking at CZK and market practice for the Ibors there seems to be to switch to one of the shorter dated Ibor Indexes when there is a stub (believe they are actually just interpolated and put into a quote in Bloomberg). The QuantLib model is spot on at pricing swaps except when there is a stub, since QuantLib is using my 3m or 6m index interpolation for the stub. What is the recommended way of handling this? It seems that a brute force way would be to build all the various indexes and then write a index chooser function to pick which one to use to forecast the fixings, but I'm wondering if there's a more straightforward way. > > Thanks in advance, > Trent Maetzold |
|
From: Aleksis A. R. <ale...@go...> - 2023-10-24 16:27:21
|
Thanks Luigi.
Done.
> On Oct 24, 2023, at 4:57 PM, Luigi Ballabio <lui...@gm...> wrote:
>
> Ok, I see. I was confused for a bit because adding your code above at the end of swap.py, fixedSchedule and floatingSchedule are forward starting, not spot; also fixedRate is not the rate used in the bootstrap.
>
> In any case, once I use the correct schedules and fixed rate, the problem can be seen even without compiling with indexed coupons on. As you say, we didn't apply the timing adjustment while bootstrapping and we're applying it now, so the values of the coupons don't match.
>
> We should pass the coupon pricer to the SwapRateHelper constructor, but that's not a feature we have now. I'm afraid I don't have a workaround—except not using timing adjustments. May you open an issue on GitHub for this?
>
> Thanks,
> Luigi
>
>
>
> On Tue, Oct 24, 2023 at 12:12 PM Aleksis Ali Raza via QuantLib-users <qua...@li... <mailto:qua...@li...>> wrote:
>> Hi.
>>
>> Quantlib allows for timing adjustments using the BlackIborCouponPricer class. My understanding is that Quantlib must be built with the indexed-coupon flag enabled to see effects from convexity/timing adjustments.
>>
>> However doing so appears to create non-zero NPVs even for vanilla swaps priced at fair rate.
>>
>> Adding the following code to the existing swap.py example that comes with the Quantlib SWIG package demonstrates this:
>> myforecastTermStructure = ql.YieldTermStructureHandle(ql.PiecewiseLinearZero(0, calendar, helpers, dayCounter))
>> flatcfvol = ql.SimpleQuote(.01)
>> flatcfvols = ql.ConstantOptionletVolatility(2, calendar, ql.ModifiedFollowing, ql.QuoteHandle(flatcfvol),floatingLegDayCounter, ql.Normal, 0.0)
>> flatcfvolsurface = ql.OptionletVolatilityStructureHandle(flatcfvols)
>> flatcfvolsurface.enableExtrapolation()
>> myindex = ql.IborIndex('', ql.Period('3m'), 2, ql.EURCurrency(), calendar, ql.ModifiedFollowing, False, dayCounter,myforecastTermStructure)
>> fixedleg=ql.FixedRateLeg(fixedSchedule,fixedLegDayCounter,[nominal],[fixedRate])
>> floatingleg=ql.IborLeg([nominal],floatingSchedule,myindex,floatingLegDayCounter,floatingLegAdjustment,[fixingDays],[1],[0],caps=[],floors=[],isInArrears=False)
>> couponpricer = ql.BlackIborCouponPricer(flatcfvolsurface, 1, ql.QuoteHandle(ql.SimpleQuote(.2)))
>> ql.setCouponPricer(floatingleg, couponpricer)
>> myswap=ql.Swap(fixedleg,floatingleg)
>> myswap.setPricingEngine(swapEngine)
>> print(myswap.NPV())
>> I think the reason for the non-zero PV is that accrual periods mismatch index periods for coupons which have start/end dates that are non-business days.
>>
>> Is there a work-around for this issue? A vanilla swap at fair rate should PV to zero in all cases. Perhaps the swap helpers in the curve construction need to incorporate this information somehow?
>>
>> Thanks, Aleksis
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li... <mailto:Qua...@li...>
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: Luigi B. <lui...@gm...> - 2023-10-24 15:57:37
|
Ok, I see. I was confused for a bit because adding your code above at the
end of swap.py, fixedSchedule and floatingSchedule are forward starting,
not spot; also fixedRate is not the rate used in the bootstrap.
In any case, once I use the correct schedules and fixed rate, the problem
can be seen even without compiling with indexed coupons on. As you say, we
didn't apply the timing adjustment while bootstrapping and we're applying
it now, so the values of the coupons don't match.
We should pass the coupon pricer to the SwapRateHelper constructor, but
that's not a feature we have now. I'm afraid I don't have a
workaround—except not using timing adjustments. May you open an issue on
GitHub for this?
Thanks,
Luigi
On Tue, Oct 24, 2023 at 12:12 PM Aleksis Ali Raza via QuantLib-users <
qua...@li...> wrote:
> Hi.
>
> Quantlib allows for timing adjustments using the BlackIborCouponPricer
> class. My understanding is that Quantlib must be built with the
> indexed-coupon flag enabled to see effects from convexity/timing
> adjustments.
>
> However doing so appears to create non-zero NPVs even for vanilla swaps
> priced at fair rate.
>
> Adding the following code to the existing swap.py example that comes with
> the Quantlib SWIG package demonstrates this:
>
> myforecastTermStructure = ql.YieldTermStructureHandle(ql.PiecewiseLinearZero(0, calendar, helpers, dayCounter))
> flatcfvol = ql.SimpleQuote(.01)
> flatcfvols = ql.ConstantOptionletVolatility(2, calendar, ql.ModifiedFollowing, ql.QuoteHandle(flatcfvol),floatingLegDayCounter, ql.Normal, 0.0)
> flatcfvolsurface = ql.OptionletVolatilityStructureHandle(flatcfvols)
> flatcfvolsurface.enableExtrapolation()
> myindex = ql.IborIndex('', ql.Period('3m'), 2, ql.EURCurrency(), calendar, ql.ModifiedFollowing, False, dayCounter,myforecastTermStructure)
> fixedleg=ql.FixedRateLeg(fixedSchedule,fixedLegDayCounter,[nominal],[fixedRate])
> floatingleg=ql.IborLeg([nominal],floatingSchedule,myindex,floatingLegDayCounter,floatingLegAdjustment,[fixingDays],[1],[0],caps=[],floors=[],isInArrears=False)
> couponpricer = ql.BlackIborCouponPricer(flatcfvolsurface, 1, ql.QuoteHandle(ql.SimpleQuote(.2)))
> ql.setCouponPricer(floatingleg, couponpricer)
> myswap=ql.Swap(fixedleg,floatingleg)
> myswap.setPricingEngine(swapEngine)
> print(myswap.NPV())
>
> I think the reason for the non-zero PV is that accrual periods mismatch
> index periods for coupons which have start/end dates that are non-business
> days.
>
> Is there a work-around for this issue? A vanilla swap at fair rate should
> PV to zero in all cases. Perhaps the swap helpers in the curve construction
> need to incorporate this information somehow?
>
> Thanks, Aleksis
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Trent M. <tr...@ma...> - 2023-10-24 15:04:59
|
Hi all, I've been looking at CZK and market practice for the Ibors there seems to be to switch to one of the shorter dated Ibor Indexes when there is a stub (believe they are actually just interpolated and put into a quote in Bloomberg). The QuantLib model is spot on at pricing swaps except when there is a stub, since QuantLib is using my 3m or 6m index interpolation for the stub. What is the recommended way of handling this? It seems that a brute force way would be to build all the various indexes and then write a index chooser function to pick which one to use to forecast the fixings, but I'm wondering if there's a more straightforward way. Thanks in advance, Trent Maetzold |
|
From: Aleksis A. R. <ale...@go...> - 2023-10-24 10:09:49
|
Hi.
Quantlib allows for timing adjustments using the BlackIborCouponPricer class. My understanding is that Quantlib must be built with the indexed-coupon flag enabled to see effects from convexity/timing adjustments.
However doing so appears to create non-zero NPVs even for vanilla swaps priced at fair rate.
Adding the following code to the existing swap.py example that comes with the Quantlib SWIG package demonstrates this:
myforecastTermStructure = ql.YieldTermStructureHandle(ql.PiecewiseLinearZero(0, calendar, helpers, dayCounter))
flatcfvol = ql.SimpleQuote(.01)
flatcfvols = ql.ConstantOptionletVolatility(2, calendar, ql.ModifiedFollowing, ql.QuoteHandle(flatcfvol),floatingLegDayCounter, ql.Normal, 0.0)
flatcfvolsurface = ql.OptionletVolatilityStructureHandle(flatcfvols)
flatcfvolsurface.enableExtrapolation()
myindex = ql.IborIndex('', ql.Period('3m'), 2, ql.EURCurrency(), calendar, ql.ModifiedFollowing, False, dayCounter,myforecastTermStructure)
fixedleg=ql.FixedRateLeg(fixedSchedule,fixedLegDayCounter,[nominal],[fixedRate])
floatingleg=ql.IborLeg([nominal],floatingSchedule,myindex,floatingLegDayCounter,floatingLegAdjustment,[fixingDays],[1],[0],caps=[],floors=[],isInArrears=False)
couponpricer = ql.BlackIborCouponPricer(flatcfvolsurface, 1, ql.QuoteHandle(ql.SimpleQuote(.2)))
ql.setCouponPricer(floatingleg, couponpricer)
myswap=ql.Swap(fixedleg,floatingleg)
myswap.setPricingEngine(swapEngine)
print(myswap.NPV())
I think the reason for the non-zero PV is that accrual periods mismatch index periods for coupons which have start/end dates that are non-business days.
Is there a work-around for this issue? A vanilla swap at fair rate should PV to zero in all cases. Perhaps the swap helpers in the curve construction need to incorporate this information somehow?
Thanks, Aleksis |
|
From: Luigi B. <lui...@gm...> - 2023-10-23 16:40:03
|
Sorry, first the weekend and then my real job got in the way. After the floating schedule, you're passing your forecasting curve where an interest-rate index should be. Use something like ql.Euribor6M(ForecastingTermStructure). Luigi On Mon, Oct 23, 2023 at 8:55 AM Brian Smith <bri...@gm...> wrote: > Hi, > > It will be really helpful if some solution can be obtained to my problem. > > I already provided full code for creation of a Swap contract where I > am failing. Please let me know if any further information is required. > > Thanks and regards, > > On Fri, 20 Oct 2023 at 19:51, Brian Smith <bri...@gm...> > wrote: > > > > Hi Luigi, > > > > Below is my full code. Any help on how to resolve this issue will be > > great. Thanks, > > > > import QuantLib as ql > > > > Calendar = ql.TARGET() > > TermStructureDayCounter = ql.Actual365Fixed() > > DepositDayCounter = ql.Actual360() > > FixingDays = 2 > > TodaysDate = ql.Date(11, ql.December, 2012) > > ql.Settings.instance().evaluationDate = TodaysDate > > SettlementDate = Calendar.adjust(Calendar.advance(TodaysDate, > > FixingDays, ql.Days)) > > > > Euribor6MInstruments = [ > > ql.DepositRateHelper( > > ql.QuoteHandle(ql.SimpleQuote(0.00312)), > > ql.Period(6, ql.Months), > > 3, > > Calendar, > > ql.Following, > > False, > > DepositDayCounter > > ) > > ] > > Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > > Euribor6MInstruments, TermStructureDayCounter) > > ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > > ForecastingTermStructure.linkTo(Euribor6MTermStructure) > > > > ql.VanillaSwap( > > ql.Swap.Payer, > > 1000000.0, > > ql.Schedule( > > SettlementDate, > > SettlementDate + ql.Period(5, ql.Years), > > ql.Period(ql.Annual), > > Calendar, > > ql.Unadjusted, > > ql.Unadjusted, > > ql.DateGeneration.Forward, > > False > > ), > > 0.007, > > ql.Thirty360(ql.Thirty360.European), > > ql.Schedule( > > SettlementDate, > > SettlementDate + ql.Period(5, ql.Years), > > ql.Period(ql.Semiannual), > > Calendar, > > ql.ModifiedFollowing, > > ql.ModifiedFollowing, > > ql.DateGeneration.Forward, > > False > > ), > > ForecastingTermStructure, > > 0.0, > > ql.Actual360() > > ) > > > > On Fri, 20 Oct 2023 at 19:04, Luigi Ballabio <lui...@gm...> > wrote: > > > > > > Hi Brian, > > > may you post an example we can run? Lots of undefined variables > in the code you posted (Calendar, DayCounter, SettlementDate...) > > > > > > Anyway, what I would do is look at the types of the parameters you're > passing (as in, calling type(...) on them) and check if they match the > prototypes that the wrappers are showing in the error message. > > > > > > Luigi > > > > > > > > > On Fri, Oct 20, 2023 at 3:10 PM Brian Smith < > bri...@gm...> wrote: > > >> > > >> Hi Trent, > > >> > > >> While it will be definitely interesting to try with MakeSwap, but it > > >> would be insightful to understand why my earlier implementation with > > >> VanillaSwap is failing. Any help to resolve error with VanillaSwap is > > >> very appreciated. > > >> > > >> Thanks and regards, > > >> > > >> On Thu, 19 Oct 2023 at 22:31, Trent Maetzold <tr...@ma...> > wrote: > > >> > > > >> > Sorry, on mobile. There’s a function MakeSwap that makes it easier > to construct a swap. You don’t need to worry about as many params and > there’s better type hinting available. Can you try that instead of using > the class directly? > > >> > > > >> > Sent from Proton Mail for iOS > > >> > > > >> > > > >> > On Thu, Oct 19, 2023 at 11:57, Brian Smith < > bri...@gm...> wrote: > > >> > > > >> > I used > > >> > > > >> > ql.VanillaSwap( > > >> > ql.Swap.Payer, > > >> > 1000000.0, > > >> > ql.Schedule( > > >> > SettlementDate, > > >> > SettlementDate + ql.Period(5, ql.Years), > > >> > ql.Period(ql.Annual), > > >> > Calendar, > > >> > ql.Unadjusted, > > >> > ql.Unadjusted, > > >> > ql.DateGeneration.Forward, > > >> > False > > >> > ), > > >> > 0.007, > > >> > ql.Thirty360(ql.Thirty360.European), > > >> > ql.Schedule( > > >> > SettlementDate, > > >> > SettlementDate + ql.Period(5, ql.Years), > > >> > ql.Period(ql.Semiannual), > > >> > Calendar, > > >> > ql.ModifiedFollowing, > > >> > ql.ModifiedFollowing, > > >> > ql.DateGeneration.Forward, > > >> > False > > >> > ), > > >> > ForecastingTermStructure, > > >> > 0.0, > > >> > ql.Actual360() > > >> > ) > > >> > > > >> > But still getting error which reads as > > >> > > > >> > Traceback (most recent call last): > > >> > > > >> > File "<stdin>", line 1, in <module> > > >> > > > >> > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > > >> > line 21252, in __init__ > > >> > > > >> > _QuantLib.VanillaSwap_swiginit(self, > _QuantLib.new_VanillaSwap(*args)) > > >> > > > >> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > >> > > > >> > TypeError: Wrong number or type of arguments for overloaded function > > >> > 'new_VanillaSwap'. > > >> > > > >> > Possible C/C++ prototypes are: > > >> > > > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > > >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< > IborIndex > > >> > > const &,Spread,DayCounter const &,ext::optional< bool >) > > >> > > > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > > >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< > IborIndex > > >> > > const &,Spread,DayCounter const &) > > >> > > > >> > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> > wrote: > > >> > > > > >> > > It seems you are providing a YieldTermStructureHandle to a > YieldTermStructureHandle here: > ql.YieldTermStructureHandle(ForecastingTermStructure), > > >> > > > > >> > > In your swap constructor, you can use ForecastingTermStructure > directly because it's already a YieldTermStructureHandle. > > >> > > > > >> > > > > >> > > > > >> > > On Thu, 19 Oct 2023 at 16:04, Brian Smith < > bri...@gm...> wrote: > > >> > >> > > >> > >> Hi, > > >> > >> > > >> > >> I tried to create Swap contract unsuccessfully as below > > >> > >> > > >> > >> import QuantLib as ql > > >> > >> > > >> > >> Euribor6MInstruments = [ > > >> > >> ql.DepositRateHelper( > > >> > >> ql.QuoteHandle(ql.SimpleQuote(0.00312)), > > >> > >> ql.Period(6, ql.Months), > > >> > >> 3, > > >> > >> Calendar, > > >> > >> ql.Following, > > >> > >> False, > > >> > >> DepositDayCounter > > >> > >> ) > > >> > >> ] > > >> > >> Euribor6MTermStructure = > ql.PiecewiseLogCubicDiscount(SettlementDate, > > >> > >> Euribor6MInstruments, TermStructureDayCounter) > > >> > >> ForecastingTermStructure = > ql.RelinkableYieldTermStructureHandle() > > >> > >> ForecastingTermStructure.linkTo(Euribor6MTermStructure) > > >> > >> > > >> > >> ql.VanillaSwap( > > >> > >> ql.Swap.Payer, > > >> > >> 1000000.0, > > >> > >> ql.Schedule( > > >> > >> SettlementDate, > > >> > >> SettlementDate + ql.Period(5, ql.Years), > > >> > >> ql.Period(ql.Annual), > > >> > >> Calendar, > > >> > >> ql.Unadjusted, > > >> > >> ql.Unadjusted, > > >> > >> ql.DateGeneration.Forward, > > >> > >> False > > >> > >> ), > > >> > >> 0.007, > > >> > >> ql.Thirty360(ql.Thirty360.European), > > >> > >> ql.Schedule( > > >> > >> SettlementDate, > > >> > >> SettlementDate + ql.Period(5, ql.Years), > > >> > >> ql.Period(ql.Semiannual), > > >> > >> Calendar, > > >> > >> ql.ModifiedFollowing, > > >> > >> ql.ModifiedFollowing, > > >> > >> ql.DateGeneration.Forward, > > >> > >> False > > >> > >> ), > > >> > >> ql.YieldTermStructureHandle(ForecastingTermStructure), > > >> > >> 0.0, > > >> > >> ql.Actual360() > > >> > >> ) > > >> > >> > > >> > >> With above I got below error > > >> > >> > > >> > >> Traceback (most recent call last): > > >> > >> > > >> > >> File "<stdin>", line 26, in <module> > > >> > >> > > >> > >> File > "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > > >> > >> line 8609, in __init__ > > >> > >> > > >> > >> _QuantLib.YieldTermStructureHandle_swiginit(self, > > >> > >> _QuantLib.new_YieldTermStructureHandle(*args)) > > >> > >> > > >> > >> > > >> > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > >> > >> > > >> > >> TypeError: Wrong number or type of arguments for overloaded > function > > >> > >> 'new_YieldTermStructureHandle'. > > >> > >> > > >> > >> Possible C/C++ prototypes are: > > >> > >> > > >> > >> Handle< YieldTermStructure >::Handle(ext::shared_ptr< > > >> > >> YieldTermStructure > const &) > > >> > >> > > >> > >> Handle< YieldTermStructure >::Handle() > > >> > >> > > >> > >> Any help on how to resolve above error is very appreciated. > > >> > >> > > >> > >> > > >> > >> _______________________________________________ > > >> > >> 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: Roland L. <rol...@ac...> - 2023-10-23 07:59:52
|
Hi all, We are happy to announce our next release of ORE on https://github.com/OpenSourceRisk. Main contribution this time is Acadia's scripted trade framework that allows representing complex payoffs (hybrids, baskets, with path-dependence, early exercise) using an ORE scripting language, so that new instruments can be added without recompiling ORE. Scripted trades are fully integrated into ORE, with pricing, sensitivity analysis, par sensitivity conversion, fast exposure simulation and XVA using American Monte Carlo. Moreover, the new framework is the basis for an ORE implementation of Algorithmic Differentiation (AD) for trade sensitivities and ultimately XVA risk and SA-CVA. And finally, the framework provides an external compute device interface for utilising GPUs. The current release also adds SIMM 2.6, as well as one-day SIMM for SIMM versions >= 2.2. ORE v11 is based on QuantLib 1.31.1. To get started with ORE as a Python module, just call “pip install open-source-risk-engine” and see the ORE User Guide at https://opensourcerisk.org/documentation Best wishes, Roland The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. The acadia.inc privacy policy is available on our website. |
|
From: Brian S. <bri...@gm...> - 2023-10-23 06:55:13
|
Hi, It will be really helpful if some solution can be obtained to my problem. I already provided full code for creation of a Swap contract where I am failing. Please let me know if any further information is required. Thanks and regards, On Fri, 20 Oct 2023 at 19:51, Brian Smith <bri...@gm...> wrote: > > Hi Luigi, > > Below is my full code. Any help on how to resolve this issue will be > great. Thanks, > > import QuantLib as ql > > Calendar = ql.TARGET() > TermStructureDayCounter = ql.Actual365Fixed() > DepositDayCounter = ql.Actual360() > FixingDays = 2 > TodaysDate = ql.Date(11, ql.December, 2012) > ql.Settings.instance().evaluationDate = TodaysDate > SettlementDate = Calendar.adjust(Calendar.advance(TodaysDate, > FixingDays, ql.Days)) > > Euribor6MInstruments = [ > ql.DepositRateHelper( > ql.QuoteHandle(ql.SimpleQuote(0.00312)), > ql.Period(6, ql.Months), > 3, > Calendar, > ql.Following, > False, > DepositDayCounter > ) > ] > Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > Euribor6MInstruments, TermStructureDayCounter) > ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > ForecastingTermStructure.linkTo(Euribor6MTermStructure) > > ql.VanillaSwap( > ql.Swap.Payer, > 1000000.0, > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Annual), > Calendar, > ql.Unadjusted, > ql.Unadjusted, > ql.DateGeneration.Forward, > False > ), > 0.007, > ql.Thirty360(ql.Thirty360.European), > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Semiannual), > Calendar, > ql.ModifiedFollowing, > ql.ModifiedFollowing, > ql.DateGeneration.Forward, > False > ), > ForecastingTermStructure, > 0.0, > ql.Actual360() > ) > > On Fri, 20 Oct 2023 at 19:04, Luigi Ballabio <lui...@gm...> wrote: > > > > Hi Brian, > > may you post an example we can run? Lots of undefined variables in the code you posted (Calendar, DayCounter, SettlementDate...) > > > > Anyway, what I would do is look at the types of the parameters you're passing (as in, calling type(...) on them) and check if they match the prototypes that the wrappers are showing in the error message. > > > > Luigi > > > > > > On Fri, Oct 20, 2023 at 3:10 PM Brian Smith <bri...@gm...> wrote: > >> > >> Hi Trent, > >> > >> While it will be definitely interesting to try with MakeSwap, but it > >> would be insightful to understand why my earlier implementation with > >> VanillaSwap is failing. Any help to resolve error with VanillaSwap is > >> very appreciated. > >> > >> Thanks and regards, > >> > >> On Thu, 19 Oct 2023 at 22:31, Trent Maetzold <tr...@ma...> wrote: > >> > > >> > Sorry, on mobile. There’s a function MakeSwap that makes it easier to construct a swap. You don’t need to worry about as many params and there’s better type hinting available. Can you try that instead of using the class directly? > >> > > >> > Sent from Proton Mail for iOS > >> > > >> > > >> > On Thu, Oct 19, 2023 at 11:57, Brian Smith <bri...@gm...> wrote: > >> > > >> > I used > >> > > >> > ql.VanillaSwap( > >> > ql.Swap.Payer, > >> > 1000000.0, > >> > ql.Schedule( > >> > SettlementDate, > >> > SettlementDate + ql.Period(5, ql.Years), > >> > ql.Period(ql.Annual), > >> > Calendar, > >> > ql.Unadjusted, > >> > ql.Unadjusted, > >> > ql.DateGeneration.Forward, > >> > False > >> > ), > >> > 0.007, > >> > ql.Thirty360(ql.Thirty360.European), > >> > ql.Schedule( > >> > SettlementDate, > >> > SettlementDate + ql.Period(5, ql.Years), > >> > ql.Period(ql.Semiannual), > >> > Calendar, > >> > ql.ModifiedFollowing, > >> > ql.ModifiedFollowing, > >> > ql.DateGeneration.Forward, > >> > False > >> > ), > >> > ForecastingTermStructure, > >> > 0.0, > >> > ql.Actual360() > >> > ) > >> > > >> > But still getting error which reads as > >> > > >> > Traceback (most recent call last): > >> > > >> > File "<stdin>", line 1, in <module> > >> > > >> > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > >> > line 21252, in __init__ > >> > > >> > _QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args)) > >> > > >> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> > > >> > TypeError: Wrong number or type of arguments for overloaded function > >> > 'new_VanillaSwap'. > >> > > >> > Possible C/C++ prototypes are: > >> > > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex > >> > > const &,Spread,DayCounter const &,ext::optional< bool >) > >> > > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex > >> > > const &,Spread,DayCounter const &) > >> > > >> > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote: > >> > > > >> > > It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure), > >> > > > >> > > In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle. > >> > > > >> > > > >> > > > >> > > On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote: > >> > >> > >> > >> Hi, > >> > >> > >> > >> I tried to create Swap contract unsuccessfully as below > >> > >> > >> > >> import QuantLib as ql > >> > >> > >> > >> Euribor6MInstruments = [ > >> > >> ql.DepositRateHelper( > >> > >> ql.QuoteHandle(ql.SimpleQuote(0.00312)), > >> > >> ql.Period(6, ql.Months), > >> > >> 3, > >> > >> Calendar, > >> > >> ql.Following, > >> > >> False, > >> > >> DepositDayCounter > >> > >> ) > >> > >> ] > >> > >> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > >> > >> Euribor6MInstruments, TermStructureDayCounter) > >> > >> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > >> > >> ForecastingTermStructure.linkTo(Euribor6MTermStructure) > >> > >> > >> > >> ql.VanillaSwap( > >> > >> ql.Swap.Payer, > >> > >> 1000000.0, > >> > >> ql.Schedule( > >> > >> SettlementDate, > >> > >> SettlementDate + ql.Period(5, ql.Years), > >> > >> ql.Period(ql.Annual), > >> > >> Calendar, > >> > >> ql.Unadjusted, > >> > >> ql.Unadjusted, > >> > >> ql.DateGeneration.Forward, > >> > >> False > >> > >> ), > >> > >> 0.007, > >> > >> ql.Thirty360(ql.Thirty360.European), > >> > >> ql.Schedule( > >> > >> SettlementDate, > >> > >> SettlementDate + ql.Period(5, ql.Years), > >> > >> ql.Period(ql.Semiannual), > >> > >> Calendar, > >> > >> ql.ModifiedFollowing, > >> > >> ql.ModifiedFollowing, > >> > >> ql.DateGeneration.Forward, > >> > >> False > >> > >> ), > >> > >> ql.YieldTermStructureHandle(ForecastingTermStructure), > >> > >> 0.0, > >> > >> ql.Actual360() > >> > >> ) > >> > >> > >> > >> With above I got below error > >> > >> > >> > >> Traceback (most recent call last): > >> > >> > >> > >> File "<stdin>", line 26, in <module> > >> > >> > >> > >> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > >> > >> line 8609, in __init__ > >> > >> > >> > >> _QuantLib.YieldTermStructureHandle_swiginit(self, > >> > >> _QuantLib.new_YieldTermStructureHandle(*args)) > >> > >> > >> > >> > >> > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> > >> > >> > >> TypeError: Wrong number or type of arguments for overloaded function > >> > >> 'new_YieldTermStructureHandle'. > >> > >> > >> > >> Possible C/C++ prototypes are: > >> > >> > >> > >> Handle< YieldTermStructure >::Handle(ext::shared_ptr< > >> > >> YieldTermStructure > const &) > >> > >> > >> > >> Handle< YieldTermStructure >::Handle() > >> > >> > >> > >> Any help on how to resolve above error is very appreciated. > >> > >> > >> > >> > >> > >> _______________________________________________ > >> > >> 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-20 14:22:02
|
Hi Luigi, Below is my full code. Any help on how to resolve this issue will be great. Thanks, import QuantLib as ql Calendar = ql.TARGET() TermStructureDayCounter = ql.Actual365Fixed() DepositDayCounter = ql.Actual360() FixingDays = 2 TodaysDate = ql.Date(11, ql.December, 2012) ql.Settings.instance().evaluationDate = TodaysDate SettlementDate = Calendar.adjust(Calendar.advance(TodaysDate, FixingDays, ql.Days)) Euribor6MInstruments = [ ql.DepositRateHelper( ql.QuoteHandle(ql.SimpleQuote(0.00312)), ql.Period(6, ql.Months), 3, Calendar, ql.Following, False, DepositDayCounter ) ] Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, Euribor6MInstruments, TermStructureDayCounter) ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() ForecastingTermStructure.linkTo(Euribor6MTermStructure) ql.VanillaSwap( ql.Swap.Payer, 1000000.0, ql.Schedule( SettlementDate, SettlementDate + ql.Period(5, ql.Years), ql.Period(ql.Annual), Calendar, ql.Unadjusted, ql.Unadjusted, ql.DateGeneration.Forward, False ), 0.007, ql.Thirty360(ql.Thirty360.European), ql.Schedule( SettlementDate, SettlementDate + ql.Period(5, ql.Years), ql.Period(ql.Semiannual), Calendar, ql.ModifiedFollowing, ql.ModifiedFollowing, ql.DateGeneration.Forward, False ), ForecastingTermStructure, 0.0, ql.Actual360() ) On Fri, 20 Oct 2023 at 19:04, Luigi Ballabio <lui...@gm...> wrote: > > Hi Brian, > may you post an example we can run? Lots of undefined variables in the code you posted (Calendar, DayCounter, SettlementDate...) > > Anyway, what I would do is look at the types of the parameters you're passing (as in, calling type(...) on them) and check if they match the prototypes that the wrappers are showing in the error message. > > Luigi > > > On Fri, Oct 20, 2023 at 3:10 PM Brian Smith <bri...@gm...> wrote: >> >> Hi Trent, >> >> While it will be definitely interesting to try with MakeSwap, but it >> would be insightful to understand why my earlier implementation with >> VanillaSwap is failing. Any help to resolve error with VanillaSwap is >> very appreciated. >> >> Thanks and regards, >> >> On Thu, 19 Oct 2023 at 22:31, Trent Maetzold <tr...@ma...> wrote: >> > >> > Sorry, on mobile. There’s a function MakeSwap that makes it easier to construct a swap. You don’t need to worry about as many params and there’s better type hinting available. Can you try that instead of using the class directly? >> > >> > Sent from Proton Mail for iOS >> > >> > >> > On Thu, Oct 19, 2023 at 11:57, Brian Smith <bri...@gm...> wrote: >> > >> > I used >> > >> > ql.VanillaSwap( >> > ql.Swap.Payer, >> > 1000000.0, >> > ql.Schedule( >> > SettlementDate, >> > SettlementDate + ql.Period(5, ql.Years), >> > ql.Period(ql.Annual), >> > Calendar, >> > ql.Unadjusted, >> > ql.Unadjusted, >> > ql.DateGeneration.Forward, >> > False >> > ), >> > 0.007, >> > ql.Thirty360(ql.Thirty360.European), >> > ql.Schedule( >> > SettlementDate, >> > SettlementDate + ql.Period(5, ql.Years), >> > ql.Period(ql.Semiannual), >> > Calendar, >> > ql.ModifiedFollowing, >> > ql.ModifiedFollowing, >> > ql.DateGeneration.Forward, >> > False >> > ), >> > ForecastingTermStructure, >> > 0.0, >> > ql.Actual360() >> > ) >> > >> > But still getting error which reads as >> > >> > Traceback (most recent call last): >> > >> > File "<stdin>", line 1, in <module> >> > >> > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", >> > line 21252, in __init__ >> > >> > _QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args)) >> > >> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> > >> > TypeError: Wrong number or type of arguments for overloaded function >> > 'new_VanillaSwap'. >> > >> > Possible C/C++ prototypes are: >> > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex >> > > const &,Spread,DayCounter const &,ext::optional< bool >) >> > >> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const >> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex >> > > const &,Spread,DayCounter const &) >> > >> > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote: >> > > >> > > It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure), >> > > >> > > In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle. >> > > >> > > >> > > >> > > On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote: >> > >> >> > >> Hi, >> > >> >> > >> I tried to create Swap contract unsuccessfully as below >> > >> >> > >> import QuantLib as ql >> > >> >> > >> Euribor6MInstruments = [ >> > >> ql.DepositRateHelper( >> > >> ql.QuoteHandle(ql.SimpleQuote(0.00312)), >> > >> ql.Period(6, ql.Months), >> > >> 3, >> > >> Calendar, >> > >> ql.Following, >> > >> False, >> > >> DepositDayCounter >> > >> ) >> > >> ] >> > >> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, >> > >> Euribor6MInstruments, TermStructureDayCounter) >> > >> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() >> > >> ForecastingTermStructure.linkTo(Euribor6MTermStructure) >> > >> >> > >> ql.VanillaSwap( >> > >> ql.Swap.Payer, >> > >> 1000000.0, >> > >> ql.Schedule( >> > >> SettlementDate, >> > >> SettlementDate + ql.Period(5, ql.Years), >> > >> ql.Period(ql.Annual), >> > >> Calendar, >> > >> ql.Unadjusted, >> > >> ql.Unadjusted, >> > >> ql.DateGeneration.Forward, >> > >> False >> > >> ), >> > >> 0.007, >> > >> ql.Thirty360(ql.Thirty360.European), >> > >> ql.Schedule( >> > >> SettlementDate, >> > >> SettlementDate + ql.Period(5, ql.Years), >> > >> ql.Period(ql.Semiannual), >> > >> Calendar, >> > >> ql.ModifiedFollowing, >> > >> ql.ModifiedFollowing, >> > >> ql.DateGeneration.Forward, >> > >> False >> > >> ), >> > >> ql.YieldTermStructureHandle(ForecastingTermStructure), >> > >> 0.0, >> > >> ql.Actual360() >> > >> ) >> > >> >> > >> With above I got below error >> > >> >> > >> Traceback (most recent call last): >> > >> >> > >> File "<stdin>", line 26, in <module> >> > >> >> > >> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", >> > >> line 8609, in __init__ >> > >> >> > >> _QuantLib.YieldTermStructureHandle_swiginit(self, >> > >> _QuantLib.new_YieldTermStructureHandle(*args)) >> > >> >> > >> >> > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> > >> >> > >> TypeError: Wrong number or type of arguments for overloaded function >> > >> 'new_YieldTermStructureHandle'. >> > >> >> > >> Possible C/C++ prototypes are: >> > >> >> > >> Handle< YieldTermStructure >::Handle(ext::shared_ptr< >> > >> YieldTermStructure > const &) >> > >> >> > >> Handle< YieldTermStructure >::Handle() >> > >> >> > >> Any help on how to resolve above error is very appreciated. >> > >> >> > >> >> > >> _______________________________________________ >> > >> 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: Luigi B. <lui...@gm...> - 2023-10-20 13:34:59
|
Hi Brian,
may you post an example we can run? Lots of undefined variables in the
code you posted (Calendar, DayCounter, SettlementDate...)
Anyway, what I would do is look at the types of the parameters you're
passing (as in, calling type(...) on them) and check if they match the
prototypes that the wrappers are showing in the error message.
Luigi
On Fri, Oct 20, 2023 at 3:10 PM Brian Smith <bri...@gm...>
wrote:
> Hi Trent,
>
> While it will be definitely interesting to try with MakeSwap, but it
> would be insightful to understand why my earlier implementation with
> VanillaSwap is failing. Any help to resolve error with VanillaSwap is
> very appreciated.
>
> Thanks and regards,
>
> On Thu, 19 Oct 2023 at 22:31, Trent Maetzold <tr...@ma...> wrote:
> >
> > Sorry, on mobile. There’s a function MakeSwap that makes it easier to
> construct a swap. You don’t need to worry about as many params and there’s
> better type hinting available. Can you try that instead of using the class
> directly?
> >
> > Sent from Proton Mail for iOS
> >
> >
> > On Thu, Oct 19, 2023 at 11:57, Brian Smith <bri...@gm...>
> wrote:
> >
> > I used
> >
> > ql.VanillaSwap(
> > ql.Swap.Payer,
> > 1000000.0,
> > ql.Schedule(
> > SettlementDate,
> > SettlementDate + ql.Period(5, ql.Years),
> > ql.Period(ql.Annual),
> > Calendar,
> > ql.Unadjusted,
> > ql.Unadjusted,
> > ql.DateGeneration.Forward,
> > False
> > ),
> > 0.007,
> > ql.Thirty360(ql.Thirty360.European),
> > ql.Schedule(
> > SettlementDate,
> > SettlementDate + ql.Period(5, ql.Years),
> > ql.Period(ql.Semiannual),
> > Calendar,
> > ql.ModifiedFollowing,
> > ql.ModifiedFollowing,
> > ql.DateGeneration.Forward,
> > False
> > ),
> > ForecastingTermStructure,
> > 0.0,
> > ql.Actual360()
> > )
> >
> > But still getting error which reads as
> >
> > Traceback (most recent call last):
> >
> > File "<stdin>", line 1, in <module>
> >
> > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
> > line 21252, in __init__
> >
> > _QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args))
> >
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > TypeError: Wrong number or type of arguments for overloaded function
> > 'new_VanillaSwap'.
> >
> > Possible C/C++ prototypes are:
> >
> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const
> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex
> > > const &,Spread,DayCounter const &,ext::optional< bool >)
> >
> > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const
> > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex
> > > const &,Spread,DayCounter const &)
> >
> > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote:
> > >
> > > It seems you are providing a YieldTermStructureHandle to a
> YieldTermStructureHandle here:
> ql.YieldTermStructureHandle(ForecastingTermStructure),
> > >
> > > In your swap constructor, you can use ForecastingTermStructure
> directly because it's already a YieldTermStructureHandle.
> > >
> > >
> > >
> > > On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...>
> wrote:
> > >>
> > >> Hi,
> > >>
> > >> I tried to create Swap contract unsuccessfully as below
> > >>
> > >> import QuantLib as ql
> > >>
> > >> Euribor6MInstruments = [
> > >> ql.DepositRateHelper(
> > >> ql.QuoteHandle(ql.SimpleQuote(0.00312)),
> > >> ql.Period(6, ql.Months),
> > >> 3,
> > >> Calendar,
> > >> ql.Following,
> > >> False,
> > >> DepositDayCounter
> > >> )
> > >> ]
> > >> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate,
> > >> Euribor6MInstruments, TermStructureDayCounter)
> > >> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle()
> > >> ForecastingTermStructure.linkTo(Euribor6MTermStructure)
> > >>
> > >> ql.VanillaSwap(
> > >> ql.Swap.Payer,
> > >> 1000000.0,
> > >> ql.Schedule(
> > >> SettlementDate,
> > >> SettlementDate + ql.Period(5, ql.Years),
> > >> ql.Period(ql.Annual),
> > >> Calendar,
> > >> ql.Unadjusted,
> > >> ql.Unadjusted,
> > >> ql.DateGeneration.Forward,
> > >> False
> > >> ),
> > >> 0.007,
> > >> ql.Thirty360(ql.Thirty360.European),
> > >> ql.Schedule(
> > >> SettlementDate,
> > >> SettlementDate + ql.Period(5, ql.Years),
> > >> ql.Period(ql.Semiannual),
> > >> Calendar,
> > >> ql.ModifiedFollowing,
> > >> ql.ModifiedFollowing,
> > >> ql.DateGeneration.Forward,
> > >> False
> > >> ),
> > >> ql.YieldTermStructureHandle(ForecastingTermStructure),
> > >> 0.0,
> > >> ql.Actual360()
> > >> )
> > >>
> > >> With above I got below error
> > >>
> > >> Traceback (most recent call last):
> > >>
> > >> File "<stdin>", line 26, in <module>
> > >>
> > >> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
> > >> line 8609, in __init__
> > >>
> > >> _QuantLib.YieldTermStructureHandle_swiginit(self,
> > >> _QuantLib.new_YieldTermStructureHandle(*args))
> > >>
> > >>
> > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >>
> > >> TypeError: Wrong number or type of arguments for overloaded function
> > >> 'new_YieldTermStructureHandle'.
> > >>
> > >> Possible C/C++ prototypes are:
> > >>
> > >> Handle< YieldTermStructure >::Handle(ext::shared_ptr<
> > >> YieldTermStructure > const &)
> > >>
> > >> Handle< YieldTermStructure >::Handle()
> > >>
> > >> Any help on how to resolve above error is very appreciated.
> > >>
> > >>
> > >> _______________________________________________
> > >> 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-20 13:06:46
|
Hi Trent, While it will be definitely interesting to try with MakeSwap, but it would be insightful to understand why my earlier implementation with VanillaSwap is failing. Any help to resolve error with VanillaSwap is very appreciated. Thanks and regards, On Thu, 19 Oct 2023 at 22:31, Trent Maetzold <tr...@ma...> wrote: > > Sorry, on mobile. There’s a function MakeSwap that makes it easier to construct a swap. You don’t need to worry about as many params and there’s better type hinting available. Can you try that instead of using the class directly? > > Sent from Proton Mail for iOS > > > On Thu, Oct 19, 2023 at 11:57, Brian Smith <bri...@gm...> wrote: > > I used > > ql.VanillaSwap( > ql.Swap.Payer, > 1000000.0, > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Annual), > Calendar, > ql.Unadjusted, > ql.Unadjusted, > ql.DateGeneration.Forward, > False > ), > 0.007, > ql.Thirty360(ql.Thirty360.European), > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Semiannual), > Calendar, > ql.ModifiedFollowing, > ql.ModifiedFollowing, > ql.DateGeneration.Forward, > False > ), > ForecastingTermStructure, > 0.0, > ql.Actual360() > ) > > But still getting error which reads as > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > line 21252, in __init__ > > _QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args)) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > TypeError: Wrong number or type of arguments for overloaded function > 'new_VanillaSwap'. > > Possible C/C++ prototypes are: > > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex > > const &,Spread,DayCounter const &,ext::optional< bool >) > > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex > > const &,Spread,DayCounter const &) > > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote: > > > > It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure), > > > > In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle. > > > > > > > > On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote: > >> > >> Hi, > >> > >> I tried to create Swap contract unsuccessfully as below > >> > >> import QuantLib as ql > >> > >> Euribor6MInstruments = [ > >> ql.DepositRateHelper( > >> ql.QuoteHandle(ql.SimpleQuote(0.00312)), > >> ql.Period(6, ql.Months), > >> 3, > >> Calendar, > >> ql.Following, > >> False, > >> DepositDayCounter > >> ) > >> ] > >> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > >> Euribor6MInstruments, TermStructureDayCounter) > >> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > >> ForecastingTermStructure.linkTo(Euribor6MTermStructure) > >> > >> ql.VanillaSwap( > >> ql.Swap.Payer, > >> 1000000.0, > >> ql.Schedule( > >> SettlementDate, > >> SettlementDate + ql.Period(5, ql.Years), > >> ql.Period(ql.Annual), > >> Calendar, > >> ql.Unadjusted, > >> ql.Unadjusted, > >> ql.DateGeneration.Forward, > >> False > >> ), > >> 0.007, > >> ql.Thirty360(ql.Thirty360.European), > >> ql.Schedule( > >> SettlementDate, > >> SettlementDate + ql.Period(5, ql.Years), > >> ql.Period(ql.Semiannual), > >> Calendar, > >> ql.ModifiedFollowing, > >> ql.ModifiedFollowing, > >> ql.DateGeneration.Forward, > >> False > >> ), > >> ql.YieldTermStructureHandle(ForecastingTermStructure), > >> 0.0, > >> ql.Actual360() > >> ) > >> > >> With above I got below error > >> > >> Traceback (most recent call last): > >> > >> File "<stdin>", line 26, in <module> > >> > >> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > >> line 8609, in __init__ > >> > >> _QuantLib.YieldTermStructureHandle_swiginit(self, > >> _QuantLib.new_YieldTermStructureHandle(*args)) > >> > >> > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> > >> TypeError: Wrong number or type of arguments for overloaded function > >> 'new_YieldTermStructureHandle'. > >> > >> Possible C/C++ prototypes are: > >> > >> Handle< YieldTermStructure >::Handle(ext::shared_ptr< > >> YieldTermStructure > const &) > >> > >> Handle< YieldTermStructure >::Handle() > >> > >> Any help on how to resolve above error is very appreciated. > >> > >> > >> _______________________________________________ > >> 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-20 08:51:07
|
QuantLib 1.32 has been released and is available for download at < https://www.quantlib.org/download.shtml>. The list of changes for this release is at < https://www.quantlib.org/reference/history.html>. If you have any problems with this release, please report them here on the QuantLib mailing list (<qua...@li...>), or open a GitHub issue at <https://github.com/lballabio/quantlib/issues>. Starting from this release, a semi-official C# package is also available from NuGet (see <https://www.nuget.org/packages/QuantLib/>). It should work on Windows and OS X, but it's not guaranteed to work on all Linux distributions; we'll be grateful for any reports, either of successes or failures. |
|
From: Trent M. <tr...@ma...> - 2023-10-19 17:01:31
|
Sorry, on mobile. There’s a function MakeSwap that makes it easier to construct a swap. You don’t need to worry about as many params and there’s better type hinting available. Can you try that instead of using the class directly? Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Thu, Oct 19, 2023 at 11:57, Brian Smith <[bri...@gm...](mailto:On Thu, Oct 19, 2023 at 11:57, Brian Smith <<a href=)> wrote: > I used > > ql.VanillaSwap( > ql.Swap.Payer, > 1000000.0, > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Annual), > Calendar, > ql.Unadjusted, > ql.Unadjusted, > ql.DateGeneration.Forward, > False > ), > 0.007, > ql.Thirty360(ql.Thirty360.European), > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Semiannual), > Calendar, > ql.ModifiedFollowing, > ql.ModifiedFollowing, > ql.DateGeneration.Forward, > False > ), > ForecastingTermStructure, > 0.0, > ql.Actual360() > ) > > But still getting error which reads as > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > line 21252, in __init__ > > _QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args)) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > TypeError: Wrong number or type of arguments for overloaded function > 'new_VanillaSwap'. > > Possible C/C++ prototypes are: > > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex >> const &,Spread,DayCounter const &,ext::optional< bool >) > > VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const > &,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex >> const &,Spread,DayCounter const &) > > On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote: >> >> It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure), >> >> In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle. >> >> >> >> On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote: >>> >>> Hi, >>> >>> I tried to create Swap contract unsuccessfully as below >>> >>> import QuantLib as ql >>> >>> Euribor6MInstruments = [ >>> ql.DepositRateHelper( >>> ql.QuoteHandle(ql.SimpleQuote(0.00312)), >>> ql.Period(6, ql.Months), >>> 3, >>> Calendar, >>> ql.Following, >>> False, >>> DepositDayCounter >>> ) >>> ] >>> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, >>> Euribor6MInstruments, TermStructureDayCounter) >>> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() >>> ForecastingTermStructure.linkTo(Euribor6MTermStructure) >>> >>> ql.VanillaSwap( >>> ql.Swap.Payer, >>> 1000000.0, >>> ql.Schedule( >>> SettlementDate, >>> SettlementDate + ql.Period(5, ql.Years), >>> ql.Period(ql.Annual), >>> Calendar, >>> ql.Unadjusted, >>> ql.Unadjusted, >>> ql.DateGeneration.Forward, >>> False >>> ), >>> 0.007, >>> ql.Thirty360(ql.Thirty360.European), >>> ql.Schedule( >>> SettlementDate, >>> SettlementDate + ql.Period(5, ql.Years), >>> ql.Period(ql.Semiannual), >>> Calendar, >>> ql.ModifiedFollowing, >>> ql.ModifiedFollowing, >>> ql.DateGeneration.Forward, >>> False >>> ), >>> ql.YieldTermStructureHandle(ForecastingTermStructure), >>> 0.0, >>> ql.Actual360() >>> ) >>> >>> With above I got below error >>> >>> Traceback (most recent call last): >>> >>> File "<stdin>", line 26, in <module> >>> >>> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", >>> line 8609, in __init__ >>> >>> _QuantLib.YieldTermStructureHandle_swiginit(self, >>> _QuantLib.new_YieldTermStructureHandle(*args)) >>> >>> >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> >>> TypeError: Wrong number or type of arguments for overloaded function >>> 'new_YieldTermStructureHandle'. >>> >>> Possible C/C++ prototypes are: >>> >>> Handle< YieldTermStructure >::Handle(ext::shared_ptr< >>> YieldTermStructure > const &) >>> >>> Handle< YieldTermStructure >::Handle() >>> >>> Any help on how to resolve above error is very appreciated. >>> >>> >>> _______________________________________________ >>> 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 16:57:32
|
I used
ql.VanillaSwap(
ql.Swap.Payer,
1000000.0,
ql.Schedule(
SettlementDate,
SettlementDate + ql.Period(5, ql.Years),
ql.Period(ql.Annual),
Calendar,
ql.Unadjusted,
ql.Unadjusted,
ql.DateGeneration.Forward,
False
),
0.007,
ql.Thirty360(ql.Thirty360.European),
ql.Schedule(
SettlementDate,
SettlementDate + ql.Period(5, ql.Years),
ql.Period(ql.Semiannual),
Calendar,
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Forward,
False
),
ForecastingTermStructure,
0.0,
ql.Actual360()
)
But still getting error which reads as
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
line 21252, in __init__
_QuantLib.VanillaSwap_swiginit(self, _QuantLib.new_VanillaSwap(*args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wrong number or type of arguments for overloaded function
'new_VanillaSwap'.
Possible C/C++ prototypes are:
VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const
&,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex
> const &,Spread,DayCounter const &,ext::optional< bool >)
VanillaSwap::VanillaSwap(Swap::Type,Real,Schedule const
&,Rate,DayCounter const &,Schedule const &,ext::shared_ptr< IborIndex
> const &,Spread,DayCounter const &)
On Thu, 19 Oct 2023 at 22:18, David Duarte <nh...@gm...> wrote:
>
> It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure),
>
> In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle.
>
>
>
> On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote:
>>
>> Hi,
>>
>> I tried to create Swap contract unsuccessfully as below
>>
>> import QuantLib as ql
>>
>> Euribor6MInstruments = [
>> ql.DepositRateHelper(
>> ql.QuoteHandle(ql.SimpleQuote(0.00312)),
>> ql.Period(6, ql.Months),
>> 3,
>> Calendar,
>> ql.Following,
>> False,
>> DepositDayCounter
>> )
>> ]
>> Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate,
>> Euribor6MInstruments, TermStructureDayCounter)
>> ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle()
>> ForecastingTermStructure.linkTo(Euribor6MTermStructure)
>>
>> ql.VanillaSwap(
>> ql.Swap.Payer,
>> 1000000.0,
>> ql.Schedule(
>> SettlementDate,
>> SettlementDate + ql.Period(5, ql.Years),
>> ql.Period(ql.Annual),
>> Calendar,
>> ql.Unadjusted,
>> ql.Unadjusted,
>> ql.DateGeneration.Forward,
>> False
>> ),
>> 0.007,
>> ql.Thirty360(ql.Thirty360.European),
>> ql.Schedule(
>> SettlementDate,
>> SettlementDate + ql.Period(5, ql.Years),
>> ql.Period(ql.Semiannual),
>> Calendar,
>> ql.ModifiedFollowing,
>> ql.ModifiedFollowing,
>> ql.DateGeneration.Forward,
>> False
>> ),
>> ql.YieldTermStructureHandle(ForecastingTermStructure),
>> 0.0,
>> ql.Actual360()
>> )
>>
>> With above I got below error
>>
>> Traceback (most recent call last):
>>
>> File "<stdin>", line 26, in <module>
>>
>> File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
>> line 8609, in __init__
>>
>> _QuantLib.YieldTermStructureHandle_swiginit(self,
>> _QuantLib.new_YieldTermStructureHandle(*args))
>>
>>
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> TypeError: Wrong number or type of arguments for overloaded function
>> 'new_YieldTermStructureHandle'.
>>
>> Possible C/C++ prototypes are:
>>
>> Handle< YieldTermStructure >::Handle(ext::shared_ptr<
>> YieldTermStructure > const &)
>>
>> Handle< YieldTermStructure >::Handle()
>>
>> Any help on how to resolve above error is very appreciated.
>>
>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: David D. <nh...@gm...> - 2023-10-19 16:48:59
|
It seems you are providing a YieldTermStructureHandle to a YieldTermStructureHandle here: ql.YieldTermStructureHandle(ForecastingTermStructure), In your swap constructor, you can use ForecastingTermStructure directly because it's already a YieldTermStructureHandle. On Thu, 19 Oct 2023 at 16:04, Brian Smith <bri...@gm...> wrote: > Hi, > > I tried to create Swap contract unsuccessfully as below > > import QuantLib as ql > > Euribor6MInstruments = [ > ql.DepositRateHelper( > ql.QuoteHandle(ql.SimpleQuote(0.00312)), > ql.Period(6, ql.Months), > 3, > Calendar, > ql.Following, > False, > DepositDayCounter > ) > ] > Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > Euribor6MInstruments, TermStructureDayCounter) > ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > ForecastingTermStructure.linkTo(Euribor6MTermStructure) > > ql.VanillaSwap( > ql.Swap.Payer, > 1000000.0, > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Annual), > Calendar, > ql.Unadjusted, > ql.Unadjusted, > ql.DateGeneration.Forward, > False > ), > 0.007, > ql.Thirty360(ql.Thirty360.European), > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Semiannual), > Calendar, > ql.ModifiedFollowing, > ql.ModifiedFollowing, > ql.DateGeneration.Forward, > False > ), > ql.YieldTermStructureHandle(ForecastingTermStructure), > 0.0, > ql.Actual360() > ) > > With above I got below error > > Traceback (most recent call last): > > File "<stdin>", line 26, in <module> > > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > line 8609, in __init__ > > _QuantLib.YieldTermStructureHandle_swiginit(self, > _QuantLib.new_YieldTermStructureHandle(*args)) > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > TypeError: Wrong number or type of arguments for overloaded function > 'new_YieldTermStructureHandle'. > > Possible C/C++ prototypes are: > > Handle< YieldTermStructure >::Handle(ext::shared_ptr< > YieldTermStructure > const &) > > Handle< YieldTermStructure >::Handle() > > Any help on how to resolve above error is very appreciated. > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Brian S. <bri...@gm...> - 2023-10-19 16:38:08
|
Hi Trent, could you please be a bit more elaborative on what exactly needs to be done? On Thu, 19 Oct 2023 at 22:03, Trent Maetzold <tr...@ma...> wrote: > > You’re passing the handle to a handle. When you construct the swap just give it the handle you created at the beginning. > > Sent from Proton Mail for iOS > > > On Thu, Oct 19, 2023 at 10:00, Brian Smith <bri...@gm...> wrote: > > Hi, > > I tried to create Swap contract unsuccessfully as below > > import QuantLib as ql > > Euribor6MInstruments = [ > ql.DepositRateHelper( > ql.QuoteHandle(ql.SimpleQuote(0.00312)), > ql.Period(6, ql.Months), > 3, > Calendar, > ql.Following, > False, > DepositDayCounter > ) > ] > Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate, > Euribor6MInstruments, TermStructureDayCounter) > ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle() > ForecastingTermStructure.linkTo(Euribor6MTermStructure) > > ql.VanillaSwap( > ql.Swap.Payer, > 1000000.0, > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Annual), > Calendar, > ql.Unadjusted, > ql.Unadjusted, > ql.DateGeneration.Forward, > False > ), > 0.007, > ql.Thirty360(ql.Thirty360.European), > ql.Schedule( > SettlementDate, > SettlementDate + ql.Period(5, ql.Years), > ql.Period(ql.Semiannual), > Calendar, > ql.ModifiedFollowing, > ql.ModifiedFollowing, > ql.DateGeneration.Forward, > False > ), > ql.YieldTermStructureHandle(ForecastingTermStructure), > 0.0, > ql.Actual360() > ) > > With above I got below error > > Traceback (most recent call last): > > File "<stdin>", line 26, in <module> > > File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py", > line 8609, in __init__ > > _QuantLib.YieldTermStructureHandle_swiginit(self, > _QuantLib.new_YieldTermStructureHandle(*args)) > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > TypeError: Wrong number or type of arguments for overloaded function > 'new_YieldTermStructureHandle'. > > Possible C/C++ prototypes are: > > Handle< YieldTermStructure >::Handle(ext::shared_ptr< > YieldTermStructure > const &) > > Handle< YieldTermStructure >::Handle() > > Any help on how to resolve above error is very appreciated. > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Brian S. <bri...@gm...> - 2023-10-19 15:00:30
|
Hi,
I tried to create Swap contract unsuccessfully as below
import QuantLib as ql
Euribor6MInstruments = [
ql.DepositRateHelper(
ql.QuoteHandle(ql.SimpleQuote(0.00312)),
ql.Period(6, ql.Months),
3,
Calendar,
ql.Following,
False,
DepositDayCounter
)
]
Euribor6MTermStructure = ql.PiecewiseLogCubicDiscount(SettlementDate,
Euribor6MInstruments, TermStructureDayCounter)
ForecastingTermStructure = ql.RelinkableYieldTermStructureHandle()
ForecastingTermStructure.linkTo(Euribor6MTermStructure)
ql.VanillaSwap(
ql.Swap.Payer,
1000000.0,
ql.Schedule(
SettlementDate,
SettlementDate + ql.Period(5, ql.Years),
ql.Period(ql.Annual),
Calendar,
ql.Unadjusted,
ql.Unadjusted,
ql.DateGeneration.Forward,
False
),
0.007,
ql.Thirty360(ql.Thirty360.European),
ql.Schedule(
SettlementDate,
SettlementDate + ql.Period(5, ql.Years),
ql.Period(ql.Semiannual),
Calendar,
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Forward,
False
),
ql.YieldTermStructureHandle(ForecastingTermStructure),
0.0,
ql.Actual360()
)
With above I got below error
Traceback (most recent call last):
File "<stdin>", line 26, in <module>
File "/usr/local/lib/python3.11/site-packages/QuantLib/QuantLib.py",
line 8609, in __init__
_QuantLib.YieldTermStructureHandle_swiginit(self,
_QuantLib.new_YieldTermStructureHandle(*args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wrong number or type of arguments for overloaded function
'new_YieldTermStructureHandle'.
Possible C/C++ prototypes are:
Handle< YieldTermStructure >::Handle(ext::shared_ptr<
YieldTermStructure > const &)
Handle< YieldTermStructure >::Handle()
Any help on how to resolve above error is very appreciated.
|
|
From: Trent M. <tr...@ma...> - 2023-10-19 13:48:29
|
You need to pass the term structure to a term structure handle and pass the handle to the swap rate helper. I.e. ql.YieldTermStructureHandle(EoniaTermStructure) Sent from [Proton Mail](https://proton.me/mail/home) for iOS On Thu, Oct 19, 2023 at 08:43, Brian Smith <[bri...@gm...](mailto:On Thu, Oct 19, 2023 at 08:43, Brian Smith <<a href=)> wrote: > 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 |