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: Marcin R. <mry...@gm...> - 2024-05-18 19:39:22
|
Hi everyone, As already pointed out by Peter and Ioannis, the helper utilizes the fact that, for a par instrument, the ratio of foreign vs domestic notionals is equal to the market spot rate. Hence, they cancel each other out and the FX spot rate is not really needed. Nk, to make your example work for a SOFR-SONIA swap you will have to create two proxy Ibor indices (instead of using overnight ones) with 3m period each for SOFR and SONIA, respectively. Given that both SOFR and SONIA legs use compounded rate averaging, they collapse to Ibor-type coupons anyway - this property will apply to coupons that have not started accruing yet, which for a par instrument applies to all. This should result in a GBP curve under USD collateralization you’re looking for. We might consider improving the helper by adding a constructor that takes an overnight index and payment frequency as parameters. Hope this helps. Regards, Marcin On Sat, 18 May 2024 at 21:08, Ioannis Rigopoulos <qua...@de...> wrote: > The baseCurrencyIndex and quoteCurrencyIndex imply the frequency per each > floating leg. > On 5/18/2024 8:53 PM, Quant wrote: > > Thanks loannis, what about the payment frequency is it not required in ql. > ConstNotionalCrossCurrencyBasisSwapRateHelper() for bootstrapping? > > Thanks, > Nk > > On Sat, 18 May 2024 at 20:25, Ioannis Rigopoulos <qua...@de...> > wrote: > >> Hi Peter and NK >> >> For some reason, the email I sent quite some time ago did not go through. >> Perhaps because of the link insertion. I repeat it below: >> >> The spot rate is not needed. Explanation at >> https://www.deriscope.com/products/Key_Yield_Curve_Fxb__Spot.html that >> describes the spot rate input in the construction of a curve out of xccy >> basis spreads. >> In effect, any assumed spot rate cancels out due to for any given two >> currencies SRC and TGT, the corresponding legs in a currency swap have >> differing notionals Nˢʳᶜ and Nᵗᵍᵗ that satisfy: >> >> Nˢʳᶜ/Nᵗᵍᵗ = s := spot fx rate TGT/SRC >> >> Ioannis >> On 5/18/2024 8:12 PM, Quant wrote: >> >> Hi Peter, >> >> So do you agree that we need to have the following additional arguments >> in >> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(); >> >> 1. quote FX rate - so that 1 is used as the notional of one leg and the >> quote FX rate is used as notional on the other leg >> >> 2. payment frequency - so that the number of payment frequency is known >> for each leg during the bootstrapping process. >> >> Happy to get your opinion on this. >> >> Thanks & regards, >> Nk >> >> On Sat, 18 May 2024 at 19:57, Peter Caspers <pca...@gm...> >> wrote: >> >>> It does make sense, I was confused as well. >>> >>> I think both the domestic and foreign leg are set up with the same >>> notional 1.0. I.e. the conversion of the foreign leg’s npv to domestic >>> currency is done implicitly by using identical nationals. I.e. we exploit >>> the fact that the fx spot rate is the same as the ratio of nationals of the >>> two legs. Therefore the fx spot is not needed to set up the helper. Smart. >>> >>> On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote: >>> >>> Hi Peter, >>> >>> No, the spot fx is not declared anywhere in the bootstrapping hence my >>> first question was why we don’t have an argument for the quote FX rate >>> which would be used as the implied notional. Not sure if it’s making sense. >>> >>> Thanks & regards, >>> Nk >>> >>> On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm...> >>> wrote: >>> >>>> I guess spot fx is somewhat implicit in the (initial) notionals of the >>>> two legs? >>>> Peter >>>> >>>> On Fri, 17 May 2024 at 03:34, Ben Watson < >>>> ben...@ma...> wrote: >>>> > >>>> > cross currency basis is a spread over a floating index. We use this >>>> to bootstrap curves. It is a direct quote, and no need for a spot FX rate. >>>> > >>>> > The contrast is when we imply a basis over a floating index from >>>> forward fx pips. In this case we need spot fx. >>>> > >>>> > Ben >>>> > >>>> > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: >>>> >> >>>> >> Hi Quantlib users, >>>> >> >>>> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown >>>> below, are we not supposed to have an argument for the quote FX rate? If >>>> not how do we adjust for the spot FX rate when bootstrapping the basis >>>> adjusted discount curve? Not sure if my question makes sense >>>> >> >>>> >> >>>> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >>>> >> >>>> >> Thanks & regards, >>>> >> Nk >>>> >> _______________________________________________ >>>> >> 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 lis...@li...://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> >> >> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> Virus-free.www.avast.com >> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> <#m_-1964979119827994335_m_4381154520716188394_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Ioannis R. <qua...@de...> - 2024-05-18 19:07:33
|
The baseCurrencyIndex and quoteCurrencyIndex imply the frequency per each floating leg. On 5/18/2024 8:53 PM, Quant wrote: > Thanks loannis, what about the payment frequency is it not required in > ql.ConstNotionalCrossCurrencyBasisSwapRateHelper() for bootstrapping? > > Thanks, > Nk > > On Sat, 18 May 2024 at 20:25, Ioannis Rigopoulos > <qua...@de...> wrote: > > Hi Peter and NK > > For some reason, the email I sent quite some time ago did not go > through. Perhaps because of the link insertion. I repeat it below: > > The spot rate is not needed. Explanation at > https://www.deriscope.com/products/Key_Yield_Curve_Fxb__Spot.html > that describes the spot rate input in the construction of a curve > out of xccy basis spreads. > > In effect, any assumed spot rate cancels out due to for any given > two currencies SRC and TGT, the corresponding legs in a currency > swap have differing notionals Nˢʳᶜ and Nᵗᵍᵗ that satisfy: > > Nˢʳᶜ/Nᵗᵍᵗ = s := spot fx rate TGT/SRC > > Ioannis > > On 5/18/2024 8:12 PM, Quant wrote: >> Hi Peter, >> >> So do you agree that we need to have the following additional >> arguments in >> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(); >> >> 1. quote FX rate - so that 1 is used as the notional of one leg >> and the quote FX rate is used as notional on the other leg >> >> 2. payment frequency - so that the number of payment frequency is >> known for each leg during the bootstrapping process. >> >> Happy to get your opinion on this. >> >> Thanks & regards, >> Nk >> >> On Sat, 18 May 2024 at 19:57, Peter Caspers >> <pca...@gm...> wrote: >> >> It does make sense, I was confused as well. >> >> I think both the domestic and foreign leg are set up with the >> same notional 1.0. I.e. the conversion of the foreign leg’s >> npv to domestic currency is done implicitly by using >> identical nationals. I.e. we exploit the fact that the fx >> spot rate is the same as the ratio of nationals of the two >> legs. Therefore the fx spot is not needed to set up the >> helper. Smart. >> >>> On 18. May 2024, at 18:41, Quant <qua...@gm...> >>> wrote: >>> >>> Hi Peter, >>> >>> No, the spot fx is not declared anywhere in the >>> bootstrapping hence my first question was why we don’t have >>> an argument for the quote FX rate which would be used as the >>> implied notional. Not sure if it’s making sense. >>> >>> Thanks & regards, >>> Nk >>> >>> On Sat, 18 May 2024 at 18:28, Peter Caspers >>> <pca...@gm...> wrote: >>> >>> I guess spot fx is somewhat implicit in the (initial) >>> notionals of the two legs? >>> Peter >>> >>> On Fri, 17 May 2024 at 03:34, Ben Watson >>> <ben...@ma...> wrote: >>> > >>> > cross currency basis is a spread over a floating >>> index. We use this to bootstrap curves. It is a direct >>> quote, and no need for a spot FX rate. >>> > >>> > The contrast is when we imply a basis over a floating >>> index from forward fx pips. In this case we need spot fx. >>> > >>> > Ben >>> > >>> > On Fri, 17 May 2024, 6:16 am Quant, >>> <qua...@gm...> wrote: >>> >> >>> >> Hi Quantlib users, >>> >> >>> >> When using >>> ql.ConstNotionalCrossCurrencySwapRateHelper() shown >>> below, are we not supposed to have an argument for the >>> quote FX rate? If not how do we adjust for the spot FX >>> rate when bootstrapping the basis adjusted discount >>> curve? Not sure if my question makes sense >>> >> >>> >> >>> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >>> >> >>> >> Thanks & regards, >>> >> Nk >>> >> _______________________________________________ >>> >> 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 > > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free.www.avast.com > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > > <#m_4381154520716188394_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > -- This email has been checked for viruses by Avast antivirus software. www.avast.com |
|
From: Quant <qua...@gm...> - 2024-05-18 18:53:39
|
Thanks loannis, what about the payment frequency is it not required in ql. ConstNotionalCrossCurrencyBasisSwapRateHelper() for bootstrapping? Thanks, Nk On Sat, 18 May 2024 at 20:25, Ioannis Rigopoulos <qua...@de...> wrote: > Hi Peter and NK > > For some reason, the email I sent quite some time ago did not go through. > Perhaps because of the link insertion. I repeat it below: > > The spot rate is not needed. Explanation at > https://www.deriscope.com/products/Key_Yield_Curve_Fxb__Spot.html that > describes the spot rate input in the construction of a curve out of xccy > basis spreads. > In effect, any assumed spot rate cancels out due to for any given two > currencies SRC and TGT, the corresponding legs in a currency swap have > differing notionals Nˢʳᶜ and Nᵗᵍᵗ that satisfy: > > Nˢʳᶜ/Nᵗᵍᵗ = s := spot fx rate TGT/SRC > > Ioannis > > On 5/18/2024 8:12 PM, Quant wrote: > > Hi Peter, > > So do you agree that we need to have the following additional arguments > in > ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(); > > 1. quote FX rate - so that 1 is used as the notional of one leg and the > quote FX rate is used as notional on the other leg > > 2. payment frequency - so that the number of payment frequency is known > for each leg during the bootstrapping process. > > Happy to get your opinion on this. > > Thanks & regards, > Nk > > On Sat, 18 May 2024 at 19:57, Peter Caspers <pca...@gm...> > wrote: > >> It does make sense, I was confused as well. >> >> I think both the domestic and foreign leg are set up with the same >> notional 1.0. I.e. the conversion of the foreign leg’s npv to domestic >> currency is done implicitly by using identical nationals. I.e. we exploit >> the fact that the fx spot rate is the same as the ratio of nationals of the >> two legs. Therefore the fx spot is not needed to set up the helper. Smart. >> >> On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote: >> >> Hi Peter, >> >> No, the spot fx is not declared anywhere in the bootstrapping hence my >> first question was why we don’t have an argument for the quote FX rate >> which would be used as the implied notional. Not sure if it’s making sense. >> >> Thanks & regards, >> Nk >> >> On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm...> >> wrote: >> >>> I guess spot fx is somewhat implicit in the (initial) notionals of the >>> two legs? >>> Peter >>> >>> On Fri, 17 May 2024 at 03:34, Ben Watson <ben...@ma...> >>> wrote: >>> > >>> > cross currency basis is a spread over a floating index. We use this to >>> bootstrap curves. It is a direct quote, and no need for a spot FX rate. >>> > >>> > The contrast is when we imply a basis over a floating index from >>> forward fx pips. In this case we need spot fx. >>> > >>> > Ben >>> > >>> > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: >>> >> >>> >> Hi Quantlib users, >>> >> >>> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, >>> are we not supposed to have an argument for the quote FX rate? If not how >>> do we adjust for the spot FX rate when bootstrapping the basis adjusted >>> discount curve? Not sure if my question makes sense >>> >> >>> >> >>> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >>> >> >>> >> Thanks & regards, >>> >> Nk >>> >> _______________________________________________ >>> >> 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 lis...@li...://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free.www.avast.com > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_4381154520716188394_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > |
|
From: Ioannis R. <qua...@de...> - 2024-05-18 18:25:35
|
Hi Peter and NK For some reason, the email I sent quite some time ago did not go through. Perhaps because of the link insertion. I repeat it below: The spot rate is not needed. Explanation at https://www.deriscope.com/products/Key_Yield_Curve_Fxb__Spot.html that describes the spot rate input in the construction of a curve out of xccy basis spreads. In effect, any assumed spot rate cancels out due to for any given two currencies SRC and TGT, the corresponding legs in a currency swap have differing notionals Nˢʳᶜ and Nᵗᵍᵗ that satisfy: Nˢʳᶜ/Nᵗᵍᵗ = s := spot fx rate TGT/SRC Ioannis On 5/18/2024 8:12 PM, Quant wrote: > Hi Peter, > > So do you agree that we need to have the following additional > arguments in > ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(); > > 1. quote FX rate - so that 1 is used as the notional of one leg and > the quote FX rate is used as notional on the other leg > > 2. payment frequency - so that the number of payment frequency is > known for each leg during the bootstrapping process. > > Happy to get your opinion on this. > > Thanks & regards, > Nk > > On Sat, 18 May 2024 at 19:57, Peter Caspers <pca...@gm...> > wrote: > > It does make sense, I was confused as well. > > I think both the domestic and foreign leg are set up with the same > notional 1.0. I.e. the conversion of the foreign leg’s npv to > domestic currency is done implicitly by using identical nationals. > I.e. we exploit the fact that the fx spot rate is the same as the > ratio of nationals of the two legs. Therefore the fx spot is not > needed to set up the helper. Smart. > >> On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote: >> >> Hi Peter, >> >> No, the spot fx is not declared anywhere in the bootstrapping >> hence my first question was why we don’t have an argument for the >> quote FX rate which would be used as the implied notional. Not >> sure if it’s making sense. >> >> Thanks & regards, >> Nk >> >> On Sat, 18 May 2024 at 18:28, Peter Caspers >> <pca...@gm...> wrote: >> >> I guess spot fx is somewhat implicit in the (initial) >> notionals of the two legs? >> Peter >> >> On Fri, 17 May 2024 at 03:34, Ben Watson >> <ben...@ma...> wrote: >> > >> > cross currency basis is a spread over a floating index. We >> use this to bootstrap curves. It is a direct quote, and no >> need for a spot FX rate. >> > >> > The contrast is when we imply a basis over a floating index >> from forward fx pips. In this case we need spot fx. >> > >> > Ben >> > >> > On Fri, 17 May 2024, 6:16 am Quant, >> <qua...@gm...> wrote: >> >> >> >> Hi Quantlib users, >> >> >> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() >> shown below, are we not supposed to have an argument for the >> quote FX rate? If not how do we adjust for the spot FX rate >> when bootstrapping the basis adjusted discount curve? Not >> sure if my question makes sense >> >> >> >> >> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >> >> >> >> Thanks & regards, >> >> Nk >> >> _______________________________________________ >> >> 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 -- This email has been checked for viruses by Avast antivirus software. www.avast.com |
|
From: Quant <qua...@gm...> - 2024-05-18 18:13:08
|
Hi Peter, So do you agree that we need to have the following additional arguments in ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(); 1. quote FX rate - so that 1 is used as the notional of one leg and the quote FX rate is used as notional on the other leg 2. payment frequency - so that the number of payment frequency is known for each leg during the bootstrapping process. Happy to get your opinion on this. Thanks & regards, Nk On Sat, 18 May 2024 at 19:57, Peter Caspers <pca...@gm...> wrote: > It does make sense, I was confused as well. > > I think both the domestic and foreign leg are set up with the same > notional 1.0. I.e. the conversion of the foreign leg’s npv to domestic > currency is done implicitly by using identical nationals. I.e. we exploit > the fact that the fx spot rate is the same as the ratio of nationals of the > two legs. Therefore the fx spot is not needed to set up the helper. Smart. > > On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote: > > Hi Peter, > > No, the spot fx is not declared anywhere in the bootstrapping hence my > first question was why we don’t have an argument for the quote FX rate > which would be used as the implied notional. Not sure if it’s making sense. > > Thanks & regards, > Nk > > On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm...> > wrote: > >> I guess spot fx is somewhat implicit in the (initial) notionals of the >> two legs? >> Peter >> >> On Fri, 17 May 2024 at 03:34, Ben Watson <ben...@ma...> >> wrote: >> > >> > cross currency basis is a spread over a floating index. We use this to >> bootstrap curves. It is a direct quote, and no need for a spot FX rate. >> > >> > The contrast is when we imply a basis over a floating index from >> forward fx pips. In this case we need spot fx. >> > >> > Ben >> > >> > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: >> >> >> >> Hi Quantlib users, >> >> >> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, >> are we not supposed to have an argument for the quote FX rate? If not how >> do we adjust for the spot FX rate when bootstrapping the basis adjusted >> discount curve? Not sure if my question makes sense >> >> >> >> >> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >> >> >> >> Thanks & regards, >> >> Nk >> >> _______________________________________________ >> >> 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: Peter C. <pca...@gm...> - 2024-05-18 17:58:02
|
It does make sense, I was confused as well. I think both the domestic and foreign leg are set up with the same notional 1.0. I.e. the conversion of the foreign leg’s npv to domestic currency is done implicitly by using identical nationals. I.e. we exploit the fact that the fx spot rate is the same as the ratio of nationals of the two legs. Therefore the fx spot is not needed to set up the helper. Smart. > On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote: > > Hi Peter, > > No, the spot fx is not declared anywhere in the bootstrapping hence my first question was why we don’t have an argument for the quote FX rate which would be used as the implied notional. Not sure if it’s making sense. > > Thanks & regards, > Nk > > On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm... <mailto:pca...@gm...>> wrote: >> I guess spot fx is somewhat implicit in the (initial) notionals of the two legs? >> Peter >> >> On Fri, 17 May 2024 at 03:34, Ben Watson <ben...@ma... <mailto:ben...@ma...>> wrote: >> > >> > cross currency basis is a spread over a floating index. We use this to bootstrap curves. It is a direct quote, and no need for a spot FX rate. >> > >> > The contrast is when we imply a basis over a floating index from forward fx pips. In this case we need spot fx. >> > >> > Ben >> > >> > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm... <mailto:qua...@gm...>> wrote: >> >> >> >> Hi Quantlib users, >> >> >> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, are we not supposed to have an argument for the quote FX rate? If not how do we adjust for the spot FX rate when bootstrapping the basis adjusted discount curve? Not sure if my question makes sense >> >> >> >> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >> >> >> >> Thanks & regards, >> >> Nk >> >> _______________________________________________ >> >> QuantLib-users mailing list >> >> Qua...@li... <mailto:Qua...@li...> >> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >> > _______________________________________________ >> > QuantLib-users mailing list >> > Qua...@li... <mailto:Qua...@li...> >> > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Quant <qua...@gm...> - 2024-05-18 16:42:11
|
Hi Peter, No, the spot fx is not declared anywhere in the bootstrapping hence my first question was why we don’t have an argument for the quote FX rate which would be used as the implied notional. Not sure if it’s making sense. Thanks & regards, Nk On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm...> wrote: > I guess spot fx is somewhat implicit in the (initial) notionals of the two > legs? > Peter > > On Fri, 17 May 2024 at 03:34, Ben Watson <ben...@ma...> > wrote: > > > > cross currency basis is a spread over a floating index. We use this to > bootstrap curves. It is a direct quote, and no need for a spot FX rate. > > > > The contrast is when we imply a basis over a floating index from forward > fx pips. In this case we need spot fx. > > > > Ben > > > > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: > >> > >> Hi Quantlib users, > >> > >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, > are we not supposed to have an argument for the quote FX rate? If not how > do we adjust for the spot FX rate when bootstrapping the basis adjusted > discount curve? Not sure if my question makes sense > >> > >> > https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html > >> > >> Thanks & regards, > >> Nk > >> _______________________________________________ > >> 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: Peter C. <pca...@gm...> - 2024-05-18 16:28:51
|
I guess spot fx is somewhat implicit in the (initial) notionals of the two legs? Peter On Fri, 17 May 2024 at 03:34, Ben Watson <ben...@ma...> wrote: > > cross currency basis is a spread over a floating index. We use this to bootstrap curves. It is a direct quote, and no need for a spot FX rate. > > The contrast is when we imply a basis over a floating index from forward fx pips. In this case we need spot fx. > > Ben > > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: >> >> Hi Quantlib users, >> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, are we not supposed to have an argument for the quote FX rate? If not how do we adjust for the spot FX rate when bootstrapping the basis adjusted discount curve? Not sure if my question makes sense >> >> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html >> >> Thanks & regards, >> Nk >> _______________________________________________ >> 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: Quant <qua...@gm...> - 2024-05-18 15:24:09
|
Hi Ben & QuantLib users,
Thanks for the feedback and that makes sense.
So, I am bootstrapping a basis-adjusted Sonia curve for a USD-GBP Cross
Currency Basis Swap with 3-month Payments. In this case, SOFR is the
baseCurrencyIndex, SONIA is the quoteCurrencyIndex and SOFR Yield curve is
the collateralCurve because this is a USD collateralized swap.
I have the code below and it's not giving the desired results:
ccbs_helpers = [
ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(basis
/ 10000)), ql.Period(*tenor),
2, calendar,
ql.Following, False,
sofr, sonia, sofr_ts, True,
False)
for basis, tenor in [(-5.375, (3, ql.Months)), (-6.875, (6, ql.Months)),
(-13.375, (9, ql.Months)), (-12.75, (1, ql.Years)),
(-14.875, (2, ql.Years)), (-17.25, (3, ql.Years)),
(-19.25, (4, ql.Years)), (-20.25, (5, ql.Years)),
(-20.625, (6, ql.Years)), (-20.75, (7, ql.Years)),
(-20.75, (8, ql.Years)), (-20.875, (9, ql.Years)),
(-21, (10, ql.Years)), (-21.75, (12, ql.Years)),
(-24.625, (15, ql.Years)), (-30, (20, ql.Years)),
(-36.25, (30, ql.Years)), (-38.75, (40, ql.Years)),
(-37.75, (50, ql.Years))]]
basis_adj_sonia_curve = ql.YieldTermStructureHandle(
ql.PiecewiseLogCubicDiscount(0, calendar, ccbs_helpers, day_counter))
basis_adj_sonia_curve.enableExtrapolation()
My first guess is that during the bootstrapping process, the
baseCurrencyIndex (SOFR) and the quoteCurrencyIndex (SONIA) are assuming
the payments of the Cross Currency Swap are made daily but the desired
payment frequency is quarterly (3-month period). The question is, how do I
adjust the payment frequency of the baseCurrencyIndex (SOFR) and the
quoteCurrencyIndex (SONIA) in
ql.ConstNotionalCrossCurrencyBasisSwapRateHelper()?
If the question is not clear let me know so that I clarify.
Thanks & regards,
Nk
On Fri, May 17, 2024 at 1:29 AM Ben Watson <ben...@ma...>
wrote:
> cross currency basis is a spread over a floating index. We use this to
> bootstrap curves. It is a direct quote, and no need for a spot FX rate.
>
> The contrast is when we imply a basis over a floating index from forward
> fx pips. In this case we need spot fx.
>
> Ben
>
> On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote:
>
>> Hi Quantlib users,
>>
>> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, are
>> we not supposed to have an argument for the quote FX rate? If not how do we
>> adjust for the spot FX rate when bootstrapping the basis adjusted discount
>> curve? Not sure if my question makes sense
>>
>>
>> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html
>>
>> Thanks & regards,
>> Nk
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|
|
From: Ashish B. <ash...@gm...> - 2024-05-17 04:44:35
|
Hi Luigi, How do i verify that? If given in the Haug book, I suppose it would hold true for all types of barriers. Regards Ashish On Tue, 7 May 2024 at 20:35, Luigi Ballabio <lui...@gm...> wrote: > Does this also hold for partial-time barrier options? > > Luigi > > > On Mon, Apr 29, 2024 at 9:44 AM Ashish Bansal <ash...@gm...> > wrote: > >> Hi all, >> >> I am looking at the Partial Time barrier code to calculate the value of >> PTB options and noticed that the Put is not supported: >> >> https://rkapl123.github.io/QLAnnotatedSource/d0/d16/analyticpartialtimebarrieroptionengine_8cpp_source.html >> Line# 111: >> case Option::Put: >> QL_FAIL("Partial-time barrier Put option is not implemented"); >> >> I was wondering if the Put valuation can be implemented using the >> Put-Call Symmetry given in the Haug book, section # 4.17.8: >> *Use of Put-Call Symmetry for Barrier Options* >> [image: image.png] >> >> P.S. I am using Python SWIG so need this supported in there too. >> >> Regards >> Ashish >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Ben W. <ben...@ma...> - 2024-05-17 01:33:06
|
cross currency basis is a spread over a floating index. We use this to bootstrap curves. It is a direct quote, and no need for a spot FX rate. The contrast is when we imply a basis over a floating index from forward fx pips. In this case we need spot fx. Ben On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...> wrote: > Hi Quantlib users, > > When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, are > we not supposed to have an argument for the quote FX rate? If not how do we > adjust for the spot FX rate when bootstrapping the basis adjusted discount > curve? Not sure if my question makes sense > > > https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html > > Thanks & regards, > Nk > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Quant <qua...@gm...> - 2024-05-16 20:15:54
|
Hi Quantlib users, When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown below, are we not supposed to have an argument for the quote FX rate? If not how do we adjust for the spot FX rate when bootstrapping the basis adjusted discount curve? Not sure if my question makes sense https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html Thanks & regards, Nk |
|
From: James M. H. <jam...@qu...> - 2024-05-16 14:02:16
|
You're probably looking for this one: https://github.com/quantlib/QuantLib/blob/35fba52c4dd1561740a42e859502581c339bba00/ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp#L69 It's on the parent class. On Thu, May 16, 2024, 1:54 PM Daniel Lobo <dan...@gm...> wrote: > Hi, > > Could someone help me out with the below question? > > Please let me know if any other information is required. > > Thanks for your time. > > On Tue, 14 May 2024 at 23:45, Daniel Lobo <dan...@gm...> wrote: > > > > I have fitted a Volatility surface using Heston process from quantlib > > > > import QuantLib as QL > > Day_Count = QL.Actual365Fixed() > > Calendar = QL.TARGET() > > > > Calculation_Date = QL.Date(6, 11, 2015) > > QL.Settings.instance().evaluationDate = Calculation_Date > > > > Spot = 659.37 > > DIV_yield = QL.QuoteHandle(QL.SimpleQuote(0.0)) > > Flat_TermStructure = > > QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.01, > > Day_Count)) > > DIV_TermStructure = > > QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.00, > > Day_Count)) > > > > > QL.HestonBlackVolSurface(QL.HestonModelHandle(QL.HestonModel(QL.HestonProcess(Flat_TermStructure, > > DIV_TermStructure, QL.QuoteHandle(QL.SimpleQuote(Spot)), v0, Kappa, > > Theta, Sigma, Rho)))) > > > > From above I would like to extract estimate of implied volatility for > > strike 527.50 and expiry QL.Date(6, 12, 2015). > > > > Is there any method to achieve this? > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Daniel L. <dan...@gm...> - 2024-05-16 12:54:04
|
Hi, Could someone help me out with the below question? Please let me know if any other information is required. Thanks for your time. On Tue, 14 May 2024 at 23:45, Daniel Lobo <dan...@gm...> wrote: > > I have fitted a Volatility surface using Heston process from quantlib > > import QuantLib as QL > Day_Count = QL.Actual365Fixed() > Calendar = QL.TARGET() > > Calculation_Date = QL.Date(6, 11, 2015) > QL.Settings.instance().evaluationDate = Calculation_Date > > Spot = 659.37 > DIV_yield = QL.QuoteHandle(QL.SimpleQuote(0.0)) > Flat_TermStructure = > QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.01, > Day_Count)) > DIV_TermStructure = > QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.00, > Day_Count)) > > QL.HestonBlackVolSurface(QL.HestonModelHandle(QL.HestonModel(QL.HestonProcess(Flat_TermStructure, > DIV_TermStructure, QL.QuoteHandle(QL.SimpleQuote(Spot)), v0, Kappa, > Theta, Sigma, Rho)))) > > From above I would like to extract estimate of implied volatility for > strike 527.50 and expiry QL.Date(6, 12, 2015). > > Is there any method to achieve this? |
|
From: Daniel L. <dan...@gm...> - 2024-05-14 18:16:22
|
I have fitted a Volatility surface using Heston process from quantlib
import QuantLib as QL
Day_Count = QL.Actual365Fixed()
Calendar = QL.TARGET()
Calculation_Date = QL.Date(6, 11, 2015)
QL.Settings.instance().evaluationDate = Calculation_Date
Spot = 659.37
DIV_yield = QL.QuoteHandle(QL.SimpleQuote(0.0))
Flat_TermStructure =
QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.01,
Day_Count))
DIV_TermStructure =
QL.YieldTermStructureHandle(QL.FlatForward(Calculation_Date, 0.00,
Day_Count))
QL.HestonBlackVolSurface(QL.HestonModelHandle(QL.HestonModel(QL.HestonProcess(Flat_TermStructure,
DIV_TermStructure, QL.QuoteHandle(QL.SimpleQuote(Spot)), v0, Kappa,
Theta, Sigma, Rho))))
>From above I would like to extract estimate of implied volatility for
strike 527.50 and expiry QL.Date(6, 12, 2015).
Is there any method to achieve this?
|
|
From: Luigi B. <lui...@gm...> - 2024-05-07 15:06:10
|
Does this also hold for partial-time barrier options? Luigi On Mon, Apr 29, 2024 at 9:44 AM Ashish Bansal <ash...@gm...> wrote: > Hi all, > > I am looking at the Partial Time barrier code to calculate the value of > PTB options and noticed that the Put is not supported: > > https://rkapl123.github.io/QLAnnotatedSource/d0/d16/analyticpartialtimebarrieroptionengine_8cpp_source.html > Line# 111: > case Option::Put: > QL_FAIL("Partial-time barrier Put option is not implemented"); > > I was wondering if the Put valuation can be implemented using the Put-Call > Symmetry given in the Haug book, section # 4.17.8: > *Use of Put-Call Symmetry for Barrier Options* > [image: image.png] > > P.S. I am using Python SWIG so need this supported in there too. > > Regards > Ashish > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Ashish B. <ash...@gm...> - 2024-05-06 07:35:54
|
Hi, Could anyone help me add this to the library? I am not well verse in programming or this complex calculation. Regards Ashish On Mon, 29 Apr 2024 at 13:10, Ashish Bansal <ash...@gm...> wrote: > Hi all, > > I am looking at the Partial Time barrier code to calculate the value of > PTB options and noticed that the Put is not supported: > > https://rkapl123.github.io/QLAnnotatedSource/d0/d16/analyticpartialtimebarrieroptionengine_8cpp_source.html > Line# 111: > case Option::Put: > QL_FAIL("Partial-time barrier Put option is not implemented"); > > I was wondering if the Put valuation can be implemented using the Put-Call > Symmetry given in the Haug book, section # 4.17.8: > *Use of Put-Call Symmetry for Barrier Options* > [image: image.png] > > P.S. I am using Python SWIG so need this supported in there too. > > Regards > Ashish > |
|
From: Arkadiy N. <ark...@gm...> - 2024-05-04 14:06:25
|
Hi Roshan, DId you mean to say that you expected a bond with a coupon set to the par rate from the discount curve to get back to 100 (it appears that's what you are looking at here). In that case, you need to make sure to set your bond's coupon precisely: instead of coupon =[round(yc_linearzero.zeroRate(adate,ql.Actual365Fixed(),ql. Continuous).rate(),6)] create an index with annual payment term (using https://www.quantlib.org/reference/class_quant_lib_1_1_swap_index.html ) and then use .Fixing() method to get an "on-the-curve" coupon for your bond. On Fri, May 3, 2024 at 3:47 AM Roshan Yadav <er....@gm...> wrote: > I am bootstrapping a yield curve using QuantLib. I have implemented a > function to calculate the present value of cash flows for various bonds > using the bootstrapped yield curve. However, I am encountering a difference > in the NPV calculation, particularly at the maturity of the bond. Ideally, > the NPV at the maturity of the bond should be equal to the face value since > it is at par, which in my case is 100. However, the calculated NPV is > slightly different or Is there anything i am missing out. Here's a snippet > of the code and the output: > CODE: > ``` > >> def qlDatetostr(aDate): >> if aDate.month() < 10: >> return str(aDate.dayOfMonth())+'/0'+ >> str(aDate.month())+'/'+str(aDate.year()) >> else: >> return str(aDate.dayOfMonth())+'/'+ >> str(aDate.month())+'/'+str(aDate.year()) >> > valuationdate = ql.Date(2, 5, 2011) >> ql.Settings.instance().evaluationDate = valuationdate >> settlement_days = 0 >> business_convention = ql.Unadjusted >> end_of_month = False >> coupon_freq = ql.Annual >> facevalue = 100 >> depo_maturities = [ql.Period(1, ql.Days),ql.Period(1, >> ql.Months),ql.Period(2, ql.Months),ql.Period(3, >> ql.Months),ql.Period(6,ql.Months),ql.Period(12,ql.Months)] >> depo_rates = [5.2300,5.2310,5.2250,5.2270,5.2280,5.2200] >> # Bond rates >> bond_maturities = >> [ql.Period(2,ql.Years),ql.Period(3,ql.Years),ql.Period(4,ql.Years),ql.Period(5,ql.Years)] >> bond_rates = [5.23,5.24,5.2500,5.2600] >> maturities = depo_maturities+bond_maturities >> calendar = ql.NullCalendar() >> day_count = ql.Actual365Fixed() >> rates = depo_rates+bond_rates >> df_ytm = pd.DataFrame(list(zip(maturities, rates)), >> columns=["Maturities","Curve"], >> index=['']*len(rates)) > > > # Input YTM data >> quotes = [ >> (1, ql.Period(1, ql.Days), 5.2300), >> (1, ql.Period(1, ql.Months), 5.2310), >> (1, ql.Period(2, ql.Months), 5.2250), >> (1, ql.Period(3, ql.Months), 5.2270), >> (1, ql.Period(6, ql.Months), 5.2280), >> (1, ql.Period(1, ql.Years), 5.2200), >> (1, ql.Period(2, ql.Years), 5.2983), >> (1, ql.Period(3, ql.Years), 5.3086), >> (1, ql.Period(4, ql.Years), 5.2500), >> (1, ql.Period(5, ql.Years), 5.2600), >> ] > > > depo_helpers = >> [ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(r/100)),m,settlement_days,calendar,business_convention,end_of_month,day_count) >> for r, m in zip(depo_rates, depo_maturities)] > > > bond_helpers = [] >> for r, m in zip(bond_rates, bond_maturities): >> termination_date = valuationdate + m >> schedule = ql.Schedule(valuationdate, >> termination_date, >> ql.Period(coupon_freq), >> calendar, >> business_convention, >> business_convention, >> ql.DateGeneration.Backward, >> end_of_month) >> bond_helper = >> ql.FixedRateBondHelper(ql.QuoteHandle(ql.SimpleQuote(facevalue)),settlement_days,facevalue,schedule,[r/100],day_count,business_convention,) >> bond_helpers.append(bond_helper) > > > rate_helpers = depo_helpers+bond_helpers >> yc_linearzero = >> ql.PiecewiseLinearZero(valuationdate,rate_helpers,day_count) >> scheduledates = [calendar.advance(valuationdate,i[1]) for i in quotes] >> > > >> def >> get_val_working(scheduledates,yc_linearzero,facevalue=100,daycount=ql.Actual365Fixed()): >> ref_date = yc_linearzero.referenceDate() >> >> leg_df=pd.DataFrame(columns=['bond_name','start_date','end_date','days','yearfrac','rate','cashflow','discountFactor','calc_df','zerorate',"npv","cf_npv","cf_cum_npv","cum_npv",'eq_rate','calc_yield']) > > calendar = ql.NullCalendar() >> settlement_days = 0 >> facevalue = 100 >> ctr = 0 >> curve_handle = ql.RelinkableYieldTermStructureHandle() >> bondEngine = ql.DiscountingBondEngine(curve_handle) >> for adate in scheduledates: >> schedule = ql.Schedule(ref_date,adate, ql.Period(ql.Semiannual), >> calendar,ql.Unadjusted, ql.Unadjusted, ql.DateGeneration.Forward,False) >> coupon >> =[round(yc_linearzero.zeroRate(adate,ql.Actual365Fixed(),ql.Continuous).rate(),6)] >> bond = >> ql.FixedRateBond(settlement_days,facevalue,schedule,coupon,daycount) >> bond_name = f"bond {schedule.endDate()} {coupon}%" >> # flat_forward = >> ql.FlatForward(0,ql.NullCalendar(),coupon[0],ql.Thirty360(),ql.Compounded,ql.Annual) >> curve_handle.linkTo(yc_linearzero) >> bond.setPricingEngine(bondEngine) >> cum_npv = 0 >> cf_cum_npv = 0 >> for index, cf in enumerate(bond.cashflows()): >> date = schedule.previousDate(cf.date()) if >> schedule.startDate() < cf.date() else cf.date() >> nxtdate = cf.date() >> # ql.Settings.instance().evaluationDate = date >> yearfrac = day_count.yearFraction(ref_date,cf.date()) >> cf_amount = cf.amount() >> days = day_count.dayCount(ref_date,cf.date()) >> zerorate = yc_linearzero.zeroRate(yearfrac,ql.Continuous) >> eq_rate = >> zerorate.equivalentRate(day_count,ql.Compounded,ql.Semiannual,ref_date,cf.date()) >> discountFactor = zerorate.discountFactor(ref_date,cf.date()) >> # df_calc = 1/((1+zerorate.rate())**yearfrac) >> df_calc = >> round(np.exp(-day_count.yearFraction(ref_date,cf.date()) * >> zerorate.rate()), 8) >> calc_yield = 1/(discountFactor**(1/yearfrac))-1 >> npv = df_calc*cf.amount() >> cf_npv = ql.CashFlows_npv([cf],curve_handle,True) >> cum_npv = cum_npv+npv >> cf_cum_npv = cf_cum_npv+cf_npv >> >> row={"bond_name":bond_name,'start_date':qlDatetostr(date),'end_date':qlDatetostr(nxtdate),'days':days,'yearfrac':yearfrac,'rate':coupon, >> 'cashflow':cf_amount,'discountFactor':discountFactor,'calc_df':df_calc,'calc_yield':calc_yield,'zerorate':zerorate.rate(),'npv':npv,"cf_npv":cf_npv,"cf_cum_npv":cf_cum_npv,"cum_npv":cum_npv,'eq_rate':eq_rate.rate()} >> leg_df = leg_df.append(row,ignore_index=True) >> if ctr == len(df_ytm): >> break >> else: >> ctr = ctr+1 >> return leg_df >> valuation = get_val_working(scheduledates,yc_linearzero) > > print(valuation.tail(11)) > > > which gives: > >OUTPUT: > > bond_name start_date end_date days yearfrac rate cashflow discountFactor > calc_df zerorate npv cf_npv cf_cum_npv cum_npv eq_rate calc_yield > 34 bond May 2nd, 2016 [0.051283]% 02-05-2011 02-11-2011 184 0.504109589 > [0.051283] 2.585225205 0.974321893 0.97432189 0.051602954 2.518841508 > 2.518841517 2.518841517 2.518841508 0.052274433 0.052957587 > 35 bond May 2nd, 2016 [0.051283]% 02-11-2011 02-05-2012 366 1.002739726 > [0.051283] 2.557124932 0.950260502 0.9502605 0.050879723 2.429934816 > 2.42993482 4.948776337 4.948776324 0.051532433 0.052196331 > 36 bond May 2nd, 2016 [0.051283]% 02-05-2012 02-11-2012 550 1.506849315 > [0.051283] 2.585225205 0.926127394 0.92612739 0.050929763 2.394247872 > 2.394247883 7.34302422 7.343024196 0.051583763 0.052248984 > 37 bond May 2nd, 2016 [0.051283]% 02-11-2012 02-05-2013 731 2.002739726 > [0.051283] 2.543074795 0.902941381 0.90294138 0.050978988 2.296247464 > 2.296247467 9.639271687 9.639271661 0.051634258 0.052300782 > 38 bond May 2nd, 2016 [0.051283]% 02-05-2013 02-11-2013 915 2.506849315 > [0.051283] 2.585225205 0.879921283 0.87992128 0.051029324 2.274794672 > 2.274794679 11.91406637 11.91406633 0.051685895 0.052353753 > 39 bond May 2nd, 2016 [0.051283]% 02-11-2013 02-05-2014 1096 3.002739726 > [0.051283] 2.543074795 0.857806728 0.85780673 0.051078841 2.181466674 > 2.181466668 14.09553303 14.09553301 0.051736691 0.052405862 > 40 bond May 2nd, 2016 [0.051283]% 02-05-2014 02-11-2014 1280 3.506849315 > [0.051283] 2.585225205 0.835850894 0.83585089 0.051129952 2.160862789 > 2.160862798 16.25639583 16.2563958 0.051789126 0.052459654 > 41 bond May 2nd, 2016 [0.051283]% 02-11-2014 02-05-2015 1461 4.002739726 > [0.051283] 2.543074795 0.814760443 0.81476044 0.051180231 2.071996739 > 2.071996747 18.32839258 18.32839253 0.051840707 0.052512571 > 42 bond May 2nd, 2016 [0.051283]% 02-05-2015 02-11-2015 1645 4.506849315 > [0.051283] 2.585225205 0.793823805 0.79382381 0.051231744 2.052213322 > 2.05221331 20.38060589 20.38060586 0.051893556 0.052566791 > 43 bond May 2nd, 2016 [0.051283]% 02-11-2015 02-05-2016 1827 5.005479452 > [0.051283] 2.557124932 0.773604524 0.77360452 0.051282697 1.978203405 > 1.978203416 22.35880931 22.35880926 0.051945832 0.052620424 > 44 bond May 2nd, 2016 [0.051283]% 02-11-2015 02-05-2016 1827 5.005479452 > [0.051283] *100* 0.773604524 0.77360452 0.051282697 77.360452 77.36045243 > 99.71926174 99.71926126 0.051945832 0.052620424 > > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Michael (D. portal) <mi...@da...> - 2024-05-03 13:59:20
|
Hi Luigi: Thanks for getting back to me! To be specific, we use QuantLib for mortgage bond pricing e.g. calculate yields, spreads, durations given mortgage performance inputs (e.g. prepayments or default vectors). This works quite well for static metrics that rely on a single yield curve input. But we also would like to calculate option adjusted measures (e.g. OAS - option adjusted spread) that require inputs of many yield curves (e.g. with high/lower rates leves, flatter/steeper curve shapes). So a few specific questions I have are as follows: 1. What is the best way to generate option adjusted metrics (e.g. OAS) in QuantLib if user inputs yield curves with associated probabilities? 2. Can QuantLIb generate future yield curves with associated probabilities based on current structure of term structure of interest rates and volatility surface? 3. What is the best way to retrieve the yield curve details for cash flows calculations (e.g. monthly discount factors for 360 months which is a typical number of cash flows for a mortgage bond)? We tried a *discount* method for each month separately but it takes too long. Thanks, Michael On Fri, May 3, 2024 at 4:06 AM Luigi Ballabio <lui...@gm...> wrote: > Hi Michael, apologies for the delay. I'm not sure what's the most > effective way to do this. Well, no, scratch that—the most efficient way > would be to do it in C++. From Python, if you have a process available > (such as HullWhiteProcess, for instance) you can use the available > PathGenerator class. What kind of simulation do you have in mind? > > Luigi > > > On Sat, Apr 20, 2024 at 5:49 PM Michael (DataDriven portal) < > mi...@da...> wrote: > >> Hi Luigi: >> >> Thank you for getting back to me! >> >> What is the most efficient way to do Monte Carlo simulations in QuantLib >> when I need to obtain multiple paths of yield curves for different >> scenarios (they do not have to be vectors of DFs but could be FRAs or any >> other rate metrics)? >> >> Thanks, >> >> Michael >> >> On Sat, Apr 20, 2024 at 10:59 AM Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hello Michael, >>> no, I'm afraid vector methods are not available. >>> >>> Luigi >>> >>> >>> On Sun, Apr 14, 2024 at 8:30 PM Michael (DataDriven portal) < >>> mi...@da...> wrote: >>> >>>> Hi All, >>>> >>>> I am using a *discount* method on a curve to get a discount factor for >>>> a given maturity (like in shown in the Cookbook below). But I need to >>>> output discount factors for all monthly cash flows of a bond (in my case >>>> 360 cash flows) so it is time consuming to call the *discount* method >>>> 360 times. >>>> >>>> Is there a way to get all discount factors (for all cash flows - 360 in >>>> my case) in a single call to a curve by passing all maturity dates (e.g. in >>>> a list) to speed up the calculations? >>>> >>>> Thanks, >>>> >>>> Michael >>>> >>>> [image: image.png] >>>> _______________________________________________ >>>> QuantLib-users mailing list >>>> Qua...@li... >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>> >>> |
|
From: Luigi B. <lui...@gm...> - 2024-05-03 11:09:44
|
Hi Esteban, I've answered you at < https://quant.stackexchange.com/questions/79126/quantlib-swap-fair-rate-not-the-same-as-the-constructed-curve-nodes/ >. Luigi On Thu, Apr 25, 2024 at 8:37 PM Esteban López Araiza Bravo < est...@ho...> wrote: > I'm having trouble getting the same nodes when evaluating Fair Rates for a > Mexican TIIE swap. > > I think my problem is in the MXNOIS curve creation, but I'm not sure. > For evaluating, I am creating the MXNOIS curve using both USDOIS curve and > USDSOFR curve. > > ¿Does Anyone know where the problem is? > > I will attach the python file (in .txt extension) > > The output is: > > Input for 1 Tenor: 11.245 > Calculated 1 Tenor: 11.244857 > > Input for 3 Tenor: 11.23025 > Calculated 3 Tenor: 11.229588 > > Input for 6 Tenor: 11.165 > Calculated 6 Tenor: 11.163458 > > Input for 9 Tenor: 11.065 > Calculated 9 Tenor: 11.063222 > > Input for 13 Tenor: 10.935 > Calculated 13 Tenor: 10.932736 > > Input for 26 Tenor: 10.42005 > Calculated 26 Tenor: 10.41593 > > Input for 39 Tenor: 10.025 > Calculated 39 Tenor: 10.020654 > > Input for 52 Tenor: 9.78005 > Calculated 52 Tenor: 9.775265 > > Input for 65 Tenor: 9.640125 > Calculated 65 Tenor: 9.635103 > > Input for 91 Tenor: 9.52005 > Calculated 91 Tenor: 9.515049 > > Input for 130 Tenor: 9.489 > Calculated 130 Tenor: 9.48471 > > Input for 195 Tenor: 9.54 > Calculated 195 Tenor: 9.537698 > > Input for 260 Tenor: 9.543 > Calculated 260 Tenor: 9.541035 > > Input for 390 Tenor: 9.5305 > Calculated 390 Tenor: 9.528793 > > Only the first Tenors are close to the input ones. > > Thank you for your insights in this issue. > > > Esteban > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Luigi B. <lui...@gm...> - 2024-05-03 08:07:02
|
Hi Michael, apologies for the delay. I'm not sure what's the most effective way to do this. Well, no, scratch that—the most efficient way would be to do it in C++. From Python, if you have a process available (such as HullWhiteProcess, for instance) you can use the available PathGenerator class. What kind of simulation do you have in mind? Luigi On Sat, Apr 20, 2024 at 5:49 PM Michael (DataDriven portal) < mi...@da...> wrote: > Hi Luigi: > > Thank you for getting back to me! > > What is the most efficient way to do Monte Carlo simulations in QuantLib > when I need to obtain multiple paths of yield curves for different > scenarios (they do not have to be vectors of DFs but could be FRAs or any > other rate metrics)? > > Thanks, > > Michael > > On Sat, Apr 20, 2024 at 10:59 AM Luigi Ballabio <lui...@gm...> > wrote: > >> Hello Michael, >> no, I'm afraid vector methods are not available. >> >> Luigi >> >> >> On Sun, Apr 14, 2024 at 8:30 PM Michael (DataDriven portal) < >> mi...@da...> wrote: >> >>> Hi All, >>> >>> I am using a *discount* method on a curve to get a discount factor for >>> a given maturity (like in shown in the Cookbook below). But I need to >>> output discount factors for all monthly cash flows of a bond (in my case >>> 360 cash flows) so it is time consuming to call the *discount* method >>> 360 times. >>> >>> Is there a way to get all discount factors (for all cash flows - 360 in >>> my case) in a single call to a curve by passing all maturity dates (e.g. in >>> a list) to speed up the calculations? >>> >>> Thanks, >>> >>> Michael >>> >>> [image: image.png] >>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>> >> |
|
From: Roshan Y. <er....@gm...> - 2024-05-03 07:44:32
|
I am bootstrapping a yield curve using QuantLib. I have implemented a
function to calculate the present value of cash flows for various bonds
using the bootstrapped yield curve. However, I am encountering a difference
in the NPV calculation, particularly at the maturity of the bond. Ideally,
the NPV at the maturity of the bond should be equal to the face value since
it is at par, which in my case is 100. However, the calculated NPV is
slightly different or Is there anything i am missing out. Here's a snippet
of the code and the output:
CODE:
```
> def qlDatetostr(aDate):
> if aDate.month() < 10:
> return str(aDate.dayOfMonth())+'/0'+
> str(aDate.month())+'/'+str(aDate.year())
> else:
> return str(aDate.dayOfMonth())+'/'+
> str(aDate.month())+'/'+str(aDate.year())
>
valuationdate = ql.Date(2, 5, 2011)
> ql.Settings.instance().evaluationDate = valuationdate
> settlement_days = 0
> business_convention = ql.Unadjusted
> end_of_month = False
> coupon_freq = ql.Annual
> facevalue = 100
> depo_maturities = [ql.Period(1, ql.Days),ql.Period(1,
> ql.Months),ql.Period(2, ql.Months),ql.Period(3,
> ql.Months),ql.Period(6,ql.Months),ql.Period(12,ql.Months)]
> depo_rates = [5.2300,5.2310,5.2250,5.2270,5.2280,5.2200]
> # Bond rates
> bond_maturities =
> [ql.Period(2,ql.Years),ql.Period(3,ql.Years),ql.Period(4,ql.Years),ql.Period(5,ql.Years)]
> bond_rates = [5.23,5.24,5.2500,5.2600]
> maturities = depo_maturities+bond_maturities
> calendar = ql.NullCalendar()
> day_count = ql.Actual365Fixed()
> rates = depo_rates+bond_rates
> df_ytm = pd.DataFrame(list(zip(maturities, rates)),
> columns=["Maturities","Curve"],
> index=['']*len(rates))
# Input YTM data
> quotes = [
> (1, ql.Period(1, ql.Days), 5.2300),
> (1, ql.Period(1, ql.Months), 5.2310),
> (1, ql.Period(2, ql.Months), 5.2250),
> (1, ql.Period(3, ql.Months), 5.2270),
> (1, ql.Period(6, ql.Months), 5.2280),
> (1, ql.Period(1, ql.Years), 5.2200),
> (1, ql.Period(2, ql.Years), 5.2983),
> (1, ql.Period(3, ql.Years), 5.3086),
> (1, ql.Period(4, ql.Years), 5.2500),
> (1, ql.Period(5, ql.Years), 5.2600),
> ]
depo_helpers =
> [ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(r/100)),m,settlement_days,calendar,business_convention,end_of_month,day_count)
> for r, m in zip(depo_rates, depo_maturities)]
bond_helpers = []
> for r, m in zip(bond_rates, bond_maturities):
> termination_date = valuationdate + m
> schedule = ql.Schedule(valuationdate,
> termination_date,
> ql.Period(coupon_freq),
> calendar,
> business_convention,
> business_convention,
> ql.DateGeneration.Backward,
> end_of_month)
> bond_helper =
> ql.FixedRateBondHelper(ql.QuoteHandle(ql.SimpleQuote(facevalue)),settlement_days,facevalue,schedule,[r/100],day_count,business_convention,)
> bond_helpers.append(bond_helper)
rate_helpers = depo_helpers+bond_helpers
> yc_linearzero =
> ql.PiecewiseLinearZero(valuationdate,rate_helpers,day_count)
> scheduledates = [calendar.advance(valuationdate,i[1]) for i in quotes]
>
> def
> get_val_working(scheduledates,yc_linearzero,facevalue=100,daycount=ql.Actual365Fixed()):
> ref_date = yc_linearzero.referenceDate()
>
> leg_df=pd.DataFrame(columns=['bond_name','start_date','end_date','days','yearfrac','rate','cashflow','discountFactor','calc_df','zerorate',"npv","cf_npv","cf_cum_npv","cum_npv",'eq_rate','calc_yield'])
calendar = ql.NullCalendar()
> settlement_days = 0
> facevalue = 100
> ctr = 0
> curve_handle = ql.RelinkableYieldTermStructureHandle()
> bondEngine = ql.DiscountingBondEngine(curve_handle)
> for adate in scheduledates:
> schedule = ql.Schedule(ref_date,adate, ql.Period(ql.Semiannual),
> calendar,ql.Unadjusted, ql.Unadjusted, ql.DateGeneration.Forward,False)
> coupon
> =[round(yc_linearzero.zeroRate(adate,ql.Actual365Fixed(),ql.Continuous).rate(),6)]
> bond =
> ql.FixedRateBond(settlement_days,facevalue,schedule,coupon,daycount)
> bond_name = f"bond {schedule.endDate()} {coupon}%"
> # flat_forward =
> ql.FlatForward(0,ql.NullCalendar(),coupon[0],ql.Thirty360(),ql.Compounded,ql.Annual)
> curve_handle.linkTo(yc_linearzero)
> bond.setPricingEngine(bondEngine)
> cum_npv = 0
> cf_cum_npv = 0
> for index, cf in enumerate(bond.cashflows()):
> date = schedule.previousDate(cf.date()) if
> schedule.startDate() < cf.date() else cf.date()
> nxtdate = cf.date()
> # ql.Settings.instance().evaluationDate = date
> yearfrac = day_count.yearFraction(ref_date,cf.date())
> cf_amount = cf.amount()
> days = day_count.dayCount(ref_date,cf.date())
> zerorate = yc_linearzero.zeroRate(yearfrac,ql.Continuous)
> eq_rate =
> zerorate.equivalentRate(day_count,ql.Compounded,ql.Semiannual,ref_date,cf.date())
> discountFactor = zerorate.discountFactor(ref_date,cf.date())
> # df_calc = 1/((1+zerorate.rate())**yearfrac)
> df_calc =
> round(np.exp(-day_count.yearFraction(ref_date,cf.date()) *
> zerorate.rate()), 8)
> calc_yield = 1/(discountFactor**(1/yearfrac))-1
> npv = df_calc*cf.amount()
> cf_npv = ql.CashFlows_npv([cf],curve_handle,True)
> cum_npv = cum_npv+npv
> cf_cum_npv = cf_cum_npv+cf_npv
>
> row={"bond_name":bond_name,'start_date':qlDatetostr(date),'end_date':qlDatetostr(nxtdate),'days':days,'yearfrac':yearfrac,'rate':coupon,
> 'cashflow':cf_amount,'discountFactor':discountFactor,'calc_df':df_calc,'calc_yield':calc_yield,'zerorate':zerorate.rate(),'npv':npv,"cf_npv":cf_npv,"cf_cum_npv":cf_cum_npv,"cum_npv":cum_npv,'eq_rate':eq_rate.rate()}
> leg_df = leg_df.append(row,ignore_index=True)
> if ctr == len(df_ytm):
> break
> else:
> ctr = ctr+1
> return leg_df
> valuation = get_val_working(scheduledates,yc_linearzero)
print(valuation.tail(11))
which gives:
>OUTPUT:
bond_name start_date end_date days yearfrac rate cashflow discountFactor
calc_df zerorate npv cf_npv cf_cum_npv cum_npv eq_rate calc_yield
34 bond May 2nd, 2016 [0.051283]% 02-05-2011 02-11-2011 184 0.504109589
[0.051283] 2.585225205 0.974321893 0.97432189 0.051602954 2.518841508
2.518841517 2.518841517 2.518841508 0.052274433 0.052957587
35 bond May 2nd, 2016 [0.051283]% 02-11-2011 02-05-2012 366 1.002739726
[0.051283] 2.557124932 0.950260502 0.9502605 0.050879723 2.429934816
2.42993482 4.948776337 4.948776324 0.051532433 0.052196331
36 bond May 2nd, 2016 [0.051283]% 02-05-2012 02-11-2012 550 1.506849315
[0.051283] 2.585225205 0.926127394 0.92612739 0.050929763 2.394247872
2.394247883 7.34302422 7.343024196 0.051583763 0.052248984
37 bond May 2nd, 2016 [0.051283]% 02-11-2012 02-05-2013 731 2.002739726
[0.051283] 2.543074795 0.902941381 0.90294138 0.050978988 2.296247464
2.296247467 9.639271687 9.639271661 0.051634258 0.052300782
38 bond May 2nd, 2016 [0.051283]% 02-05-2013 02-11-2013 915 2.506849315
[0.051283] 2.585225205 0.879921283 0.87992128 0.051029324 2.274794672
2.274794679 11.91406637 11.91406633 0.051685895 0.052353753
39 bond May 2nd, 2016 [0.051283]% 02-11-2013 02-05-2014 1096 3.002739726
[0.051283] 2.543074795 0.857806728 0.85780673 0.051078841 2.181466674
2.181466668 14.09553303 14.09553301 0.051736691 0.052405862
40 bond May 2nd, 2016 [0.051283]% 02-05-2014 02-11-2014 1280 3.506849315
[0.051283] 2.585225205 0.835850894 0.83585089 0.051129952 2.160862789
2.160862798 16.25639583 16.2563958 0.051789126 0.052459654
41 bond May 2nd, 2016 [0.051283]% 02-11-2014 02-05-2015 1461 4.002739726
[0.051283] 2.543074795 0.814760443 0.81476044 0.051180231 2.071996739
2.071996747 18.32839258 18.32839253 0.051840707 0.052512571
42 bond May 2nd, 2016 [0.051283]% 02-05-2015 02-11-2015 1645 4.506849315
[0.051283] 2.585225205 0.793823805 0.79382381 0.051231744 2.052213322
2.05221331 20.38060589 20.38060586 0.051893556 0.052566791
43 bond May 2nd, 2016 [0.051283]% 02-11-2015 02-05-2016 1827 5.005479452
[0.051283] 2.557124932 0.773604524 0.77360452 0.051282697 1.978203405
1.978203416 22.35880931 22.35880926 0.051945832 0.052620424
44 bond May 2nd, 2016 [0.051283]% 02-11-2015 02-05-2016 1827 5.005479452
[0.051283] *100* 0.773604524 0.77360452 0.051282697 77.360452 77.36045243
99.71926174 99.71926126 0.051945832 0.052620424
|
|
From: <tl...@uc...> - 2024-04-30 21:29:37
|
I'm valuing some NDIRS for CLP and CNY and I'm getting some swaps where the values are wildly off by many orders of magnitude. Breaking it down, even before I introduce the FX issue, I'm seeing the local currency swap NPV is blowing up and I'm wondering if this is a function of the complex coupon calculation. Does anyone have experience with CLP, CNY, and other NDIRS currencies? |
|
From: Ted O. <tm...@ho...> - 2024-04-29 21:42:22
|
Hi, I was playing around with the below code to construct the swaption vol surface. I have 2 questions. Why does it work fine when I try to return the ATM vol using the swaptionVolatilityMatrix handle, but when I add the skew and use the swaptionVolatlityCube I get an error that it's trying to price a maturity for a Saturday: "Fixing date June 29th, 2024 is not valid" when I run on 4/29/24.
Secondly, for the dates that do work the vol using the same strike for both the vol matrix and vol cube are slightly different.
1M 5Y
volmatrix: 32.7
volcube: 33.39
code:
import QuantLib as ql
valDate = ql.Date.todaysDate()
swapTenors = [
'1Y', '2Y', '3Y', '4Y', '5Y',
'6Y', '7Y', '8Y', '9Y', '10Y',
'15Y', '20Y', '25Y', '30Y']
optionTenors = [
'1M', '2M', '3M', '6M', '9M', '1Y',
'18M', '2Y', '3Y', '4Y', '5Y', '7Y',
'10Y', '15Y', '20Y', '25Y', '30Y']
normal_vols = [
[8.6, 12.8, 19.5, 26.9, 32.7, 36.1, 38.7, 40.9, 42.7, 44.3, 48.8, 50.4, 50.8, 50.4],
[9.2, 13.4, 19.7, 26.4, 31.9, 35.2, 38.3, 40.2, 41.9, 43.1, 47.8, 49.9, 50.7, 50.3],
[11.2, 15.3, 21.0, 27.6, 32.7, 35.3, 38.4, 40.8, 42.6, 44.5, 48.6, 50.5, 50.9, 51.0],
[12.9, 17.1, 22.6, 28.8, 33.5, 36.0, 38.8, 41.0, 43.0, 44.6, 48.7, 50.6, 51.1, 51.0],
[14.6, 18.7, 24.6, 30.1, 34.2, 36.9, 39.3, 41.3, 43.2, 44.9, 48.9, 51.0, 51.3, 51.5],
[16.5, 20.9, 26.3, 31.3, 35.0, 37.6, 40.0, 42.0, 43.7, 45.3, 48.8, 50.9, 51.4, 51.7],
[20.9, 25.3, 30.0, 34.0, 37.0, 39.5, 41.9, 43.4, 45.0, 46.4, 49.3, 51.0, 51.3, 51.9],
[25.1, 28.9, 33.2, 36.2, 39.2, 41.2, 43.2, 44.7, 46.0, 47.3, 49.6, 51.0, 51.3, 51.6],
[34.0, 36.6, 39.2, 41.1, 43.2, 44.5, 46.1, 47.2, 48.0, 49.0, 50.3, 51.3, 51.3, 51.2],
[40.3, 41.8, 43.6, 44.9, 46.1, 47.1, 48.2, 49.2, 49.9, 50.5, 51.2, 51.3, 50.9, 50.7],
[44.0, 44.8, 46.0, 47.1, 48.4, 49.1, 49.9, 50.7, 51.4, 51.9, 51.6, 51.4, 50.6, 50.2],
[49.6, 49.7, 50.4, 51.2, 51.8, 52.2, 52.6, 52.9, 53.3, 53.8, 52.6, 51.7, 50.4, 49.6],
[53.9, 53.7, 54.0, 54.2, 54.4, 54.5, 54.5, 54.4, 54.4, 54.9, 53.1, 51.8, 50.1, 49.1],
[54.0, 53.7, 53.8, 53.7, 53.5, 53.6, 53.5, 53.3, 53.5, 53.7, 51.4, 49.8, 47.9, 46.6],
[52.8, 52.4, 52.6, 52.3, 52.2, 52.3, 52.0, 51.9, 51.8, 51.8, 49.5, 47.4, 45.4, 43.8],
[51.4, 51.2, 51.3, 51.0, 50.8, 50.7, 50.3, 49.9, 49.8, 49.7, 47.6, 45.3, 43.1, 41.4],
[49.6, 49.6, 49.7, 49.5, 49.5, 49.2, 48.6, 47.9, 47.4, 47.1, 45.1, 42.9, 40.8, 39.2]
]
swapTenors = [ql.Period(tenor) for tenor in swapTenors]
optionTenors = [ql.Period(tenor) for tenor in optionTenors]
normal_vols = [[vol / 10000 for vol in row] for row in normal_vols]
calendar = ql.TARGET()
bdc = ql.ModifiedFollowing
dayCounter = ql.ActualActual(ql.ActualActual.ISDA)
swaptionVolMatrix = ql.SwaptionVolatilityMatrix(
calendar, bdc,
optionTenors, swapTenors, ql.Matrix(normal_vols),
dayCounter, False, ql.Normal)
exp = ql.Period('1m')
tenor = ql.Period('10y')
optionTenors_skew = ['3m', '2y', '3y']
swapTenors_skew = [ '5Y', '10Y']
strikeSpreads = [ -0.01, 0.0, 0.01]
volSpreads_2 = [
[5.0, 0.0, 5.0],
[5.0, 0.0, 5.0],
[5.0, 0.0, 5.0],
[5.0, 0.0, 5.0],
[5.0, 0.0, 5.0],
[5.0, 0.0, 5.0],
]
optionTenors_skew = [ql.Period(tenor) for tenor in optionTenors_skew]
swapTenors_skew = [ql.Period(tenor) for tenor in swapTenors_skew]
volSpreads = [[ql.QuoteHandle(ql.SimpleQuote(v/10000)) for v in row] for row in volSpreads_2]
paramGuesses = [[ql.QuoteHandle(ql.SimpleQuote(x)) for x in row] for row in[(0.1,0.1,0.1,0.1)] * 6]
flatRate = .04
oisQuote = ql.QuoteHandle(ql.SimpleQuote(flatRate))
ytsOis = ql.FlatForward(valDate, oisQuote, ql.Actual360())
ytsOis.enableExtrapolation()
t0_Ois = ql.YieldTermStructureHandle(ytsOis)
swapIndexBase = ql.EuriborSwapIsdaFixA(ql.Period(1, ql.Years), t0_Ois, t0_Ois)
shortSwapIndexBase = ql.EuriborSwapIsdaFixA(ql.Period(1, ql.Years), t0_Ois, t0_Ois)
vegaWeightedSmileFit = False
volCube = ql.SwaptionVolatilityStructureHandle(ql.InterpolatedSwaptionVolatilityCube(ql.SwaptionVolatilityStructureHandle(swaptionVolMatrix),
optionTenors_skew,
swapTenors_skew,
strikeSpreads,
volSpreads,
swapIndexBase,
shortSwapIndexBase,
vegaWeightedSmileFit)
)
for x in optionTenors:
for y in swapTenors:
print(str(x) + ' ' + str(y))
print(round(swaptionVolMatrix.volatility(valDate + x, y, flatRate)*10000,2))
print(round(volCube.volatility(valDate + x, y, flatRate)*10000,2))
Sent from Outlook<http://aka.ms/weboutlook>
|
|
From: Ashish B. <ash...@gm...> - 2024-04-29 07:40:59
|
Hi all, I am looking at the Partial Time barrier code to calculate the value of PTB options and noticed that the Put is not supported: https://rkapl123.github.io/QLAnnotatedSource/d0/d16/analyticpartialtimebarrieroptionengine_8cpp_source.html Line# 111: case Option::Put: QL_FAIL("Partial-time barrier Put option is not implemented"); I was wondering if the Put valuation can be implemented using the Put-Call Symmetry given in the Haug book, section # 4.17.8: *Use of Put-Call Symmetry for Barrier Options* [image: image.png] P.S. I am using Python SWIG so need this supported in there too. Regards Ashish |