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
|
Dec
|
|
From: Luca B. <luc...@gm...> - 2025-10-31 10:31:22
|
Hi Luigi, Thanks for your suggestion. I was able to solve the issue by adjusting the deployment target in Xcode. Here’s how I did it: 1. I selected the "Bonds" example in the *Project Navigator* > *Targets*. 2. In the *Build Settings* for "Bonds," I searched for "Deployment Target." 3. I then changed the **macOS Deployment Target** setting from "13.1" to "12.0." I assume the default "13.1" was automatically set because the developer who built this part might have had macOS 13.1 installed at the time. Thanks again for your help! Best, Luca On Fri, 31 Oct 2025, 10:37 Luigi Ballabio, <lui...@gm...> wrote: > Hi, I'm not really sure where that requirement comes from. May you try > using the command line instead of Xcode, as in > https://www.quantlib.org/install/macosx.shtml ? > > Luigi > > > > On Thu, Oct 30, 2025 at 12:25 AM Luca Begatti <luc...@gm...> > wrote: > >> Hi, >> >> I have successfully forked, cloned and build the QuantLib library on >> Xcode and I wanted to try to run the “Bonds” example, but I have >> encountered this: >> >> *"xxx’s MacBook Pro runs macOS 12.7.6, which is lower than Bonds’s >> minimum deployment target of 13.1. Change your project’s minimum deployment >> target or upgrade Luca’s MacBook Pro’s version of macOS.**”* >> >> My laptop is quite old and Apple does not allow me to update MacOS >> anymore. Is there a way to solve this other than upgrading to a newer >> laptop/Mac? >> >> Thanks >> /Luca >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Luigi B. <lui...@gm...> - 2025-10-31 09:37:23
|
Hi, I'm not really sure where that requirement comes from. May you try using the command line instead of Xcode, as in https://www.quantlib.org/install/macosx.shtml ? Luigi On Thu, Oct 30, 2025 at 12:25 AM Luca Begatti <luc...@gm...> wrote: > Hi, > > I have successfully forked, cloned and build the QuantLib library on Xcode > and I wanted to try to run the “Bonds” example, but I have encountered this: > > *"xxx’s MacBook Pro runs macOS 12.7.6, which is lower than Bonds’s minimum > deployment target of 13.1. Change your project’s minimum deployment target > or upgrade Luca’s MacBook Pro’s version of macOS.**”* > > My laptop is quite old and Apple does not allow me to update MacOS > anymore. Is there a way to solve this other than upgrading to a newer > laptop/Mac? > > Thanks > /Luca > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Luca B. <luc...@gm...> - 2025-10-29 23:25:28
|
Hi, I have successfully forked, cloned and build the QuantLib library on Xcode and I wanted to try to run the “Bonds” example, but I have encountered this: "xxx’s MacBook Pro runs macOS 12.7.6, which is lower than Bonds’s minimum deployment target of 13.1. Change your project’s minimum deployment target or upgrade Luca’s MacBook Pro’s version of macOS.” My laptop is quite old and Apple does not allow me to update MacOS anymore. Is there a way to solve this other than upgrading to a newer laptop/Mac? Thanks /Luca |
|
From: Kenji O. <for...@gm...> - 2025-10-28 00:30:02
|
Hi, In today’s market, discount curves are based on RFRs such as the T+0 ESTR curve, so QuantLib’s current specification still produces correct results. However, if the discount curve is set to an Euribor curve, the calculation becomes meaningless, which I don’t think is a desirable design. I hope this will be revised in future updates. Thank you very much for your prompt response. - Kenji 2025年10月28日(火) 7:05 Aaron De la Rosa <aar...@gm...>: > Hello Kenji > > Python code fixed. Check out the attachment. Open it using Visual Studio > Code. > > Regards > > Aaron > ------------------------------ > *From:* Kenji Ogawa <for...@gm...> > *Sent:* Monday, October 27, 2025 9:37 AM > *To:* Aaron De la Rosa <aar...@gm...> > *Cc:* Qua...@li... < > Qua...@li...> > *Subject:* Re: [Quantlib-users] Asset Swap Calculation Error with IBM > 1.25 1/29/27 (Settlement Days Issue) > > Hello, > Please find attached the Jupyter Notebook code. > > When the parameters are set as " settleCRV, settleBND = 1, 2 ", the > calculations run correctly. However, changing them to " settleCRV, > settleBND = 2, 2 " produces abnormal results. > > It appears that the curve date needs to be set one day earlier than the > bond settlement date. > > regards, > Kenji > > > > 2025年10月28日(火) 0:14 Aaron De la Rosa <aar...@gm...>: > > Could you share the entire code. So, I can fix it. > > Regard > > Aaron > ------------------------------ > *From:* Kenji Ogawa <for...@gm...> > *Sent:* Sunday, October 26, 2025 6:34 PM > *To:* Qua...@li... < > Qua...@li...> > *Subject:* [Quantlib-users] Asset Swap Calculation Error with IBM 1.25 > 1/29/27 (Settlement Days Issue) > > > Below is the code that calculates the asset swap for *IBM 1.25 1/29/27*, > traded on *April 25, 2024*, at a price of *93.95*. > > When using settleDS = 3, the results are correct: > legNPV1 = 95.179 and fairSPD = 0.359%. > > However, when using settleDS = 2, the calculation produces abnormal > results: > legNPV1 = 100.926 and fairSPD = -1.81%. > > Since the bond should settle on *T+2*, this discrepancy is problematic. > Could someone please help fix this error? > > |
|
From: Aaron De la R. <aar...@gm...> - 2025-10-27 20:07:31
|
OK. Let me check it out. I'll be back later. ________________________________ From: Kenji Ogawa <for...@gm...> Sent: Monday, October 27, 2025 9:37 AM To: Aaron De la Rosa <aar...@gm...> Cc: Qua...@li... <Qua...@li...> Subject: Re: [Quantlib-users] Asset Swap Calculation Error with IBM 1.25 1/29/27 (Settlement Days Issue) Hello, Please find attached the Jupyter Notebook code. When the parameters are set as " settleCRV, settleBND = 1, 2 ", the calculations run correctly. However, changing them to " settleCRV, settleBND = 2, 2 " produces abnormal results. It appears that the curve date needs to be set one day earlier than the bond settlement date. regards, Kenji 2025年10月28日(火) 0:14 Aaron De la Rosa <aar...@gm...<mailto:aar...@gm...>>: Could you share the entire code. So, I can fix it. Regard Aaron ________________________________ From: Kenji Ogawa <for...@gm...<mailto:for...@gm...>> Sent: Sunday, October 26, 2025 6:34 PM To: Qua...@li...<mailto:Qua...@li...> <Qua...@li...<mailto:Qua...@li...>> Subject: [Quantlib-users] Asset Swap Calculation Error with IBM 1.25 1/29/27 (Settlement Days Issue) Below is the code that calculates the asset swap for IBM 1.25 1/29/27, traded on April 25, 2024, at a price of 93.95. When using settleDS = 3, the results are correct: legNPV1 = 95.179 and fairSPD = 0.359%. However, when using settleDS = 2, the calculation produces abnormal results: legNPV1 = 100.926 and fairSPD = -1.81%. Since the bond should settle on T+2, this discrepancy is problematic. Could someone please help fix this error? |
|
From: Kenji O. <for...@gm...> - 2025-10-27 15:38:07
|
Hello, Please find attached the Jupyter Notebook code. When the parameters are set as " settleCRV, settleBND = 1, 2 ", the calculations run correctly. However, changing them to " settleCRV, settleBND = 2, 2 " produces abnormal results. It appears that the curve date needs to be set one day earlier than the bond settlement date. regards, Kenji 2025年10月28日(火) 0:14 Aaron De la Rosa <aar...@gm...>: > Could you share the entire code. So, I can fix it. > > Regard > > Aaron > ------------------------------ > *From:* Kenji Ogawa <for...@gm...> > *Sent:* Sunday, October 26, 2025 6:34 PM > *To:* Qua...@li... < > Qua...@li...> > *Subject:* [Quantlib-users] Asset Swap Calculation Error with IBM 1.25 > 1/29/27 (Settlement Days Issue) > > > Below is the code that calculates the asset swap for *IBM 1.25 1/29/27*, > traded on *April 25, 2024*, at a price of *93.95*. > > When using settleDS = 3, the results are correct: > legNPV1 = 95.179 and fairSPD = 0.359%. > > However, when using settleDS = 2, the calculation produces abnormal > results: > legNPV1 = 100.926 and fairSPD = -1.81%. > > Since the bond should settle on *T+2*, this discrepancy is problematic. > Could someone please help fix this error? > > |
|
From: Aaron De la R. <aar...@gm...> - 2025-10-27 15:14:36
|
Could you share the entire code. So, I can fix it.
Regard
Aaron
________________________________
From: Kenji Ogawa <for...@gm...>
Sent: Sunday, October 26, 2025 6:34 PM
To: Qua...@li... <Qua...@li...>
Subject: [Quantlib-users] Asset Swap Calculation Error with IBM 1.25 1/29/27 (Settlement Days Issue)
Below is the code that calculates the asset swap for IBM 1.25 1/29/27, traded on April 25, 2024, at a price of 93.95.
When using settleDS = 3, the results are correct:
legNPV1 = 95.179 and fairSPD = 0.359%.
However, when using settleDS = 2, the calculation produces abnormal results:
legNPV1 = 100.926 and fairSPD = -1.81%.
Since the bond should settle on T+2, this discrepancy is problematic.
Could someone please help fix this error?
# =====================================================
# Asset swaps - IBM 1.25, Jan 2027
import QuantLib as ql; import pandas as pd; import numpy as np
settleDS = 2
tradeDT = ql.Date(25,4,2024)
settleDT = ql.TARGET().advance(tradeDT, settleDS, ql.Days)
ql.Settings.instance().evaluationDate = tradeDT
# my abbreviation
calEU = ql.TARGET()
dc30 = ql.Thirty360(ql.Thirty360.BondBasis)
dcAAb = ql.ActualActual(ql.ActualActual.Bond)
unADJ = ql.Unadjusted
dtGENb = ql.DateGeneration.Backward
EoMf = False
def sqHDL(xx): return ql.QuoteHandle(ql.SimpleQuote(xx))
# Euribor curve data
crvDATA = [('depo', '6m', 3.825), ('asOBJ', '1y', 3.7), ('asOBJ', '18m', 3.512),
('asOBJ', '2y', 3.378), ('asOBJ', '3y', 3.186), ('asOBJ', '4y', 3.067)]
# Euribor Index
ebCrvHDL = ql.RelinkableYieldTermStructureHandle()
ebrIX = ql.Euribor(ql.Period("6M"), ebCrvHDL)
# Swap Curve
cHelper, ebParRT = [], []
for knd, tnr, rt in crvDATA:
if knd == 'depo': cHelper.append(ql.DepositRateHelper(sqHDL(rt/100),ebrIX))
if knd == 'asOBJ': cHelper.append(ql.SwapRateHelper( sqHDL(rt/100),
ql.Period(tnr), calEU, ql.Annual, ql.ModifiedFollowing, dc30, ebrIX))
ebCrvOBJ = ql.PiecewiseLogLinearDiscount(2, calEU, cHelper, ql.Actual360())
ebCrvHDL.linkTo(ebCrvOBJ)
# bond
effDT, matDT = ql.Date(31,1,2019), ql.Date(29,1,2027)
faceAMT, cpnLST, clnPRC = 100.0, [0.0125], 93.95
bondSCD = ql.Schedule(effDT, matDT, ql.Period(ql.Annual), calEU, unADJ,unADJ, dtGENb, EoMf)
bondOBJ = ql.FixedRateBond(settleDS, faceAMT, bondSCD, cpnLST, dcAAb)
# asset swap
payFix, isPar = True, True
crdSPRD, fltSCH = 35/10000, ql.Schedule()
asOBJ = ql.AssetSwap(payFix,bondOBJ,clnPRC,ebrIX,crdSPRD,fltSCH,ebrIX.dayCounter(),isPar)
asOBJ.setPricingEngine(ql.DiscountingSwapEngine(ebCrvHDL))
print(f' NPV:{asOBJ.NPV(): 10.6f} \n'
f'legNPV0:{asOBJ.legNPV(0): 10.6f} \n'
f'legNPV1:{asOBJ.legNPV(1): 10.6f} \n'
f'fairSPD:{asOBJ.fairSpread(): 10.6%}')
# =====================================================
|
|
From: Luigi B. <lui...@gm...> - 2025-10-27 09:45:09
|
Hello Amine,
currently we're creating bindings to Python, C#, Java and R. We're
using SWIG, which means we're limited to what SWIG supports: some languages
(including Rust, unfortunately) are not supported, and other languages are
supported but don't provide all the features QuantLib requires (e.g.,
support for smart pointers).
Luigi
On Fri, Oct 24, 2025 at 5:23 PM Amine Ifri <ami...@gm...> wrote:
> Hi all,
>
> I was wondering if the C++ library can be used via bindings from languages
> other than Python. Specifically, has anyone ever created bindings for use
> with Rust programming language.
>
> Thanks,
> Amine Ifri
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Kenji O. <for...@gm...> - 2025-10-27 00:34:39
|
Below is the code that calculates the asset swap for *IBM 1.25 1/29/27*,
traded on *April 25, 2024*, at a price of *93.95*.
When using settleDS = 3, the results are correct:
legNPV1 = 95.179 and fairSPD = 0.359%.
However, when using settleDS = 2, the calculation produces abnormal results:
legNPV1 = 100.926 and fairSPD = -1.81%.
Since the bond should settle on *T+2*, this discrepancy is problematic.
Could someone please help fix this error?
# =====================================================
# Asset swaps - IBM 1.25, Jan 2027
import QuantLib as ql; import pandas as pd; import numpy as np
settleDS = 2
tradeDT = ql.Date(25,4,2024)
settleDT = ql.TARGET().advance(tradeDT, settleDS, ql.Days)
ql.Settings.instance().evaluationDate = tradeDT
# my abbreviation
calEU = ql.TARGET()
dc30 = ql.Thirty360(ql.Thirty360.BondBasis)
dcAAb = ql.ActualActual(ql.ActualActual.Bond)
unADJ = ql.Unadjusted
dtGENb = ql.DateGeneration.Backward
EoMf = False
def sqHDL(xx): return ql.QuoteHandle(ql.SimpleQuote(xx))
# Euribor curve data
crvDATA = [('depo', '6m', 3.825), ('asOBJ', '1y', 3.7), ('asOBJ', '18m',
3.512),
('asOBJ', '2y', 3.378), ('asOBJ', '3y', 3.186), ('asOBJ', '4y',
3.067)]
# Euribor Index
ebCrvHDL = ql.RelinkableYieldTermStructureHandle()
ebrIX = ql.Euribor(ql.Period("6M"), ebCrvHDL)
# Swap Curve
cHelper, ebParRT = [], []
for knd, tnr, rt in crvDATA:
if knd == 'depo': cHelper.append(ql.DepositRateHelper(sqHDL(rt/100),
ebrIX))
if knd == 'asOBJ': cHelper.append(ql.SwapRateHelper( sqHDL(rt/100),
ql.Period(tnr), calEU, ql.Annual, ql.ModifiedFollowing, dc30,
ebrIX))
ebCrvOBJ = ql.PiecewiseLogLinearDiscount(2, calEU, cHelper, ql.Actual360())
ebCrvHDL.linkTo(ebCrvOBJ)
# bond
effDT, matDT = ql.Date(31,1,2019), ql.Date(29,1,2027)
faceAMT, cpnLST, clnPRC = 100.0, [0.0125], 93.95
bondSCD = ql.Schedule(effDT, matDT, ql.Period(ql.Annual), calEU, unADJ,unADJ,
dtGENb, EoMf)
bondOBJ = ql.FixedRateBond(settleDS, faceAMT, bondSCD, cpnLST, dcAAb)
# asset swap
payFix, isPar = True, True
crdSPRD, fltSCH = 35/10000, ql.Schedule()
asOBJ = ql.AssetSwap(payFix,bondOBJ,clnPRC,ebrIX,crdSPRD,fltSCH,ebrIX.
dayCounter(),isPar)
asOBJ.setPricingEngine(ql.DiscountingSwapEngine(ebCrvHDL))
print(f' NPV:{asOBJ.NPV(): 10.6f} \n'
f'legNPV0:{asOBJ.legNPV(0): 10.6f} \n'
f'legNPV1:{asOBJ.legNPV(1): 10.6f} \n'
f'fairSPD:{asOBJ.fairSpread(): 10.6%}')
# =====================================================
|
|
From: Amine I. <ami...@gm...> - 2025-10-24 15:22:56
|
Hi all, I was wondering if the C++ library can be used via bindings from languages other than Python. Specifically, has anyone ever created bindings for use with Rust programming language. Thanks, Amine Ifri |
|
From: Brian S. <bri...@gm...> - 2025-10-23 10:50:19
|
Hi, I wonder if Quantlib has any function or method to price Equity Accumulator derivative pricing? Any guidance would be greatly appreciated. Thanks and regards, |
|
From: Luigi B. <lui...@gm...> - 2025-10-14 07:11:39
|
QuantLib 1.40 is available for download at < https://www.quantlib.org/download.shtml>; precompiled binaries are also available from PyPI and NuGet for Python and C# respectively. The list of changes for this release is at < https://github.com/lballabio/QuantLib/releases/tag/v1.40>. 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>. |
|
From: <vee...@gm...> - 2025-10-03 23:01:58
|
Hello all, First time writing this mailing list and as such it's my first time facing the ql API with the goal of having to integrate with its internals. I've tried the LLM route and have scoured the examples here: rkapl123.github.io/QLAnnotatedSource/. Neither approach has led to the necessary certainty i need to proceed; i need a path that's guaranteed to work if i work at it long enough. i really fear hacking away at a flawed approach that eats up time only to have to start over, so to speak, weeks later. So I ask for feedback on any one of the following hopefully relevant questions: *1. Architecture:* The paper underpinning the modelling challenge is linked below (download is available if you search). The approach maintains tree recombination by interpolating option values at dividend dates. Should I: - Create a custom Lattice class that overrides rollback()? - Modify a BinomialEngine subclass? - Or implement a completely separate DiscretizedAsset subclass? Which approach best fits QuantLib's design philosophy? *2. Technical Integration:* For the V-N method, at each dividend date during backward induction, I need to: - Store option values at all tree nodes at time t_D - Interpolate to find values at s-D(s) for each node s - Continue rollback with interpolated values Where in QuantLib's class hierarchy is the appropriate interception point? Should I override rollback(), partialRollback(), preAdjustValuesImpl(), or postAdjustValuesImpl() *3. Practical Experience:* If there is any source code out there you know of which you believe provides reliable answers to any one of the questions above, id greatly appreciate your letting me know. So far my searches haven't returned anything i can be sure is guaranteed to be helpful. My guess is one should inherit from DiscretizedAsset and take special care to implement the postAdjustValuesImpl virtual method. In this case one would have to populate an associated stock lattice, whose values would be exogenously filled, and not as it were, through some composition of a BlackScholesMertonProcess and a BinomialTree. Thanks in advance for your time and help. Veeken peper url: https://doi.org/10.1080/13504860600563077 |
|
From: Dirk E. <ed...@de...> - 2025-10-03 02:13:21
|
On 2 October 2025 at 17:30, Luigi Ballabio wrote: | Hi all, | a release candidate for QuantLib 1.40 is available at < | https://github.com/lballabio/QuantLib/releases/tag/v1.40-rc>. If you have | some time, please try it out and report any issues on GitHub (or here on | the mailing list). Thanks! All good so far with a 1.39.99 (to sort lower than a future 1.40) - Debian experimental, build status at https://buildd.debian.org/status/package.php?p=quantlib&suite=experimental - Ubuntu 24.04 via my ppa at https://launchpad.net/~edd/+archive/ubuntu/misc Dirk -- dirk.eddelbuettel.com | @eddelbuettel | ed...@de... |
|
From: Luigi B. <lui...@gm...> - 2025-10-02 15:31:06
|
Hi all, a release candidate for QuantLib 1.40 is available at < https://github.com/lballabio/QuantLib/releases/tag/v1.40-rc>. If you have some time, please try it out and report any issues on GitHub (or here on the mailing list). Thanks! Luigi |
|
From: 范博伟 <hz...@si...> - 2025-09-23 13:06:56
|
Hi Luigi, We did namage to modify the OvernightIndexedSwap and related methods in C++ and build the FR007 swap class, mainly using xuruilong's example as reference. And yes, FR007 is a main bench market interest rate in China Inter Bank market. It's the real funding rate for most institution in the market. FR007 IRS is the most traded IRS in China IB. It's reset every 1 week as the tenor of FR007. We have most modeling work done in Python. It would be really handy if we can do the calibration in Python too. For now, I managed to write a python version utilizing the FRARateHelper for the quotes and iteratively bootstrapping instruments. Error might be acceptable for some trading purpose. ----- 原始邮件 ----- 发件人:Luigi Ballabio <lui...@gm...> 收件人:hz...@si... 抄送人:quantlib-users <qua...@li...> 主题:Re: Re: [Quantlib-users] Bootstrap non fixed-reset-number floating leg interest rate swap 日期:2025年09月23日 14点35分 Hello, no, there's no such class. One should inherit from RateHelper and code it in C++. Are these instruments the way rates are quoted in your market? Best, Luigi On Mon, Sep 22, 2025 at 4:40 PM "范博伟" <hz...@si...> wrote: Hi Luigi, Thanks for the reply! I check the MultipleResetCoupon and I think I can use that and put a swap together by passing fixedLeg and floatingLeg to ql.Swap, or ql.NonstandardSwap. However, how can I bootstrap from those swaps for discounting curve? I think SwapRateHelper won't take swap as input. Is there any available helper class would help in this case? Thanks. ----- 原始邮件 ----- 发件人:Luigi Ballabio <lui...@gm...> 收件人:hz...@si... 抄送人:quantlib-users <qua...@li...> 主题:Re: [Quantlib-users] Bootstrap non fixed-reset-number floating leg interest rate swap 日期:2025年09月22日 14点24分 Hello, instead of using MultipleResetsLeg, you can instantiate the underlying MultipleResetCoupon instances directly. Each coupon can take its set of reset dates explicitly. Hope this helps, Luigi On Sun, Sep 14, 2025 at 3:10 PM "范博伟" <hz...@si...> wrote: Hi there, I am trying to use python to calibrate interest rate swap in China, which is a bit non-standard as the floating leg is reset weekly and paid quarterly. I am tring to the use the MultipleResetsLeg for the floating leg to construct a swap and do the calibartoin. However, the MultipleResetsLeg has a fixed number of resets per coupon while in real case, the number of resets is not fixed. It could be 12-14 resets per coupon due to the convention and calendar. In C++, we could build the swap from scratch but not sure if we can do that in python, since some api is not exposed. Could anyone help me with the issue. Thanks._______________________________________________ QuantLib-users mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Luigi B. <lui...@gm...> - 2025-09-23 06:35:47
|
Hello,
no, there's no such class. One should inherit from RateHelper and code
it in C++. Are these instruments the way rates are quoted in your market?
Best,
Luigi
On Mon, Sep 22, 2025 at 4:40 PM "范博伟" <hz...@si...> wrote:
> Hi Luigi,
>
> Thanks for the reply!
>
> I check the MultipleResetCoupon and I think I can use that and put a swap
> together by passing fixedLeg and floatingLeg to ql.Swap, or
> ql.NonstandardSwap.
>
> However, how can I bootstrap from those swaps for discounting curve? I
> think SwapRateHelper won't take swap as input.
>
> Is there any available helper class would help in this case?
>
> Thanks.
>
>
> ----- 原始邮件 -----
> 发件人:Luigi Ballabio <lui...@gm...>
> 收件人:hz...@si...
> 抄送人:quantlib-users <qua...@li...>
> 主题:Re: [Quantlib-users] Bootstrap non fixed-reset-number floating leg
> interest rate swap
> 日期:2025年09月22日 14点24分
>
> Hello,
> instead of using MultipleResetsLeg, you can instantiate the underlying
> MultipleResetCoupon instances directly. Each coupon can take its set of
> reset dates explicitly.
>
> Hope this helps,
> Luigi
>
>
> On Sun, Sep 14, 2025 at 3:10 PM "范博伟" <hz...@si...> wrote:
>
> Hi there,
>
> I am trying to use python to calibrate interest rate swap in China, which
> is a bit non-standard as the floating leg is reset weekly and paid
> quarterly.
>
> I am tring to the use the MultipleResetsLeg for the floating leg to
> construct a swap and do the calibartoin. However, the MultipleResetsLeg
> has a fixed number of resets per coupon while in real case, the number of
> resets is not fixed. It could be 12-14 resets per coupon due to the
> convention and calendar.
>
> In C++, we could build the swap from scratch but not sure if we can do
> that in python, since some api is not exposed.
>
> Could anyone help me with the issue. Thanks.
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
|
|
From: 范博伟 <hz...@si...> - 2025-09-22 14:40:30
|
Hi Luigi, Thanks for the reply! I check the MultipleResetCoupon and I think I can use that and put a swap together by passing fixedLeg and floatingLeg to ql.Swap, or ql.NonstandardSwap. However, how can I bootstrap from those swaps for discounting curve? I think SwapRateHelper won't take swap as input. Is there any available helper class would help in this case? Thanks. ----- 原始邮件 ----- 发件人:Luigi Ballabio <lui...@gm...> 收件人:hz...@si... 抄送人:quantlib-users <qua...@li...> 主题:Re: [Quantlib-users] Bootstrap non fixed-reset-number floating leg interest rate swap 日期:2025年09月22日 14点24分 Hello, instead of using MultipleResetsLeg, you can instantiate the underlying MultipleResetCoupon instances directly. Each coupon can take its set of reset dates explicitly. Hope this helps, Luigi On Sun, Sep 14, 2025 at 3:10 PM "范博伟" <hz...@si...> wrote: Hi there, I am trying to use python to calibrate interest rate swap in China, which is a bit non-standard as the floating leg is reset weekly and paid quarterly. I am tring to the use the MultipleResetsLeg for the floating leg to construct a swap and do the calibartoin. However, the MultipleResetsLeg has a fixed number of resets per coupon while in real case, the number of resets is not fixed. It could be 12-14 resets per coupon due to the convention and calendar. In C++, we could build the swap from scratch but not sure if we can do that in python, since some api is not exposed. Could anyone help me with the issue. Thanks._______________________________________________ QuantLib-users mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Luigi B. <lui...@gm...> - 2025-09-22 06:24:21
|
Hello,
instead of using MultipleResetsLeg, you can instantiate the underlying
MultipleResetCoupon instances directly. Each coupon can take its set of
reset dates explicitly.
Hope this helps,
Luigi
On Sun, Sep 14, 2025 at 3:10 PM "范博伟" <hz...@si...> wrote:
> Hi there,
>
> I am trying to use python to calibrate interest rate swap in China, which
> is a bit non-standard as the floating leg is reset weekly and paid
> quarterly.
>
> I am tring to the use the MultipleResetsLeg for the floating leg to
> construct a swap and do the calibartoin. However, the MultipleResetsLeg
> has a fixed number of resets per coupon while in real case, the number of
> resets is not fixed. It could be 12-14 resets per coupon due to the
> convention and calendar.
>
> In C++, we could build the swap from scratch but not sure if we can do
> that in python, since some api is not exposed.
>
> Could anyone help me with the issue. Thanks.
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Kenji O. <for...@gm...> - 2025-09-20 03:26:22
|
When I calculate the couponLegNPV of a CDS using a toy model, the result is
*-86,462.44*.
However, when I compute it from the cashflow table, I obtain *-86,421.46*,
which differs by about 40 USD.
On the other hand, the value of defaultLegNPV matches exactly with the one
obtained from the cashflow table.
(This calculation from the cashflow table also matches Bloomberg’s result.)
Below I attach my code.
Any explanation or guidance would be greatly appreciated.
# =====================================================
import QuantLib as ql; import pandas as pd; import numpy as np
# (1) QL abbreviation and trade data
dcA365, dcA360, pdFreqQ, calWK
= \
ql.Actual365Fixed(), ql.Actual360(), ql.Period(ql.Quarterly), ql.
WeekendsOnly()
FLLW, unADJ, dtGENf, EoMf, bP
= \
ql.Following, ql.Unadjusted, ql.DateGeneration.Forward, False, ql.Protection
.Buyer
def sqHDL(xx): return ql.QuoteHandle(ql.SimpleQuote(xx))
#
matDT, ntlAMT, rfRT, cdsQT,
=\
ql.Date(20,9,2023), 10_000_000, 0.10, 0.13
tradeDT = ql.Date(19,9,2022) ; ql.Settings.instance().evaluationDate =
tradeDT
cdsSCD = ql.Schedule(tradeDT+1, matDT, pdFreqQ, calWK, FLLW, unADJ, dtGENf,
EoMf)
# (2) DF,hazardRate
dsCvOBJ = ql.FlatForward (tradeDT, rfRT, dcA365)
dsCvHDL = ql.YieldTermStructureHandle (dsCvOBJ)
hzdRT = cdsQT/(1-0.35)
hzCvOBJ = ql.FlatHazardRate (tradeDT,sqHDL(hzdRT), dcA365)
hzCvHDL = ql.DefaultProbabilityTermStructureHandle(hzCvOBJ)
# (3).cds legNPV
cdsOBJ = ql.CreditDefaultSwap(bP, ntlAMT, 0.01, cdsSCD, FLLW, dcA360)
midENG = ql.MidPointCdsEngine(hzCvHDL, 0.35, dsCvHDL)
cdsOBJ.setPricingEngine(midENG)
impHzdRT = cdsOBJ.impliedHazardRate(cdsOBJ.NPV(), dsCvHDL, dcA365, 0.35)
# print
np.set_printoptions(precision=6)
print(
f'couponLegNPV :{cdsOBJ.couponLegNPV() :,.2f}, '
f'defaultLegNPV :{cdsOBJ.defaultLegNPV():,.2f}, '
f'NPV :{cdsOBJ.NPV() :,.2f} ' '\n'
f'tradeDate :{cdsOBJ.tradeDate().ISO():}, '
f'hazardRate :{hzdRT :.6%}, '
f'imp.HazardRate :{impHzdRT :.6%} ' )
#=====================================================
# (4) make Cashflow table function
def makeDataFrame() :
dfCDS = pd.DataFrame({
'payDate': cpn.date(),
'coupon': cpn.rate(),
'accStt': cpn.accrualStartDate().ISO(),
'accEnd': cpn.accrualEndDate(),
'days': cpn.amount()/(ntlAMT*cpn.rate() /360),
'YF': cpn.amount()/(ntlAMT*cpn.rate()*365/360),
'amount': cpn.amount(),
} for cpn in map(ql.as_coupon, cdsOBJ.coupons()))
# effective Date
dfEFF = pd.DataFrame([{'payDate': cdsOBJ.protectionStartDate(),
'accEnd': cdsOBJ.protectionStartDate()}],columns
=dfCDS.columns)
dfCDS = pd.concat([dfEFF, dfCDS], ignore_index=True)
# DF
fuDF = [dsCvOBJ.discount(dt) for dt in dfCDS.accEnd] #future DF
dfCDS = pd.concat([dfCDS, pd.DataFrame(fuDF, columns=['DF']) ], axis=1)
# Q and dQ
fuQ = [hzCvOBJ.survivalProbability(dt) for dt in dfCDS.accEnd]
dfCDS = pd.concat([dfCDS, pd.DataFrame(fuQ, columns=['Q']) ], axis=1)
dQ = np.insert(np.diff(dfCDS.Q)*(-1), 0, 0)
dfCDS = pd.concat([dfCDS, pd.DataFrame( dict(dQ=dQ)) ], axis=1)
# midpoint calc
midDTs = dfCDS.payDate[:-1]+(np.diff(dfCDS.payDate)/2).astype('int')
midDFs = [dsCvOBJ.discount(dd) for dd in midDTs]
midQs = [hzCvOBJ.survivalProbability(dd) for dd in midDTs]
dfDFQm = pd.DataFrame( dict(mDate=midDTs, mDF=midDFs, mQ=midQs))
dfDFQm.mDate = dfDFQm.mDate.map(lambda x: x.ISO())
dfDFQm = pd.concat([pd.DataFrame(columns=['mDate'],index=[0]), #empty
row
dfDFQm],ignore_index
=True)
dfCDS = pd.concat([dfCDS, dfDFQm ], axis=1)
return dfCDS
#(5) NPV handCalc
dfCDS = makeDataFrame()
hcCpnLEG = -(dfCDS.amount * dfCDS.DF * dfCDS.mQ).sum()
hcDftLEG = (1-0.35) *(dfCDS.mDF* dfCDS.dQ).sum()
hcNPV = hcCpnLEG + hcDftLEG*ntlAMT
print(f'(hc)cpnLegNPV: {hcCpnLEG:,.2f}, '
f'(hc)dftLegNPV: {hcDftLEG*ntlAMT:,.2f}, '
f'(hc)NPV: {hcNPV:,.2f}')
display(dfCDS)
#=====================================================
|
|
From: 范博伟 <hz...@si...> - 2025-09-14 13:10:02
|
Hi there, I am trying to use python to calibrate interest rate swap in China, which is a bit non-standard as the floating leg is reset weekly and paid quarterly. I am tring to the use the MultipleResetsLeg for the floating leg to construct a swap and do the calibartoin. However, the MultipleResetsLeg has a fixed number of resets per coupon while in real case, the number of resets is not fixed. It could be 12-14 resets per coupon due to the convention and calendar. In C++, we could build the swap from scratch but not sure if we can do that in python, since some api is not exposed. Could anyone help me with the issue. Thanks. |
|
From: Stats S. <sta...@gm...> - 2025-07-30 11:23:07
|
Thanks, Luigi. Will do.
On Fri, Jul 25, 2025 at 7:04 PM Luigi Ballabio <lui...@gm...>
wrote:
> Hi—it turns out that the rates coming out of the spreaded curve are not as
> expected. If you calculate the original rates from the curve and then add
> the spread, as you did in your sample code, you get
>
> >>> zero_rates = [ handle.zeroRate( l.date(), daycount, ql.Compounded,
> ql.Monthly ).rate() for ii,l in enumerate(leg) ]
> >>> print([r + zspread for r in zero_rates])
> [0.054693695527939915, 0.05243448138456887]
>
> while if you extract the same rates from the spreaded curve you get
>
> >>> print([ zspreaded_handle.zeroRate( l.date(), daycount, ql.Compounded,
> ql.Monthly ).rate() for ii,l in enumerate(leg) ])
> [0.05502806821107864, 0.05226732979489501]
>
> The problem seems to be that the curve and the added spread have two
> different day counters (act/360 for the curve and 30/360 for the spread)
> and somehow ZeroSpreadedTermStructure fails to account for that. If the
> two day counters are the same (either both 30/360 or both act/360) the
> problem disappears, which is probably why nobody noticed until now.
>
> May you open an issue on GitHub so someone can pick it up and analyse it
> further? Thanks!
>
> Luigi
>
>
>
> On Tue, Jun 10, 2025 at 6:17 AM Stats Student <sta...@gm...>
> wrote:
>
>> Hi - I have been trying to use the spread from ql.CashFlows.zSpread to
>> discount cash flows. I am able to use it in ZeroSpreadedTermStructure and
>> get the right numbers.
>> But I would like to understand how to replicate the same output by hand.
>> The NPV I get is very close, but there is still a small difference which I
>> suspect will likely get bigger over longer periods.
>>
>> Does anyone know what is causing this discrepancy? Thanks in advance.
>>
>>
>>
>> zspread: 0.009989751634951987 ( from ql.CashFlows.zSpread )
>>
>>
>> zSpread / ZeroSpreadedTermStructure npv: 198.6780*623718125 (CORRECT)*
>>
>>
>> zSpread manual npv: 198.6780*7379166345*
>>
>>
>>
>> ###########################################
>>
>>
>> import QuantLib as ql
>>
>> daycount = ql.Thirty360(ql.Thirty360.USA)
>>
>> start = ql.Date(1, 1, 2025)
>>
>> ql.Settings.instance().evaluationDate = start
>>
>> rates = ( ['SOFR1D', 4.3564348072], ['SOFR1W', 4.3493027605], ['SOFR1M',
>> 4.3238954677], ['SOFR3M', 4.3084328938], ['SOFR6M', 4.2045895664] )
>>
>> sofr_index = ql.Sofr()
>>
>> ois_helpers = []
>>
>> for period, rate in rates:
>> tenor = period.replace('SOFR','')
>> ois_helpers.append( ql.OISRateHelper(0,
>> ql.Period ( tenor ),
>>
>> ql.QuoteHandle(ql.SimpleQuote(rate/100)),
>> sofr_index) )
>>
>> curve = ql.PiecewiseLogCubicDiscount( start, ois_helpers, ql.Actual360() )
>>
>> handle = ql.YieldTermStructureHandle( curve )
>>
>> leg = ql.Leg( [ ql.SimpleCashFlow( 100, ql.Date(1,2,2025) ),
>> ql.SimpleCashFlow( 100, ql.Date(1,3,2025) ) ] )
>>
>> spreaded_npv = 198.6780623718125
>>
>> zspread = ql.CashFlows.zSpread(leg, spreaded_npv, curve, daycount,
>> ql.Compounded, ql.Monthly, True)
>>
>> print(f"zspread: {zspread}") # zspread: 0.009989751634951987
>>
>> zspread_quote = ql.SimpleQuote( zspread )
>>
>> zspreaded_curve = ql.ZeroSpreadedTermStructure( handle,
>> ql.QuoteHandle(zspread_quote), ql.Compounded, ql.Monthly, daycount )
>>
>> zspreaded_handle = ql.YieldTermStructureHandle( zspreaded_curve )
>>
>> zspreaded_npv = ql.CashFlows.npv(leg, zspreaded_handle, True)
>>
>> print(f"zSpread ZeroSpreadedTermStructure npv: {zspreaded_npv}") # zSpread
>> npv: 198.6780623718125 (MATCH)
>>
>> zero_rates = [ handle.zeroRate( l.date(), daycount, ql.Compounded,
>> ql.Monthly ).rate() for ii,l in enumerate(leg) ]
>>
>> # zero_rates = [ handle.zeroRate( (ii+1)/12, ql.Compounded, ql.Monthly
>> ).rate() for ii,l in enumerate(leg) ] # 198.67814955576728 (BIGGER
>> DELTA)
>>
>> zpread_manual_npv = 100 / (1 + (zero_rates[0] + zspread) / 12) + 100 / (
>> 1 + (zero_rates[1] + zspread) / 12 ) ** 2
>>
>> print(f"zSpread manual npv: {zpread_manual_npv}\n") # manual zSpread
>> npv: 198.67807379166345 (*NO MATCH*)
>>
>>
>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|
|
From: Luigi B. <lui...@gm...> - 2025-07-25 15:04:43
|
Hi—it turns out that the rates coming out of the spreaded curve are not as
expected. If you calculate the original rates from the curve and then add
the spread, as you did in your sample code, you get
>>> zero_rates = [ handle.zeroRate( l.date(), daycount, ql.Compounded,
ql.Monthly ).rate() for ii,l in enumerate(leg) ]
>>> print([r + zspread for r in zero_rates])
[0.054693695527939915, 0.05243448138456887]
while if you extract the same rates from the spreaded curve you get
>>> print([ zspreaded_handle.zeroRate( l.date(), daycount, ql.Compounded,
ql.Monthly ).rate() for ii,l in enumerate(leg) ])
[0.05502806821107864, 0.05226732979489501]
The problem seems to be that the curve and the added spread have two
different day counters (act/360 for the curve and 30/360 for the spread)
and somehow ZeroSpreadedTermStructure fails to account for that. If the
two day counters are the same (either both 30/360 or both act/360) the
problem disappears, which is probably why nobody noticed until now.
May you open an issue on GitHub so someone can pick it up and analyse it
further? Thanks!
Luigi
On Tue, Jun 10, 2025 at 6:17 AM Stats Student <sta...@gm...>
wrote:
> Hi - I have been trying to use the spread from ql.CashFlows.zSpread to
> discount cash flows. I am able to use it in ZeroSpreadedTermStructure and
> get the right numbers.
> But I would like to understand how to replicate the same output by hand.
> The NPV I get is very close, but there is still a small difference which I
> suspect will likely get bigger over longer periods.
>
> Does anyone know what is causing this discrepancy? Thanks in advance.
>
>
>
> zspread: 0.009989751634951987 ( from ql.CashFlows.zSpread )
>
>
> zSpread / ZeroSpreadedTermStructure npv: 198.6780*623718125 (CORRECT)*
>
>
> zSpread manual npv: 198.6780*7379166345*
>
>
>
> ###########################################
>
>
> import QuantLib as ql
>
> daycount = ql.Thirty360(ql.Thirty360.USA)
>
> start = ql.Date(1, 1, 2025)
>
> ql.Settings.instance().evaluationDate = start
>
> rates = ( ['SOFR1D', 4.3564348072], ['SOFR1W', 4.3493027605], ['SOFR1M',
> 4.3238954677], ['SOFR3M', 4.3084328938], ['SOFR6M', 4.2045895664] )
>
> sofr_index = ql.Sofr()
>
> ois_helpers = []
>
> for period, rate in rates:
> tenor = period.replace('SOFR','')
> ois_helpers.append( ql.OISRateHelper(0,
> ql.Period ( tenor ),
>
> ql.QuoteHandle(ql.SimpleQuote(rate/100)),
> sofr_index) )
>
> curve = ql.PiecewiseLogCubicDiscount( start, ois_helpers, ql.Actual360() )
>
> handle = ql.YieldTermStructureHandle( curve )
>
> leg = ql.Leg( [ ql.SimpleCashFlow( 100, ql.Date(1,2,2025) ),
> ql.SimpleCashFlow( 100, ql.Date(1,3,2025) ) ] )
>
> spreaded_npv = 198.6780623718125
>
> zspread = ql.CashFlows.zSpread(leg, spreaded_npv, curve, daycount,
> ql.Compounded, ql.Monthly, True)
>
> print(f"zspread: {zspread}") # zspread: 0.009989751634951987
>
> zspread_quote = ql.SimpleQuote( zspread )
>
> zspreaded_curve = ql.ZeroSpreadedTermStructure( handle,
> ql.QuoteHandle(zspread_quote), ql.Compounded, ql.Monthly, daycount )
>
> zspreaded_handle = ql.YieldTermStructureHandle( zspreaded_curve )
>
> zspreaded_npv = ql.CashFlows.npv(leg, zspreaded_handle, True)
>
> print(f"zSpread ZeroSpreadedTermStructure npv: {zspreaded_npv}") # zSpread
> npv: 198.6780623718125 (MATCH)
>
> zero_rates = [ handle.zeroRate( l.date(), daycount, ql.Compounded,
> ql.Monthly ).rate() for ii,l in enumerate(leg) ]
>
> # zero_rates = [ handle.zeroRate( (ii+1)/12, ql.Compounded, ql.Monthly
> ).rate() for ii,l in enumerate(leg) ] # 198.67814955576728 (BIGGER
> DELTA)
>
> zpread_manual_npv = 100 / (1 + (zero_rates[0] + zspread) / 12) + 100 / ( 1
> + (zero_rates[1] + zspread) / 12 ) ** 2
>
> print(f"zSpread manual npv: {zpread_manual_npv}\n") # manual zSpread npv:
> 198.67807379166345 (*NO MATCH*)
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2025-07-23 10:25:18
|
QuantLib 1.39 is available for download at < https://www.quantlib.org/download.shtml>; precompiled binaries are also available from PyPI and NuGet for Python and C# respectively. The list of changes for this release is at < https://www.quantlib.org/reference/history.html>. Note that a few recent versions of the Visual C++ 2022 compiler (from 17.14.2 to 17.14.8) had a known bug that, unfortunately, affected QuantLib heavily and made it basically unusable. A fix was released in version 17.14.9; if you’re compiling QuantLib on Windows, make sure you're using at least that version (or, if you can't upgrade, use the Visual C++ 2019 toolset; you can do that from VC++ 2022, as well). Due to this, Python wheels for Windows are not yet available; they will be shortly, when GitHub action runners upgrade to the latest VC++ version. 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>. |
|
From: Luigi B. <lui...@gm...> - 2025-07-19 20:18:37
|
Hi Aaron,
we use Boost 1.86 in our automated builds, as well as the latest 1.88.
QuantLib 1.38 builds and tests correctly with both (see
https://github.com/lballabio/QuantLib/actions/runs/16391531677/job/46318150792
or
https://github.com/lballabio/QuantLib/actions/runs/16391531677/job/46318150804
for a couple of examples on Linux, but we run similar checks for Visual
C++). The same goes for the code that will be released shortly as version
1.39.
What compiler are you using? Do you get build errors while compiling
QuantLib itself, or while compiling some code of yours that uses it? In
any case, I'll need to see your compilation log to check what the issue is.
Best,
Luigi
On Sat, Jul 19, 2025 at 1:52 AM Aaron De la Rosa <aar...@gm...>
wrote:
> Luigi
>
> There are some issues related to QuantLib and Boost. I can't build a
> project using QuantLib 1.38 and Boost 1.86. There's no compatibility.
> Boost 1.86 introduced some *template-related breaking changes* (especially
> in accumulators), which older QuantLib versions (like 1.38) were not
> designed to handle. QuantLib 1.38 is not fully compatible with Boost 1.86
> — errors stem from Boost's accumulators headers and deprecated
> SpreadOption usage.
>
> What about QuantLib 1.39? QuantLib 1.39 could include better
> compatibility with newer Boost versions. what do you think?
>
> Regards
>
> Aaron
>
>
|