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: Luigi B. <lui...@gm...> - 2023-04-24 08:54:06
|
Or you can use the `AmortizingFixedRateBond` class (see https://github.com/lballabio/QuantLib/blob/master/ql/instruments/bonds/amortizingfixedratebond.hpp ). Luigi On Mon, Apr 24, 2023 at 12:35 AM Ben Watson <ben...@ma...> wrote: > I would suggest that you build the bond from the cashflows… The bond > cashflows > > i.e. > > bond=ql.Bond(int(self.settlementDays), self.local_calendar, self. > start_date,self.bond_cashflows) > > > > the cashflows can be with FixedRate leg or FloatingRate Leg; > > > > ql.FixedRateLeg(schedule=self.extended_dates_schedule,dayCount = > fixedDayCount,nominals = [self.redemption],couponRates=self.extended_cpns) > > > > > > > > > > *From:* Ngonidzashe Fungura <ngo...@gm...> > *Sent:* Monday, April 24, 2023 1:24 AM > *To:* QuantLib users <qua...@li...> > *Subject:* [Quantlib-users] Fixed Coupon Bond with 3 equal redemptions of > capital > > > > Hi All, > > > > I have a valuation of a fixed coupon bond below and I need help with the > following; > > 1. The repayment of the capital shall be made in three equal amounts > on the following dates: 30 April 2030, 30 April 2031, 30 April 2032. One > third of the nominal value of the loan will be redeemed on the above > mentioned dates, after which no further interest will accrue on the > redeemed portion. > 2. Extraction of the following values (i) nominal value, (ii) cash > flows (i.e., coupon and redeemed capital), (iii) payment date, (iv) accrual > start date, (v) accrual end date, (vi) accrual period, (vii) discount > factor and (vii) PV of cash flows > > *Valuation* > > > import QuantLib as ql > > calc_date = ql.Date(30, 6, 2022) > ql.Settings.instance().evaluationDate = calc_date > spot_dates = [ql.Date(30,6,2022), ql.Date(1,7,2022), > ql.Date(4,7,2022), ql.Date(7,7,2022), > ql.Date(29,7,2022), ql.Date(31,8,2022), > ql.Date(30,9,2022), ql.Date(30,12,2022), > ql.Date(31,3,2023), ql.Date(30,6,2023), > ql.Date(28,6,2024), ql.Date(30,6,2025), > ql.Date(30,6,2026), ql.Date(30,6,2027), > ql.Date(30,6,2028), ql.Date(29,6,2029), > ql.Date(28,6,2030), ql.Date(30,6,2031), > ql.Date(30,6,2032), ql.Date(30,6,2034), > ql.Date(30,6,2037), ql.Date(30,6,2042), > ql.Date(28,6,2047), ql.Date(28,6,2052)] > spot_rates = [0.000000, 0.046757, 0.047312, 0.047849, > 0.049859, 0.049461, 0.051026, 0.063041, > 0.069505, 0.074170, 0.074904, 0.079587, > 0.082547, 0.085506, 0.088410, 0.091284, > 0.093731, 0.095888, 0.097472, 0.099379, > 0.100715, 0.100591, 0.099606, 0.097955] > day_count = ql.Thirty360() > calendar = ql.UnitedStates() > interpolation = ql.Linear() > compounding = ql.Compounded > compounding_frequency = ql.Annual > spot_curve = ql.ZeroCurve(spot_dates, spot_rates, day_count, calendar, > interpolation, compounding, compounding_frequency) > spot_curve_handle = ql.YieldTermStructureHandle(spot_curve) > > issue_date = ql.Date(30, 4, 2022) > maturity_date = ql.Date(30, 4, 2032) > tenor = ql.Period(ql.Semiannual) > calendar = ql.SouthAfrica() > business_convention = ql.Unadjusted > date_generation = ql.DateGeneration.Backward > month_end = False > schedule = ql.Schedule(issue_date, maturity_date, tenor, > calendar, business_convention, > business_convention, date_generation, > month_end) > > # Let us print the schedule to check if it is in agreement with what we expect it to be. > print("Payment dates: ",list(schedule)) > > # Now that we have the schedule, we can create the FixedRateBond object. > coupon_rate = 0.105 > coupons = [coupon_rate] > settlement_days = 0 > face_value = 100 > fixed_rate_bond = ql.FixedRateBond(settlement_days,face_value,schedule,coupons,day_count) > > bond_engine = ql.DiscountingBondEngine(spot_curve_handle) > fixed_rate_bond.setPricingEngine(bond_engine) > > print("NPV of Bond:",round(fixed_rate_bond.NPV(),2)) > > print("Clean Bond Price:",round(fixed_rate_bond.cleanPrice(),2)) > > print('Accrual start date:', ql.BondFunctions.accrualStartDate(fixed_rate_bond)) > > print('Accrual end date:', ql.BondFunctions.accrualEndDate(fixed_rate_bond)) > > print('Number of days between accrual start date and accrual end date:', > day_count.dayCount(ql.BondFunctions.accrualStartDate(fixed_rate_bond), > ql.BondFunctions.accrualEndDate(fixed_rate_bond))) > > print('Accrued days:', ql.BondFunctions.accruedDays(fixed_rate_bond)) > > print("Accrued Amount:",round(fixed_rate_bond.accruedAmount(),2)) > > print("Dirty Bond Price:",round(fixed_rate_bond.dirtyPrice(),2)) > > print("Bond yield:",round(fixed_rate_bond.bondYield(day_count,compounding,compounding_frequency),5)) > > print("Day Count:",fixed_rate_bond.dayCounter()) > > print("Settlement Date:",fixed_rate_bond.settlementDate()) > > for c in fixed_rate_bond.cashflows(): > print('%20s %12f' % (c.date(), c.amount())) > > Thanks > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Ben W. <ben...@ma...> - 2023-04-23 22:32:28
|
I would suggest that you build the bond from the cashflows… The bond cashflows
i.e.
bond=ql.Bond(int(self.settlementDays), self.local_calendar, self.start_date,self.bond_cashflows)
the cashflows can be with FixedRate leg or FloatingRate Leg;
ql.FixedRateLeg(schedule=self.extended_dates_schedule,dayCount =fixedDayCount,nominals = [self.redemption],couponRates=self.extended_cpns)
From: Ngonidzashe Fungura <ngo...@gm...>
Sent: Monday, April 24, 2023 1:24 AM
To: QuantLib users <qua...@li...>
Subject: [Quantlib-users] Fixed Coupon Bond with 3 equal redemptions of capital
Hi All,
I have a valuation of a fixed coupon bond below and I need help with the following;
1. The repayment of the capital shall be made in three equal amounts on the following dates: 30 April 2030, 30 April 2031, 30 April 2032. One third of the nominal value of the loan will be redeemed on the above mentioned dates, after which no further interest will accrue on the redeemed portion.
2. Extraction of the following values (i) nominal value, (ii) cash flows (i.e., coupon and redeemed capital), (iii) payment date, (iv) accrual start date, (v) accrual end date, (vi) accrual period, (vii) discount factor and (vii) PV of cash flows
Valuation
import QuantLib as ql
calc_date = ql.Date(30, 6, 2022)
ql.Settings.instance().evaluationDate = calc_date
spot_dates = [ql.Date(30,6,2022), ql.Date(1,7,2022),
ql.Date(4,7,2022), ql.Date(7,7,2022),
ql.Date(29,7,2022), ql.Date(31,8,2022),
ql.Date(30,9,2022), ql.Date(30,12,2022),
ql.Date(31,3,2023), ql.Date(30,6,2023),
ql.Date(28,6,2024), ql.Date(30,6,2025),
ql.Date(30,6,2026), ql.Date(30,6,2027),
ql.Date(30,6,2028), ql.Date(29,6,2029),
ql.Date(28,6,2030), ql.Date(30,6,2031),
ql.Date(30,6,2032), ql.Date(30,6,2034),
ql.Date(30,6,2037), ql.Date(30,6,2042),
ql.Date(28,6,2047), ql.Date(28,6,2052)]
spot_rates = [0.000000, 0.046757, 0.047312, 0.047849,
0.049859, 0.049461, 0.051026, 0.063041,
0.069505, 0.074170, 0.074904, 0.079587,
0.082547, 0.085506, 0.088410, 0.091284,
0.093731, 0.095888, 0.097472, 0.099379,
0.100715, 0.100591, 0.099606, 0.097955]
day_count = ql.Thirty360()
calendar = ql.UnitedStates()
interpolation = ql.Linear()
compounding = ql.Compounded
compounding_frequency = ql.Annual
spot_curve = ql.ZeroCurve(spot_dates, spot_rates, day_count, calendar,
interpolation, compounding, compounding_frequency)
spot_curve_handle = ql.YieldTermStructureHandle(spot_curve)
issue_date = ql.Date(30, 4, 2022)
maturity_date = ql.Date(30, 4, 2032)
tenor = ql.Period(ql.Semiannual)
calendar = ql.SouthAfrica()
business_convention = ql.Unadjusted
date_generation = ql.DateGeneration.Backward
month_end = False
schedule = ql.Schedule(issue_date, maturity_date, tenor,
calendar, business_convention,
business_convention, date_generation,
month_end)
# Let us print the schedule to check if it is in agreement with what we expect it to be.
print("Payment dates: ",list(schedule))
# Now that we have the schedule, we can create the FixedRateBond object.
coupon_rate = 0.105
coupons = [coupon_rate]
settlement_days = 0
face_value = 100
fixed_rate_bond = ql.FixedRateBond(settlement_days,face_value,schedule,coupons,day_count)
bond_engine = ql.DiscountingBondEngine(spot_curve_handle)
fixed_rate_bond.setPricingEngine(bond_engine)
print("NPV of Bond:",round(fixed_rate_bond.NPV(),2))
print("Clean Bond Price:",round(fixed_rate_bond.cleanPrice(),2))
print('Accrual start date:', ql.BondFunctions.accrualStartDate(fixed_rate_bond))
print('Accrual end date:', ql.BondFunctions.accrualEndDate(fixed_rate_bond))
print('Number of days between accrual start date and accrual end date:',
day_count.dayCount(ql.BondFunctions.accrualStartDate(fixed_rate_bond),
ql.BondFunctions.accrualEndDate(fixed_rate_bond)))
print('Accrued days:', ql.BondFunctions.accruedDays(fixed_rate_bond))
print("Accrued Amount:",round(fixed_rate_bond.accruedAmount(),2))
print("Dirty Bond Price:",round(fixed_rate_bond.dirtyPrice(),2))
print("Bond yield:",round(fixed_rate_bond.bondYield(day_count,compounding,compounding_frequency),5))
print("Day Count:",fixed_rate_bond.dayCounter())
print("Settlement Date:",fixed_rate_bond.settlementDate())
for c in fixed_rate_bond.cashflows():
print('%20s %12f' % (c.date(), c.amount()))
Thanks
|
|
From: Ngonidzashe F. <ngo...@gm...> - 2023-04-23 15:23:55
|
Hi All,
I have a valuation of a fixed coupon bond below and I need help with the
following;
1. The repayment of the capital shall be made in three equal amounts on
the following dates: 30 April 2030, 30 April 2031, 30 April 2032. One third
of the nominal value of the loan will be redeemed on the above mentioned
dates, after which no further interest will accrue on the redeemed portion.
2. Extraction of the following values (i) nominal value, (ii) cash flows
(i.e., coupon and redeemed capital), (iii) payment date, (iv) accrual start
date, (v) accrual end date, (vi) accrual period, (vii) discount factor and
(vii) PV of cash flows
*Valuation*
import QuantLib as ql
calc_date = ql.Date(30, 6, 2022)
ql.Settings.instance().evaluationDate = calc_date
spot_dates = [ql.Date(30,6,2022), ql.Date(1,7,2022),
ql.Date(4,7,2022), ql.Date(7,7,2022),
ql.Date(29,7,2022), ql.Date(31,8,2022),
ql.Date(30,9,2022), ql.Date(30,12,2022),
ql.Date(31,3,2023), ql.Date(30,6,2023),
ql.Date(28,6,2024), ql.Date(30,6,2025),
ql.Date(30,6,2026), ql.Date(30,6,2027),
ql.Date(30,6,2028), ql.Date(29,6,2029),
ql.Date(28,6,2030), ql.Date(30,6,2031),
ql.Date(30,6,2032), ql.Date(30,6,2034),
ql.Date(30,6,2037), ql.Date(30,6,2042),
ql.Date(28,6,2047), ql.Date(28,6,2052)]
spot_rates = [0.000000, 0.046757, 0.047312, 0.047849,
0.049859, 0.049461, 0.051026, 0.063041,
0.069505, 0.074170, 0.074904, 0.079587,
0.082547, 0.085506, 0.088410, 0.091284,
0.093731, 0.095888, 0.097472, 0.099379,
0.100715, 0.100591, 0.099606, 0.097955]
day_count = ql.Thirty360()
calendar = ql.UnitedStates()
interpolation = ql.Linear()
compounding = ql.Compounded
compounding_frequency = ql.Annual
spot_curve = ql.ZeroCurve(spot_dates, spot_rates, day_count, calendar,
interpolation, compounding, compounding_frequency)
spot_curve_handle = ql.YieldTermStructureHandle(spot_curve)
issue_date = ql.Date(30, 4, 2022)
maturity_date = ql.Date(30, 4, 2032)
tenor = ql.Period(ql.Semiannual)
calendar = ql.SouthAfrica()
business_convention = ql.Unadjusted
date_generation = ql.DateGeneration.Backward
month_end = False
schedule = ql.Schedule(issue_date, maturity_date, tenor,
calendar, business_convention,
business_convention, date_generation,
month_end)
# Let us print the schedule to check if it is in agreement with what
we expect it to be.
print("Payment dates: ",list(schedule))
# Now that we have the schedule, we can create the FixedRateBond object.
coupon_rate = 0.105
coupons = [coupon_rate]
settlement_days = 0
face_value = 100
fixed_rate_bond =
ql.FixedRateBond(settlement_days,face_value,schedule,coupons,day_count)
bond_engine = ql.DiscountingBondEngine(spot_curve_handle)
fixed_rate_bond.setPricingEngine(bond_engine)
print("NPV of Bond:",round(fixed_rate_bond.NPV(),2))
print("Clean Bond Price:",round(fixed_rate_bond.cleanPrice(),2))
print('Accrual start date:', ql.BondFunctions.accrualStartDate(fixed_rate_bond))
print('Accrual end date:', ql.BondFunctions.accrualEndDate(fixed_rate_bond))
print('Number of days between accrual start date and accrual end date:',
day_count.dayCount(ql.BondFunctions.accrualStartDate(fixed_rate_bond),
ql.BondFunctions.accrualEndDate(fixed_rate_bond)))
print('Accrued days:', ql.BondFunctions.accruedDays(fixed_rate_bond))
print("Accrued Amount:",round(fixed_rate_bond.accruedAmount(),2))
print("Dirty Bond Price:",round(fixed_rate_bond.dirtyPrice(),2))
print("Bond yield:",round(fixed_rate_bond.bondYield(day_count,compounding,compounding_frequency),5))
print("Day Count:",fixed_rate_bond.dayCounter())
print("Settlement Date:",fixed_rate_bond.settlementDate())
for c in fixed_rate_bond.cashflows():
print('%20s %12f' % (c.date(), c.amount()))
Thanks
|
|
From: Luigi B. <lui...@gm...> - 2023-04-21 13:24:07
|
Hi, I'm afraid I'm not familiar with either Anaconda or Spyder. I'd try the suggestions here: https://stackoverflow.com/questions/42411023/installing-quantlib-in-anaconda-on-the-spyder-editor-windows Hope this helps, Luigi On Thu, Apr 20, 2023 at 6:18 PM Akenou, Jacques Archange Kpatche < JA...@ia...> wrote: > Good Morning gents, > > I’m new to Quantlib and in need of some help in my first steps. > > Through Anaconda, I installed Quantlib on my office laptop running Windows > 10 Enterprise. > > When I run “import QuantLib as ql” in Spyder, I receive the message below. > I would appreciate some advice on how to fix this. > > > > “ > > runfile('C:/xx/file.py', wdir='C:xx') > > Traceback (most recent call last): > > > > File "C:\xx\file.py", line 8, in <module> > > import QuantLib as ql > > > > File "C:\xx\Anaconda3\lib\site-packages\QuantLib\__init__.py", line 21, > in <module> > > from .QuantLib import * > > > > File "C:\xx\Anaconda3\lib\site-packages\QuantLib\QuantLib.py", line 13, > in <module> > > from . import _QuantLib > > > > ImportError: cannot import name '_QuantLib' from partially initialized > module 'QuantLib' (most likely due to a circular import) > (C:\xx\Anaconda3\lib\site-packages\QuantLib\__init__.py) > > > > “ > > > > Thank you, > > Archange. > > > > > > *From:* Luigi Ballabio <lui...@gm...> > *Sent:* Wednesday, April 19, 2023 12:20 PM > *To:* nah...@gm... > *Cc:* QuantLib users <qua...@li...> > *Subject:* Re: [Quantlib-users] Rebuild in VS Code, locked out of example > file > > > > Hello, > > I'm adding the mailing list back in cc so that more people can chime > in with suggestions. > > > > The Boost files can go anywhere, as long as you put the same information > in the "Include Directories" property. Unfortunately, looking at the > Windows instructions (you're following those on our site at < > https://www.quantlib.org/install/vc10.shtml>, right?) I see that the > screenshot might be misleading. As it says in the text, > > > > "If you installed Boost in C:\local\boost_1_81_0, you'll have to add that > to the include directories. Instead, the folder to add to the library > directories has a name such as C:\local\boost_1_81_0\lib32-msvc-12.0 or > C:\local\boost_1_81_0\lib64-msvc-14.3 which includes compiler and build > information; if you installed multiple ones, choose the one corresponding > to your configuration." > > > > In your case, for instance, before you moved the files, the value to > insert into "Include Directories" would have been "C:\local\boost_1_82_0", > not the path including "Program Files" shown in the screenshot. > > > > [Note for anybody reading this and with access to a Windows machine and a > recent copy of Visual Studio: it would be great if you could take new > screenshots so that I can replace the old ones in the instructions. Send me > an email if you want to help.] > > > > As for the locked file, I'm not sure — it might be a permissions issue. > Maybe you did the first changes as a machine administrator and now you're > trying to change the project again as a normal user? In any case, I'd try > closing Visual Studio and starting again from a fresh copy of QuantLib—as > in, deleting the whole QuantLib-1.29 folder and extracting the zip again. > Or you can try QuantLib 1.30, which was released earlier today. > > > > If you still can't compile it, please send us the exact error message so > we can try a better diagnosis. > > > > Hope this helps, > > Luigi > > > > > > > > > > On Mon, Apr 17, 2023 at 8:34 PM Na...@ra... <nah...@gm...> > wrote: > > Thank you, Luigi, for your response. > > > > First of my problems: > > The boot files were loaded into C:\local\boost_1_82_0 and the folder for > the lib in the lines below in bold.from the instructions under Properties: > > > > 1. I entered the requested information to include these files: > > > > But the build of quantlib could not find the boost files in C:\local. So > I copied the contents into a folder C:\Program Files (x86)\boost, a new > folder I created > > > > 2. After this change of folder for boost, I got error in second rebuild > attempt: > > > > Can't overwrite file C:\Program > FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj > (I think that was the file extension, Error message: don't have permission > to overwrite this file > > When asked if I wanted to save in owner file, I said Yes. > > > > 3. I deleted the file C:\Program > FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj > (I think that was the file extension. > > error message: don't have permission to save this file > > When asked if I wanted to save in owner file, I said Yes. > > > > No idea how to proceed. > > > > > > Another question: Would you please verify or correct the new locations for > boost files above? Maybe I should not have created a folder boost: > > > > C:\Program FIles(86)\boost > > > > or many I should have added them to the Quantlib folder? > > > > C:\Program FIles(86)\Quantlib\boost > > > > Thank you, > > Nancy Hammond > > > > > > On Mon, Apr 17, 2023 at 3:43 AM Luigi Ballabio <lui...@gm...> > wrote: > > Hello, > > I'd try deleting the release and downloading it again. I don't think > I have enough information to make a more specific suggestion. > > > > May I ask what was the failure you ran into when following the > instructions? I'd be glad to improve them where needed. > > > > Cheers, > > Luigi > > > > > > On Sat, Apr 15, 2023 at 9:38 PM Na...@ra... <nah...@gm...> > wrote: > > I failed to rebuild bc VSCode couldn't find boost folder although I did > follow instruction > > > > I have now moved boost files to windows C:/Program Files > > > > But now I'm refused access to Examples/BasketLosses/BasketLosses.vc xproj > > > > > > > > _______________________________________________ > 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 > > > > > -- > > Nancy Hammond, Ph.D > nahammond@ <nah...@uc...>gmail.com > 312.973.7697 > > |
|
From: Akenou, J. A. K. <JA...@IA...> - 2023-04-20 16:52:17
|
Good Morning gents,
I’m new to Quantlib and in need of some help in my first steps.
Through Anaconda, I installed Quantlib on my office laptop running Windows 10 Enterprise.
When I run “import QuantLib as ql” in Spyder, I receive the message below. I would appreciate some advice on how to fix this.
“
runfile('C:/xx/file.py', wdir='C:xx')
Traceback (most recent call last):
File "C:\xx\file.py", line 8, in <module>
import QuantLib as ql
File "C:\xx\Anaconda3\lib\site-packages\QuantLib\__init__.py", line 21, in <module>
from .QuantLib import *
File "C:\xx\Anaconda3\lib\site-packages\QuantLib\QuantLib.py", line 13, in <module>
from . import _QuantLib
ImportError: cannot import name '_QuantLib' from partially initialized module 'QuantLib' (most likely due to a circular import) (C:\xx\Anaconda3\lib\site-packages\QuantLib\__init__.py)
“
Thank you,
Archange.
From: Luigi Ballabio <lui...@gm...>
Sent: Wednesday, April 19, 2023 12:20 PM
To: nah...@gm...
Cc: QuantLib users <qua...@li...>
Subject: Re: [Quantlib-users] Rebuild in VS Code, locked out of example file
Hello,
I'm adding the mailing list back in cc so that more people can chime in with suggestions.
The Boost files can go anywhere, as long as you put the same information in the "Include Directories" property. Unfortunately, looking at the Windows instructions (you're following those on our site at <https://www.quantlib.org/install/vc10.shtml>, right?) I see that the screenshot might be misleading. As it says in the text,
"If you installed Boost in C:\local\boost_1_81_0, you'll have to add that to the include directories. Instead, the folder to add to the library directories has a name such as C:\local\boost_1_81_0\lib32-msvc-12.0 or C:\local\boost_1_81_0\lib64-msvc-14.3 which includes compiler and build information; if you installed multiple ones, choose the one corresponding to your configuration."
In your case, for instance, before you moved the files, the value to insert into "Include Directories" would have been "C:\local\boost_1_82_0", not the path including "Program Files" shown in the screenshot.
[Note for anybody reading this and with access to a Windows machine and a recent copy of Visual Studio: it would be great if you could take new screenshots so that I can replace the old ones in the instructions. Send me an email if you want to help.]
As for the locked file, I'm not sure — it might be a permissions issue. Maybe you did the first changes as a machine administrator and now you're trying to change the project again as a normal user? In any case, I'd try closing Visual Studio and starting again from a fresh copy of QuantLib—as in, deleting the whole QuantLib-1.29 folder and extracting the zip again. Or you can try QuantLib 1.30, which was released earlier today.
If you still can't compile it, please send us the exact error message so we can try a better diagnosis.
Hope this helps,
Luigi
On Mon, Apr 17, 2023 at 8:34 PM Na...@ra...<mailto:Na...@ra...> <nah...@gm...<mailto:nah...@gm...>> wrote:
Thank you, Luigi, for your response.
First of my problems:
The boot files were loaded into C:\local\boost_1_82_0 and the folder for the lib in the lines below in bold.from the instructions under Properties:
1. I entered the requested information to include these files:
[cid:image001.png@01D97381.9EB04D70]
But the build of quantlib could not find the boost files in C:\local. So I copied the contents into a folder C:\Program Files (x86)\boost, a new folder I created
2. After this change of folder for boost, I got error in second rebuild attempt:
Can't overwrite file C:\Program FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj (I think that was the file extension, Error message: don't have permission to overwrite this file
When asked if I wanted to save in owner file, I said Yes.
3. I deleted the file C:\Program FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj (I think that was the file extension.
error message: don't have permission to save this file
When asked if I wanted to save in owner file, I said Yes.
No idea how to proceed.
Another question: Would you please verify or correct the new locations for boost files above? Maybe I should not have created a folder boost:
C:\Program FIles(86)\boost
or many I should have added them to the Quantlib folder?
C:\Program FIles(86)\Quantlib\boost
Thank you,
Nancy Hammond
On Mon, Apr 17, 2023 at 3:43 AM Luigi Ballabio <lui...@gm...<mailto:lui...@gm...>> wrote:
Hello,
I'd try deleting the release and downloading it again. I don't think I have enough information to make a more specific suggestion.
May I ask what was the failure you ran into when following the instructions? I'd be glad to improve them where needed.
Cheers,
Luigi
On Sat, Apr 15, 2023 at 9:38 PM Na...@ra...<mailto:Na...@ra...> <nah...@gm...<mailto:nah...@gm...>> wrote:
I failed to rebuild bc VSCode couldn't find boost folder although I did follow instruction
I have now moved boost files to windows C:/Program Files
But now I'm refused access to Examples/BasketLosses/BasketLosses.vc xproj
_______________________________________________
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
--
Nancy Hammond, Ph.D
nahammond@<mailto:nah...@uc...>gmail.com<http://gmail.com>
312.973.7697
|
|
From: Jake H. <jak...@gm...> - 2023-04-19 17:53:31
|
Hello Nancy, If Windows is the target build system IMHO the most flexible solution is to use VS Code and CMake. In particular, it can be a good idea to have in the QuantLib root directory a specific CMakeUserPresets.json file in which you can specify the Boost installation directory. I also had issues to build QuantLib in Windows with VS Code at the beginning. I asked here in the mailing list and I got the help of Jonathan who sent me also a sample CMakeUserPresets.json file. I attach it at this email. Just replace the BOOST_ROOT cache variable with the effective location of your Boost library, something like: "BOOST_ROOT": "C:/local/boost_1_82_0". Hope this helps. Il giorno mer 19 apr 2023 alle ore 18:21 Luigi Ballabio < lui...@gm...> ha scritto: Hello, > I'm adding the mailing list back in cc so that more people can chime > in with suggestions. > > The Boost files can go anywhere, as long as you put the same information > in the "Include Directories" property. Unfortunately, looking at the > Windows instructions (you're following those on our site at < > https://www.quantlib.org/install/vc10.shtml>, right?) I see that the > screenshot might be misleading. As it says in the text, > > "If you installed Boost in C:\local\boost_1_81_0, you'll have to add that > to the include directories. Instead, the folder to add to the library > directories has a name such as C:\local\boost_1_81_0\lib32-msvc-12.0 or > C:\local\boost_1_81_0\lib64-msvc-14.3 which includes compiler and build > information; if you installed multiple ones, choose the one corresponding > to your configuration." > > In your case, for instance, before you moved the files, the value to > insert into "Include Directories" would have been "C:\local\boost_1_82_0", > not the path including "Program Files" shown in the screenshot. > > [Note for anybody reading this and with access to a Windows machine and a > recent copy of Visual Studio: it would be great if you could take new > screenshots so that I can replace the old ones in the instructions. Send me > an email if you want to help.] > > As for the locked file, I'm not sure — it might be a permissions issue. > Maybe you did the first changes as a machine administrator and now you're > trying to change the project again as a normal user? In any case, I'd try > closing Visual Studio and starting again from a fresh copy of QuantLib—as > in, deleting the whole QuantLib-1.29 folder and extracting the zip again. > Or you can try QuantLib 1.30, which was released earlier today. > > If you still can't compile it, please send us the exact error message so > we can try a better diagnosis. > > Hope this helps, > Luigi > > > > > On Mon, Apr 17, 2023 at 8:34 PM Na...@ra... <nah...@gm...> > wrote: > >> Thank you, Luigi, for your response. >> >> First of my problems: >> The boot files were loaded into C:\local\boost_1_82_0 and the folder for >> the lib in the lines below in bold.from the instructions under Properties: >> >> 1. I entered the requested information to include these files: >> [image: image.png] >> >> But the build of quantlib could not find the boost files in C:\local. So >> I copied the contents into a folder C:\Program Files (x86)\boost, a new >> folder I created >> >> 2. After this change of folder for boost, I got error in second rebuild >> attempt: >> >> Can't overwrite file C:\Program >> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj >> (I think that was the file extension, Error message: don't have permission >> to overwrite this file >> When asked if I wanted to save in owner file, I said Yes. >> >> 3. I deleted the file C:\Program >> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj >> (I think that was the file extension. >> error message: don't have permission to save this file >> When asked if I wanted to save in owner file, I said Yes. >> >> No idea how to proceed. >> >> >> Another question: Would you please verify or correct the new locations >> for boost files above? Maybe I should not have created a folder boost: >> >> C:\Program FIles(86)\boost >> >> or many I should have added them to the Quantlib folder? >> >> C:\Program FIles(86)\Quantlib\boost >> >> Thank you, >> Nancy Hammond >> >> >> On Mon, Apr 17, 2023 at 3:43 AM Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hello, >>> I'd try deleting the release and downloading it again. I don't >>> think I have enough information to make a more specific suggestion. >>> >>> May I ask what was the failure you ran into when following the >>> instructions? I'd be glad to improve them where needed. >>> >>> Cheers, >>> Luigi >>> >>> >>> On Sat, Apr 15, 2023 at 9:38 PM Na...@ra... < >>> nah...@gm...> wrote: >>> >>>> I failed to rebuild bc VSCode couldn't find boost folder although I did >>>> follow instruction >>>> >>>> I have now moved boost files to windows C:/Program Files >>>> >>>> But now I'm refused access to Examples/BasketLosses/BasketLosses.vc >>>> xproj >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Nancy Hammond, Ph.D >> nahammond@ <nah...@uc...>gmail.com >> 312.973.7697 >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Jorg L. <jor...@xc...> - 2023-04-19 17:18:07
|
Hi Nancy, We’ve recently added build instructions for using CMake here, which works on all platforms including Windows: https://www.quantlib.org/install/cmake.shtml You might wanna give those a try with Visual Studio or VS Code, it might be easier to get that to work. CMake searches for boost during the configure state, and if it doesn’t find it in the most common locations, you can set the CMake variables BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to point to it. Regards, Jorg On Wed 19 Apr 2023 at 16:20, Luigi Ballabio <lui...@gm...> wrote: > Hello, > I'm adding the mailing list back in cc so that more people can chime > in with suggestions. > > The Boost files can go anywhere, as long as you put the same information > in the "Include Directories" property. Unfortunately, looking at the > Windows instructions (you're following those on our site at < > https://www.quantlib.org/install/vc10.shtml>, right?) I see that the > screenshot might be misleading. As it says in the text, > > "If you installed Boost in C:\local\boost_1_81_0, you'll have to add that > to the include directories. Instead, the folder to add to the library > directories has a name such as C:\local\boost_1_81_0\lib32-msvc-12.0 or > C:\local\boost_1_81_0\lib64-msvc-14.3 which includes compiler and build > information; if you installed multiple ones, choose the one corresponding > to your configuration." > > In your case, for instance, before you moved the files, the value to > insert into "Include Directories" would have been "C:\local\boost_1_82_0", > not the path including "Program Files" shown in the screenshot. > > [Note for anybody reading this and with access to a Windows machine and a > recent copy of Visual Studio: it would be great if you could take new > screenshots so that I can replace the old ones in the instructions. Send me > an email if you want to help.] > > As for the locked file, I'm not sure — it might be a permissions issue. > Maybe you did the first changes as a machine administrator and now you're > trying to change the project again as a normal user? In any case, I'd try > closing Visual Studio and starting again from a fresh copy of QuantLib—as > in, deleting the whole QuantLib-1.29 folder and extracting the zip again. > Or you can try QuantLib 1.30, which was released earlier today. > > If you still can't compile it, please send us the exact error message so > we can try a better diagnosis. > > Hope this helps, > Luigi > > > > > On Mon, Apr 17, 2023 at 8:34 PM Na...@ra... <nah...@gm...> > wrote: > >> Thank you, Luigi, for your response. >> >> First of my problems: >> The boot files were loaded into C:\local\boost_1_82_0 and the folder for >> the lib in the lines below in bold.from the instructions under Properties: >> >> 1. I entered the requested information to include these files: >> [image: image.png] >> >> But the build of quantlib could not find the boost files in C:\local. So >> I copied the contents into a folder C:\Program Files (x86)\boost, a new >> folder I created >> >> 2. After this change of folder for boost, I got error in second rebuild >> attempt: >> >> Can't overwrite file C:\Program >> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj >> (I think that was the file extension, Error message: don't have permission >> to overwrite this file >> When asked if I wanted to save in owner file, I said Yes. >> >> 3. I deleted the file C:\Program >> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj >> (I think that was the file extension. >> error message: don't have permission to save this file >> When asked if I wanted to save in owner file, I said Yes. >> >> No idea how to proceed. >> >> >> Another question: Would you please verify or correct the new locations >> for boost files above? Maybe I should not have created a folder boost: >> >> C:\Program FIles(86)\boost >> >> or many I should have added them to the Quantlib folder? >> >> C:\Program FIles(86)\Quantlib\boost >> >> Thank you, >> Nancy Hammond >> >> >> On Mon, Apr 17, 2023 at 3:43 AM Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hello, >>> I'd try deleting the release and downloading it again. I don't >>> think I have enough information to make a more specific suggestion. >>> >>> May I ask what was the failure you ran into when following the >>> instructions? I'd be glad to improve them where needed. >>> >>> Cheers, >>> Luigi >>> >>> >>> On Sat, Apr 15, 2023 at 9:38 PM Na...@ra... < >>> nah...@gm...> wrote: >>> >>>> I failed to rebuild bc VSCode couldn't find boost folder although I did >>>> follow instruction >>>> >>>> I have now moved boost files to windows C:/Program Files >>>> >>>> But now I'm refused access to Examples/BasketLosses/BasketLosses.vc >>>> xproj >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Nancy Hammond, Ph.D >> nahammond@ <nah...@uc...>gmail.com >> 312.973.7697 >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Luigi B. <lui...@gm...> - 2023-04-19 16:27:15
|
Hello Tom,
I guess you can create the fixed leg and the floating leg manually with
the help of the FixedRateLeg and OvernightLeg classes and then pass them to
the constructor of the base Swap class. It will be a bit more cumbersome
to calculate results such as the fair rate, but it will be possible based
on the NPV and the BPS of the two legs.
Unfortunately we don't have a clean solution for the libor fallback yet,
only workarounds. I'm not sure how we could model the problem; it could be
a new FloatingCouponPricer for the IborCoupon, or some kind of
FallbackLibor index, so that the swap could remain a fixed-vs-libor one but
the calculation would follow the fallback methodology. Any suggestions
are welcome.
Hope this helps,
Luigi
On Tue, Apr 18, 2023 at 8:44 PM Tom Anderson <tw...@ur...> wrote:
> Evening all,
>
> The OvernightIndexedSwap class uses the same schedule for both fixed and
> floating legs:
>
>
> https://github.com/lballabio/QuantLib/blob/master/ql/instruments/overnightindexedswap.cpp#L77
>
> If you currently have a USD LIBOR swap at CME Clearing, then unless you
> act to avert this, on monday morning, you will find that you have a SOFR
> swap with mostly the same details instead:
>
>
> https://www.cmegroup.com/trading/interest-rates/files/cme-conversion-for-usd-libor-cleared-swaps.pdf
>
> (see page 22 onwards, and in particular the example on page 25)
>
> The details which are preserved include the payment frequencies on both
> the fixed and floating legs. I haven't been able to determine with any
> confidence whether the day count conventions are also preserved. Oh, and
> there's a spread added to the floating leg.
>
> If the LIBOR swap you have is a vanilla one, it probably has floating leg
> payments every three months, and fixed leg payments every six months. And
> so, on monday, you will have a SOFR swap which, it seems to me, QuantLib
> cannot represent.
>
> Has anyone else spent any time thinking about this? What is the best way
> to represent a swap like this?
>
> tom
>
> --
> Technology is anything that wasn't around when you were born. -- Alan Kay
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2023-04-19 16:20:09
|
Hello,
I'm adding the mailing list back in cc so that more people can chime in
with suggestions.
The Boost files can go anywhere, as long as you put the same information in
the "Include Directories" property. Unfortunately, looking at the
Windows instructions (you're following those on our site at <
https://www.quantlib.org/install/vc10.shtml>, right?) I see that the
screenshot might be misleading. As it says in the text,
"If you installed Boost in C:\local\boost_1_81_0, you'll have to add that
to the include directories. Instead, the folder to add to the library
directories has a name such as C:\local\boost_1_81_0\lib32-msvc-12.0 or
C:\local\boost_1_81_0\lib64-msvc-14.3 which includes compiler and build
information; if you installed multiple ones, choose the one corresponding
to your configuration."
In your case, for instance, before you moved the files, the value to insert
into "Include Directories" would have been "C:\local\boost_1_82_0", not the
path including "Program Files" shown in the screenshot.
[Note for anybody reading this and with access to a Windows machine and a
recent copy of Visual Studio: it would be great if you could take new
screenshots so that I can replace the old ones in the instructions. Send me
an email if you want to help.]
As for the locked file, I'm not sure — it might be a permissions issue.
Maybe you did the first changes as a machine administrator and now you're
trying to change the project again as a normal user? In any case, I'd try
closing Visual Studio and starting again from a fresh copy of QuantLib—as
in, deleting the whole QuantLib-1.29 folder and extracting the zip again.
Or you can try QuantLib 1.30, which was released earlier today.
If you still can't compile it, please send us the exact error message so we
can try a better diagnosis.
Hope this helps,
Luigi
On Mon, Apr 17, 2023 at 8:34 PM Na...@ra... <nah...@gm...>
wrote:
> Thank you, Luigi, for your response.
>
> First of my problems:
> The boot files were loaded into C:\local\boost_1_82_0 and the folder for
> the lib in the lines below in bold.from the instructions under Properties:
>
> 1. I entered the requested information to include these files:
> [image: image.png]
>
> But the build of quantlib could not find the boost files in C:\local. So
> I copied the contents into a folder C:\Program Files (x86)\boost, a new
> folder I created
>
> 2. After this change of folder for boost, I got error in second rebuild
> attempt:
>
> Can't overwrite file C:\Program
> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj
> (I think that was the file extension, Error message: don't have permission
> to overwrite this file
> When asked if I wanted to save in owner file, I said Yes.
>
> 3. I deleted the file C:\Program
> FIles(86)\Quantlib\Quantlib-1.29\Examples\BasektLosses\Basketlosses.xproj
> (I think that was the file extension.
> error message: don't have permission to save this file
> When asked if I wanted to save in owner file, I said Yes.
>
> No idea how to proceed.
>
>
> Another question: Would you please verify or correct the new locations for
> boost files above? Maybe I should not have created a folder boost:
>
> C:\Program FIles(86)\boost
>
> or many I should have added them to the Quantlib folder?
>
> C:\Program FIles(86)\Quantlib\boost
>
> Thank you,
> Nancy Hammond
>
>
> On Mon, Apr 17, 2023 at 3:43 AM Luigi Ballabio <lui...@gm...>
> wrote:
>
>> Hello,
>> I'd try deleting the release and downloading it again. I don't think
>> I have enough information to make a more specific suggestion.
>>
>> May I ask what was the failure you ran into when following the
>> instructions? I'd be glad to improve them where needed.
>>
>> Cheers,
>> Luigi
>>
>>
>> On Sat, Apr 15, 2023 at 9:38 PM Na...@ra... <nah...@gm...>
>> wrote:
>>
>>> I failed to rebuild bc VSCode couldn't find boost folder although I did
>>> follow instruction
>>>
>>> I have now moved boost files to windows C:/Program Files
>>>
>>> But now I'm refused access to Examples/BasketLosses/BasketLosses.vc xproj
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>
>
> --
> Nancy Hammond, Ph.D
> nahammond@ <nah...@uc...>gmail.com
> 312.973.7697
>
|
|
From: Luigi B. <lui...@gm...> - 2023-04-19 08:19:21
|
QuantLib 1.30 has been released and is available for download at < https://www.quantlib.org/download.shtml>. The list of changes for this release is at < https://www.quantlib.org/reference/history.html>. If you have any problems with this release, please report them here on the QuantLib mailing list (<qua...@li...>), or open a GitHub issue at <https://github.com/lballabio/quantlib/issues>. |
|
From: Tom A. <tw...@ur...> - 2023-04-18 18:41:24
|
Evening all, The OvernightIndexedSwap class uses the same schedule for both fixed and floating legs: https://github.com/lballabio/QuantLib/blob/master/ql/instruments/overnightindexedswap.cpp#L77 If you currently have a USD LIBOR swap at CME Clearing, then unless you act to avert this, on monday morning, you will find that you have a SOFR swap with mostly the same details instead: https://www.cmegroup.com/trading/interest-rates/files/cme-conversion-for-usd-libor-cleared-swaps.pdf (see page 22 onwards, and in particular the example on page 25) The details which are preserved include the payment frequencies on both the fixed and floating legs. I haven't been able to determine with any confidence whether the day count conventions are also preserved. Oh, and there's a spread added to the floating leg. If the LIBOR swap you have is a vanilla one, it probably has floating leg payments every three months, and fixed leg payments every six months. And so, on monday, you will have a SOFR swap which, it seems to me, QuantLib cannot represent. Has anyone else spent any time thinking about this? What is the best way to represent a swap like this? tom -- Technology is anything that wasn't around when you were born. -- Alan Kay |
|
From: Luigi B. <lui...@gm...> - 2023-04-17 15:55:01
|
Hello Sanjay,
in the C++ library I would try using the SubPeriodCoupon class to model
those cashflows, but I don't think it's available in QuantLibXL.
Luigi
On Fri, Apr 7, 2023 at 11:09 PM Sanjay via QuantLib-users <
qua...@li...> wrote:
> Hi all,
>
> I'm just beginning to find my way around QuantLibXL and can't figure out
> how to model an adjustable rate bond where the coupon rate resets every
> week and coupons are paid every month based upon the compounded weekly
> resets. The resets are not from an index but instead, announced by the
> issuer.
>
> Thanks in advance for any help.
>
> --S
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Dagur G. <da...@ko...> - 2023-04-17 15:17:31
|
Hello, Is there any way to define a BulletLoan, Bond in QuantLib such that the coupon payments add to the notional each period? First the notional is 100.0 then 103.5 .etc. until maturity. -Dagur |
|
From: Luigi B. <lui...@gm...> - 2023-04-17 08:40:17
|
Hello,
I'd try deleting the release and downloading it again. I don't think I
have enough information to make a more specific suggestion.
May I ask what was the failure you ran into when following the
instructions? I'd be glad to improve them where needed.
Cheers,
Luigi
On Sat, Apr 15, 2023 at 9:38 PM Na...@ra... <nah...@gm...>
wrote:
> I failed to rebuild bc VSCode couldn't find boost folder although I did
> follow instruction
>
> I have now moved boost files to windows C:/Program Files
>
> But now I'm refused access to Examples/BasketLosses/BasketLosses.vc xproj
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2023-04-17 08:11:25
|
Thanks! On Fri, Apr 14, 2023 at 3:10 AM Dirk Eddelbuettel <ed...@de...> wrote: > > On 13 April 2023 at 14:50, Luigi Ballabio wrote: > | Hello everybody, > | I just published a RC for version 1.30 at < > https://github.com/lballabio/ > | QuantLib/releases/tag/1.30-rc>. > | If you have some time, please give it a spin and report any problems > here on > | the mailing list. Thanks! > > This is now in Debian as 1.29.99 (preserving sorting once 1.30 is out). > > Debian is in release freeze so this in 'experimental' and the builds > _should_ > appear here under tag 'experimental' once the first ones are complete > > > https://buildd.debian.org/status/package.php?p=quantlib&suite=experimental > > No issue preparing it, and I carried to the calendar updates over to my > qlcal > project too. > > Thanks as always, Dirk > > -- > dirk.eddelbuettel.com | @eddelbuettel | ed...@de... > |
|
From: <Na...@ra...> - 2023-04-15 19:36:02
|
I failed to rebuild bc VSCode couldn't find boost folder although I did follow instruction I have now moved boost files to windows C:/Program Files But now I'm refused access to Examples/BasketLosses/BasketLosses.vc xproj |
|
From: Dirk E. <ed...@de...> - 2023-04-14 01:35:51
|
On 13 April 2023 at 14:50, Luigi Ballabio wrote: | Hello everybody, | I just published a RC for version 1.30 at <https://github.com/lballabio/ | QuantLib/releases/tag/1.30-rc>. | If you have some time, please give it a spin and report any problems here on | the mailing list. Thanks! This is now in Debian as 1.29.99 (preserving sorting once 1.30 is out). Debian is in release freeze so this in 'experimental' and the builds _should_ appear here under tag 'experimental' once the first ones are complete https://buildd.debian.org/status/package.php?p=quantlib&suite=experimental No issue preparing it, and I carried to the calendar updates over to my qlcal project too. Thanks as always, Dirk -- dirk.eddelbuettel.com | @eddelbuettel | ed...@de... |
|
From: Peter C. <pca...@gm...> - 2023-04-13 17:38:43
|
Ah you are completely right, got you now! Thank you Peter Luigi Ballabio <lui...@gm...> schrieb am Do. 13. Apr. 2023 um 17:45: > Hi Peter, I guess > > compoundFactor *= (1.0 + fixing * span); > > is not the usual factor of the telescopic product because the span is not > the one underlying the fixing? I'm not sure how much of a difference it > makes, though. > > On Thu, Mar 30, 2023 at 10:51 AM Peter Caspers <pca...@gm...> > wrote: > >> Quick question on this: I am looking at this code >> >> // The last fixing is not used for its full >> period (the date is between its >> // start and end date). We can use the >> telescopic formula until the previous >> // date, then we'll add the missing bit. >> const DiscountFactor endDiscount = >> curve->discount(valueDates[n-1]); >> compoundFactor *= startDiscount / endDiscount; >> >> Rate fixing = index->fixing(fixingDates[n-1]); >> Time span = >> index->dayCounter().yearFraction(valueDates[n-1], date); >> compoundFactor *= (1.0 + fixing * span); >> >> and I am wondering why we don't just do >> >> const DiscountFactor endDiscount = >> curve->discount(date); >> compoundFactor *= startDiscount / endDiscount; >> >> instead, i.e. what is the benefit of separating out the last fixing >> and compute its contribution exactly while we use the telescopic >> approximation for all previous fixings anyway? >> >> Thanks >> Peter >> >> >> >> On Tue, 28 Mar 2023 at 16:11, Luigi Ballabio <lui...@gm...> >> wrote: >> > >> > Hello, >> > no, unfortunately rate cutoff is not implemented yet. I think it's >> for coupons that end on a holiday, but I don't know if that's an ISDA rule. >> > >> > Luigi >> > >> > On Mon, Jan 30, 2023 at 1:16 PM Ioannis Rigopoulos < >> qua...@de...> wrote: >> >> >> >> Hi Tom, >> >> >> >> It is a financial feature part of the OIS term sheet and called "Rate >> >> Cutoff". I have written about this at >> >> https://www.deriscope.com/products/Key_OI_Term_Rate__Rate_Cutoff.html >> >> >> >> Regards, >> >> >> >> Ioannis >> >> >> >> On 1/30/2023 12:38 PM, Tom Anderson wrote: >> >> > Hello, >> >> > >> >> > I have a rather basic question. >> >> > OvernightIndexedCouponPricer::averageRate has a special case for when >> >> > "the last fixing is not used for its full period": >> >> > >> >> > >> https://github.com/lballabio/QuantLib/blob/38bf3fa4a728d82a9975b2ae5fb86eee0433f3ce/ql/cashflows/overnightindexedcoupon.cpp#L107 >> >> > >> >> > >> >> > Is this for when the coupon ends on a day that is not a business day? >> >> > Looking at how the list of dates is put together (in the telescopic >> >> > case), that seems to be the only reason the last date would not be >> the >> >> > end of the accrual period: >> >> > >> >> > >> https://github.com/lballabio/QuantLib/blob/38bf3fa4a728d82a9975b2ae5fb86eee0433f3ce/ql/cashflows/overnightindexedcoupon.cpp#L188 >> >> > >> >> > >> >> > If so, out of interest, does this ultimately flow from ISDA rules for >> >> > OISs, or is this just financial common sense? >> >> > >> >> > Thanks, >> >> > tom >> >> > >> >> >> >> -- >> >> Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft. >> >> www.avast.com >> >> >> >> >> >> _______________________________________________ >> >> QuantLib-users mailing list >> >> Qua...@li... >> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >> > _______________________________________________ >> > QuantLib-users mailing list >> > Qua...@li... >> > https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Luigi B. <lui...@gm...> - 2023-04-13 15:45:16
|
Hi Peter, I guess
compoundFactor *= (1.0 + fixing * span);
is not the usual factor of the telescopic product because the span is not
the one underlying the fixing? I'm not sure how much of a difference it
makes, though.
On Thu, Mar 30, 2023 at 10:51 AM Peter Caspers <pca...@gm...>
wrote:
> Quick question on this: I am looking at this code
>
> // The last fixing is not used for its full
> period (the date is between its
> // start and end date). We can use the
> telescopic formula until the previous
> // date, then we'll add the missing bit.
> const DiscountFactor endDiscount =
> curve->discount(valueDates[n-1]);
> compoundFactor *= startDiscount / endDiscount;
>
> Rate fixing = index->fixing(fixingDates[n-1]);
> Time span =
> index->dayCounter().yearFraction(valueDates[n-1], date);
> compoundFactor *= (1.0 + fixing * span);
>
> and I am wondering why we don't just do
>
> const DiscountFactor endDiscount =
> curve->discount(date);
> compoundFactor *= startDiscount / endDiscount;
>
> instead, i.e. what is the benefit of separating out the last fixing
> and compute its contribution exactly while we use the telescopic
> approximation for all previous fixings anyway?
>
> Thanks
> Peter
>
>
>
> On Tue, 28 Mar 2023 at 16:11, Luigi Ballabio <lui...@gm...>
> wrote:
> >
> > Hello,
> > no, unfortunately rate cutoff is not implemented yet. I think it's
> for coupons that end on a holiday, but I don't know if that's an ISDA rule.
> >
> > Luigi
> >
> > On Mon, Jan 30, 2023 at 1:16 PM Ioannis Rigopoulos <
> qua...@de...> wrote:
> >>
> >> Hi Tom,
> >>
> >> It is a financial feature part of the OIS term sheet and called "Rate
> >> Cutoff". I have written about this at
> >> https://www.deriscope.com/products/Key_OI_Term_Rate__Rate_Cutoff.html
> >>
> >> Regards,
> >>
> >> Ioannis
> >>
> >> On 1/30/2023 12:38 PM, Tom Anderson wrote:
> >> > Hello,
> >> >
> >> > I have a rather basic question.
> >> > OvernightIndexedCouponPricer::averageRate has a special case for when
> >> > "the last fixing is not used for its full period":
> >> >
> >> >
> https://github.com/lballabio/QuantLib/blob/38bf3fa4a728d82a9975b2ae5fb86eee0433f3ce/ql/cashflows/overnightindexedcoupon.cpp#L107
> >> >
> >> >
> >> > Is this for when the coupon ends on a day that is not a business day?
> >> > Looking at how the list of dates is put together (in the telescopic
> >> > case), that seems to be the only reason the last date would not be the
> >> > end of the accrual period:
> >> >
> >> >
> https://github.com/lballabio/QuantLib/blob/38bf3fa4a728d82a9975b2ae5fb86eee0433f3ce/ql/cashflows/overnightindexedcoupon.cpp#L188
> >> >
> >> >
> >> > If so, out of interest, does this ultimately flow from ISDA rules for
> >> > OISs, or is this just financial common sense?
> >> >
> >> > Thanks,
> >> > tom
> >> >
> >>
> >> --
> >> Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
> >> www.avast.com
> >>
> >>
> >> _______________________________________________
> >> QuantLib-users mailing list
> >> Qua...@li...
> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> > _______________________________________________
> > QuantLib-users mailing list
> > Qua...@li...
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2023-04-13 15:39:02
|
Yes, do push the code to the PR — thanks!
On Thu, Apr 13, 2023 at 5:32 PM Jake Heke <jak...@gm...> wrote:
> Hello Luigi,
>
> Thanks for the fast feedback - Yes, before discounting I am checking if
> the discount handle is empty. But the point is that the exception is
> returned immediately when I call the new constructor.
> It is not even arriving at the calculations, it is happening immediately.
> It is not even entering in the code of the constructor.
> The exception is just triggered immediately.
> Conversely I tested the constructor with a non-empty discounting curve and
> it is working fine.
> I paste here the complete code of the test, the FRA3 constructor is the
> new one that is failing.
> Maybe I am doing some mistakes:
>
> #include <ql/instruments/forwardrateagreement.hpp>
> #include <ql/indexes/ibor/euribor.hpp>
> #include <ql/termstructures/yield/flatforward.hpp>
> #include <ql/time/calendars/target.hpp>
> #include <ql/time/daycounters/actual360.hpp>
> #include <iostream>
>
> using namespace QuantLib;
>
> void printFRA(const ForwardRateAgreement& FRA) {
> std::cout << "FRA payoff amount on value date: " << FRA.amount() <<
> '\n';
> std::cout << "FRA Business day convention: " <<
> FRA.businessDayConvention() << '\n';
> std::cout << "FRA calendar: " << FRA.calendar() << '\n';
> std::cout << "FRA day counter: " << FRA.dayCounter() << '\n';
> std::cout << "FRA fixing date: " << FRA.fixingDate() << '\n';
> std::cout << "FRA forward rate: " << FRA.forwardRate() << '\n';
> std::cout << "FRA rate: " << FRA.forwardRate().rate() << '\n';
> std::cout << "FRA is expired: " << FRA.isExpired() << '\n';
> std::cout << "FRA NPV: " << FRA.NPV() << '\n' << '\n';
> }
>
> int main() {
> Rate euriborRate = 0.04;
> Rate strikeForwardRate = 0.05;
> Date today = Date(31, January, 2023);
> Settings::instance().evaluationDate() = today;
> Calendar calendar = TARGET();
> BusinessDayConvention businessDayConvention = ModifiedFollowing;
> bool endOfMonth = true;
> bool noIndexCoupon = false;
> Period tenor = Period(3, Months);
> DayCounter dayCounter = Actual360();
> Date valueDate = calendar.advance(today, Period(1, Months),
> businessDayConvention, endOfMonth);
> Date maturityDate = calendar.advance(valueDate, tenor,
> businessDayConvention, endOfMonth);
> Position::Type fraFwdType = Position::Long;
> Real fraNotional = 100.0;
> Natural fixingDays = 2;
> Natural settlementDays = 0;
>
> // simple Flat forward term structure for Euribor
> Handle<YieldTermStructure> euriborTermStructure(
> ext::make_shared<FlatForward>(today, euriborRate, dayCounter,
> Simple, Once));
> // creation of the Euribor pointer
> ext::shared_ptr<IborIndex> euribor3m(new
> Euribor3M(euriborTermStructure));
> // empty Yield Term structure
> Handle<YieldTermStructure> emptyTermStructure;
> // flat forward term structure
> Handle<YieldTermStructure> flatForwardTS(
> ext::make_shared<FlatForward>(settlementDays, calendar,
> euriborRate, dayCounter, Simple, Once));
>
> // FRA 1x4 creation
> ForwardRateAgreement FRA(valueDate,
> fraFwdType,
> strikeForwardRate,
> fraNotional,
> euribor3m);
> std::cout << "FRA test the constructor taking the index and using
> indexed coupon = true\n";
> printFRA(FRA);
>
> ForwardRateAgreement FRA2(valueDate,
> fraFwdType,
> strikeForwardRate,
> fraNotional,
> euribor3m,
> emptyTermStructure,
> noIndexCoupon);
> std::cout << "FRA test the constructor taking the index and using
> indexed coupon = false\n";
> printFRA(FRA2);
>
> // this is the new constructor failing, returning the exception
> ForwardRateAgreement FRA3(valueDate,
> maturityDate,
> fraFwdType,
> strikeForwardRate,
> fraNotional,
> flatForwardTS,
> fixingDays,
> businessDayConvention);
> std::cout << "FRA test the new constructor taking the term
> structure\n";
> printFRA(FRA3);
>
> return EXIT_SUCCESS;
> }
>
> If you prefer I can just push the code of the PR and then we can look also
> at the big picture.
> Thanks in advance for your time and your help.
>
>
> Il giorno gio 13 apr 2023 alle ore 15:55 Luigi Ballabio <
> lui...@gm...> ha scritto:
>
>> Hello Jake,
>> the bit of code that does the discounting should check if the
>> discount handle is empty. If it's not empty, it should use it; otherwise,
>> it should fall back to using the forecasting handle instead.
>>
>> Luigi
>>
>>
>> On Thu, Apr 13, 2023 at 3:11 PM Jake Heke <jak...@gm...> wrote:
>>
>>> Hi all,
>>> I am currently working on a pull request for class ForwardRateAgreement.
>>> I coded a new version of the constructor:
>>>
>>> ForwardRateAgreement(
>>> const Date& valueDate,
>>> const Date& maturityDate,
>>> Position::Type type,
>>> Rate strikeForwardRate,
>>> Real notionalAmount,
>>> Handle<YieldTermStructure> forecastCurve,
>>> Natural fixingDays,
>>> BusinessDayConvention businessDayConvention,
>>> Handle<YieldTermStructure> discountCurve =
>>> Handle<YieldTermStructure>());
>>>
>>> The last discountCurve it is used only if provided, otherwise the
>>> forecastCurve is used also for discounting.
>>> That's why I provided a default for it as discountCurve =
>>> Handle<YieldTermStructure>().
>>>
>>> Now, before submitting the PR I am trying to test some cases of the new
>>> constructor.
>>> Guess what? Unsurprisingly it is not working :-)
>>> If I try to create the FRA as:
>>>
>>> ForwardRateAgreement FRA3(valueDate,
>>> maturityDate,
>>> fraFwdType,
>>> strikeForwardRate,
>>> fraNotional,
>>> flatForwardTS,
>>> fixingDays,
>>> businessDayConvention);
>>>
>>> I am getting an exception in handle.hpp which is saying "empty Handle
>>> cannot be dereferenced". Here is the piece of code issuing the exception:
>>> template <class T>
>>> inline const ext::shared_ptr<T>& Handle<T>::operator->() const {
>>> QL_REQUIRE(!empty(), "empty Handle cannot be dereferenced");
>>> return link_->currentLink();
>>>
>>> I am getting the same exception even if I call the new constructor by
>>> passing explicitly the empty discount curve:
>>>
>>> ForwardRateAgreement FRA3(valueDate,
>>> maturityDate,
>>> fraFwdType,
>>> strikeForwardRate,
>>> fraNotional,
>>> flatForwardTS,
>>> fixingDays,
>>> businessDayConvention,
>>> Handle<YieldTermStructure>());
>>>
>>> What am I missing? Thanks in advance for your help.
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
|
|
From: Jake H. <jak...@gm...> - 2023-04-13 15:32:34
|
Hello Luigi,
Thanks for the fast feedback - Yes, before discounting I am checking if the
discount handle is empty. But the point is that the exception is returned
immediately when I call the new constructor.
It is not even arriving at the calculations, it is happening immediately.
It is not even entering in the code of the constructor.
The exception is just triggered immediately.
Conversely I tested the constructor with a non-empty discounting curve and
it is working fine.
I paste here the complete code of the test, the FRA3 constructor is the new
one that is failing.
Maybe I am doing some mistakes:
#include <ql/instruments/forwardrateagreement.hpp>
#include <ql/indexes/ibor/euribor.hpp>
#include <ql/termstructures/yield/flatforward.hpp>
#include <ql/time/calendars/target.hpp>
#include <ql/time/daycounters/actual360.hpp>
#include <iostream>
using namespace QuantLib;
void printFRA(const ForwardRateAgreement& FRA) {
std::cout << "FRA payoff amount on value date: " << FRA.amount() <<
'\n';
std::cout << "FRA Business day convention: " <<
FRA.businessDayConvention() << '\n';
std::cout << "FRA calendar: " << FRA.calendar() << '\n';
std::cout << "FRA day counter: " << FRA.dayCounter() << '\n';
std::cout << "FRA fixing date: " << FRA.fixingDate() << '\n';
std::cout << "FRA forward rate: " << FRA.forwardRate() << '\n';
std::cout << "FRA rate: " << FRA.forwardRate().rate() << '\n';
std::cout << "FRA is expired: " << FRA.isExpired() << '\n';
std::cout << "FRA NPV: " << FRA.NPV() << '\n' << '\n';
}
int main() {
Rate euriborRate = 0.04;
Rate strikeForwardRate = 0.05;
Date today = Date(31, January, 2023);
Settings::instance().evaluationDate() = today;
Calendar calendar = TARGET();
BusinessDayConvention businessDayConvention = ModifiedFollowing;
bool endOfMonth = true;
bool noIndexCoupon = false;
Period tenor = Period(3, Months);
DayCounter dayCounter = Actual360();
Date valueDate = calendar.advance(today, Period(1, Months),
businessDayConvention, endOfMonth);
Date maturityDate = calendar.advance(valueDate, tenor,
businessDayConvention, endOfMonth);
Position::Type fraFwdType = Position::Long;
Real fraNotional = 100.0;
Natural fixingDays = 2;
Natural settlementDays = 0;
// simple Flat forward term structure for Euribor
Handle<YieldTermStructure> euriborTermStructure(
ext::make_shared<FlatForward>(today, euriborRate, dayCounter,
Simple, Once));
// creation of the Euribor pointer
ext::shared_ptr<IborIndex> euribor3m(new
Euribor3M(euriborTermStructure));
// empty Yield Term structure
Handle<YieldTermStructure> emptyTermStructure;
// flat forward term structure
Handle<YieldTermStructure> flatForwardTS(
ext::make_shared<FlatForward>(settlementDays, calendar,
euriborRate, dayCounter, Simple, Once));
// FRA 1x4 creation
ForwardRateAgreement FRA(valueDate,
fraFwdType,
strikeForwardRate,
fraNotional,
euribor3m);
std::cout << "FRA test the constructor taking the index and using
indexed coupon = true\n";
printFRA(FRA);
ForwardRateAgreement FRA2(valueDate,
fraFwdType,
strikeForwardRate,
fraNotional,
euribor3m,
emptyTermStructure,
noIndexCoupon);
std::cout << "FRA test the constructor taking the index and using
indexed coupon = false\n";
printFRA(FRA2);
// this is the new constructor failing, returning the exception
ForwardRateAgreement FRA3(valueDate,
maturityDate,
fraFwdType,
strikeForwardRate,
fraNotional,
flatForwardTS,
fixingDays,
businessDayConvention);
std::cout << "FRA test the new constructor taking the term structure\n";
printFRA(FRA3);
return EXIT_SUCCESS;
}
If you prefer I can just push the code of the PR and then we can look also
at the big picture.
Thanks in advance for your time and your help.
Il giorno gio 13 apr 2023 alle ore 15:55 Luigi Ballabio <
lui...@gm...> ha scritto:
> Hello Jake,
> the bit of code that does the discounting should check if the discount
> handle is empty. If it's not empty, it should use it; otherwise, it should
> fall back to using the forecasting handle instead.
>
> Luigi
>
>
> On Thu, Apr 13, 2023 at 3:11 PM Jake Heke <jak...@gm...> wrote:
>
>> Hi all,
>> I am currently working on a pull request for class ForwardRateAgreement.
>> I coded a new version of the constructor:
>>
>> ForwardRateAgreement(
>> const Date& valueDate,
>> const Date& maturityDate,
>> Position::Type type,
>> Rate strikeForwardRate,
>> Real notionalAmount,
>> Handle<YieldTermStructure> forecastCurve,
>> Natural fixingDays,
>> BusinessDayConvention businessDayConvention,
>> Handle<YieldTermStructure> discountCurve =
>> Handle<YieldTermStructure>());
>>
>> The last discountCurve it is used only if provided, otherwise the
>> forecastCurve is used also for discounting.
>> That's why I provided a default for it as discountCurve =
>> Handle<YieldTermStructure>().
>>
>> Now, before submitting the PR I am trying to test some cases of the new
>> constructor.
>> Guess what? Unsurprisingly it is not working :-)
>> If I try to create the FRA as:
>>
>> ForwardRateAgreement FRA3(valueDate,
>> maturityDate,
>> fraFwdType,
>> strikeForwardRate,
>> fraNotional,
>> flatForwardTS,
>> fixingDays,
>> businessDayConvention);
>>
>> I am getting an exception in handle.hpp which is saying "empty Handle
>> cannot be dereferenced". Here is the piece of code issuing the exception:
>> template <class T>
>> inline const ext::shared_ptr<T>& Handle<T>::operator->() const {
>> QL_REQUIRE(!empty(), "empty Handle cannot be dereferenced");
>> return link_->currentLink();
>>
>> I am getting the same exception even if I call the new constructor by
>> passing explicitly the empty discount curve:
>>
>> ForwardRateAgreement FRA3(valueDate,
>> maturityDate,
>> fraFwdType,
>> strikeForwardRate,
>> fraNotional,
>> flatForwardTS,
>> fixingDays,
>> businessDayConvention,
>> Handle<YieldTermStructure>());
>>
>> What am I missing? Thanks in advance for your help.
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|
|
From: Luigi B. <lui...@gm...> - 2023-04-13 13:55:16
|
Hello Jake,
the bit of code that does the discounting should check if the discount
handle is empty. If it's not empty, it should use it; otherwise, it should
fall back to using the forecasting handle instead.
Luigi
On Thu, Apr 13, 2023 at 3:11 PM Jake Heke <jak...@gm...> wrote:
> Hi all,
> I am currently working on a pull request for class ForwardRateAgreement.
> I coded a new version of the constructor:
>
> ForwardRateAgreement(
> const Date& valueDate,
> const Date& maturityDate,
> Position::Type type,
> Rate strikeForwardRate,
> Real notionalAmount,
> Handle<YieldTermStructure> forecastCurve,
> Natural fixingDays,
> BusinessDayConvention businessDayConvention,
> Handle<YieldTermStructure> discountCurve =
> Handle<YieldTermStructure>());
>
> The last discountCurve it is used only if provided, otherwise the
> forecastCurve is used also for discounting.
> That's why I provided a default for it as discountCurve =
> Handle<YieldTermStructure>().
>
> Now, before submitting the PR I am trying to test some cases of the new
> constructor.
> Guess what? Unsurprisingly it is not working :-)
> If I try to create the FRA as:
>
> ForwardRateAgreement FRA3(valueDate,
> maturityDate,
> fraFwdType,
> strikeForwardRate,
> fraNotional,
> flatForwardTS,
> fixingDays,
> businessDayConvention);
>
> I am getting an exception in handle.hpp which is saying "empty Handle
> cannot be dereferenced". Here is the piece of code issuing the exception:
> template <class T>
> inline const ext::shared_ptr<T>& Handle<T>::operator->() const {
> QL_REQUIRE(!empty(), "empty Handle cannot be dereferenced");
> return link_->currentLink();
>
> I am getting the same exception even if I call the new constructor by
> passing explicitly the empty discount curve:
>
> ForwardRateAgreement FRA3(valueDate,
> maturityDate,
> fraFwdType,
> strikeForwardRate,
> fraNotional,
> flatForwardTS,
> fixingDays,
> businessDayConvention,
> Handle<YieldTermStructure>());
>
> What am I missing? Thanks in advance for your help.
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Jake H. <jak...@gm...> - 2023-04-13 13:08:20
|
Hi all,
I am currently working on a pull request for class ForwardRateAgreement.
I coded a new version of the constructor:
ForwardRateAgreement(
const Date& valueDate,
const Date& maturityDate,
Position::Type type,
Rate strikeForwardRate,
Real notionalAmount,
Handle<YieldTermStructure> forecastCurve,
Natural fixingDays,
BusinessDayConvention businessDayConvention,
Handle<YieldTermStructure> discountCurve =
Handle<YieldTermStructure>());
The last discountCurve it is used only if provided, otherwise the
forecastCurve is used also for discounting.
That's why I provided a default for it as discountCurve =
Handle<YieldTermStructure>().
Now, before submitting the PR I am trying to test some cases of the new
constructor.
Guess what? Unsurprisingly it is not working :-)
If I try to create the FRA as:
ForwardRateAgreement FRA3(valueDate,
maturityDate,
fraFwdType,
strikeForwardRate,
fraNotional,
flatForwardTS,
fixingDays,
businessDayConvention);
I am getting an exception in handle.hpp which is saying "empty Handle
cannot be dereferenced". Here is the piece of code issuing the exception:
template <class T>
inline const ext::shared_ptr<T>& Handle<T>::operator->() const {
QL_REQUIRE(!empty(), "empty Handle cannot be dereferenced");
return link_->currentLink();
I am getting the same exception even if I call the new constructor by
passing explicitly the empty discount curve:
ForwardRateAgreement FRA3(valueDate,
maturityDate,
fraFwdType,
strikeForwardRate,
fraNotional,
flatForwardTS,
fixingDays,
businessDayConvention,
Handle<YieldTermStructure>());
What am I missing? Thanks in advance for your help.
|
|
From: Luigi B. <lui...@gm...> - 2023-04-13 12:50:31
|
Hello everybody,
I just published a RC for version 1.30 at <
https://github.com/lballabio/QuantLib/releases/tag/1.30-rc>.
If you have some time, please give it a spin and report any problems here
on the mailing list. Thanks!
Luigi
|
|
From: Ben W. <ben...@ma...> - 2023-04-13 09:32:46
|
The isda standard model is used to calculate the correct up front amount from a given spread. It is designed so that middle office and traders can agree on what the upfront amount is. The main assumption is that it has a flat hazard rate (rather than a term structure from a CDS curve). (see https://www.cdsmodel.com/) I has other uses - one of my clients are given a CDS marks as a price as the mark-to-market each day- i.e. it is like a bond price eg.... . 100+npv of the CDS on $100 face value. We need to turn that price into a spread, so we use the ISDA standard model to back solve from the NPV to the spread. We don’t need a CDS curve to do this which makes our lives much simpler. In order to get the exact same upfront amount, we do need to use the same IRS curves. It used to be LIBOR curves, but ISDA has switched to RFR rates some time last year I think. Ihsmarkit publish these rfr curves (see https://rfr.ihsmarkit.com/ - yes free market data) so that all the market participants are all on the same page. Hope that helps Ben -----Original Message----- From: Christofer Bogaso <bog...@gm...> Sent: Thursday, April 13, 2023 7:12 PM To: Ben Watson <ben...@ma...> Cc: QuantLib Users <qua...@li...>; Luigi Ballabio <lui...@gm...> Subject: Re: [Quantlib-users] CDS standard ISDA model Hi, Just curious on a question outside of QL. What is exactly **ISDA standard model** for CDS, and how/if it is different from other textbook models (e.g. Hull)? Any reference/book will be highly appreciated. Thanks and regards, On Thu, Apr 13, 2023 at 11:07 AM Ben Watson <ben...@ma...> wrote: > > Hi, > > > > I have adding the ISDA standard model to my CDS class. I have run into > one problem when using SOFR.USD to discount – I get this error > > return _QuantLib.CreditDefaultSwap_impliedHazardRate(self, *args) > > RuntimeError: yield term structure day counter (Actual/360) should be > Act/365(Fixed) > > > > The C++ code has this comment > > “The yield curve should be LIBOR piecewise constant in fwd rates, > with a discount factor of 1 on the calculation date, which coincides > with the trade date.” > > > > Looks like there is some error trapping on the daycount of the > discount curve. With the demise of LIBOR, ISDA has updated the > discounting defn to use RFR’s, USD as an example is now OIS Actual/360. > > > > See 3.2 in the document below. > > https://rfr.ihsmarkit.com/isda/document/RFR%20Interest%20Rate%20Curve% > 20Spe cification%20-%206%20Currencies%20(August%209,%202022).pdf > > > > I could not find the line of code that throw the error, but maybe the > best way to fix this is to get rid of the day count checks. > > > > > > Regards > > > > Ben > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |