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: Arkadiy N. <ark...@gm...> - 2022-12-20 03:57:40
|
Hi Shaun,
>From what I can see in the script, you've moved your evaluation date
forward, but kept swap settlement the same, so your forward rates that
drive floating leg cash flows are now different. Before it was a series of
3M forwards starting 1Y out, and now it's forwards starting 345 days out.
In order to keep the cash flows unchanged, you'd need to account for the
20-days "roll" down the curve or push the settlement out.
On Mon, Dec 19, 2022 at 6:14 PM Shaun Viguerie <svi...@ve...>
wrote:
> Hi All,
>
>
>
> First, I want to thank Luigi & the community for all of the work on
> QuantLib. I’m a new user so apologies if my question is stupid…
>
>
>
> I’ve been trying to get a feel for the mechanics of library—specifically
> around TermStructures and Interest Rate Swaps. In doing so, I wanted to
> test a base case:
>
>
>
> - Create a simple YieldCurve instance using a 3M Short Rate future +
> 1Y-10Y Swap Rates
> - Create a VanillaSwap on top of this structure
> - Evaluate the NPV of this swap & examine the cashflows
> - Advance the calendar 10 days [*without changing the curve at all]*
> - Evaluate the NPV of the swap & examine the cashflows]
>
>
>
> In the above experiment, given that I *am not *changing the curve, I
> would expect the cashflows to remain the same [while the NPVs would
> change]. However, I am unable get this working, despite running through
> several tutorials online (DIMA’s slides, a couple of Luigi’s videos). I
> have gleaned that this might have something to do with adding fixing days
> to the indices? But I’m not sure I understand the mechanics of why that
> would be or how I should think about managing fixings as I advance time in
> the library.
>
>
>
> I’m happy to provide more information…. A messy version of the code is
> attached below:
>
>
>
> import pandas as pd
>
> import QuantLib as ql
>
> from QuantLib import *
>
>
>
> def show_cashflows(leg):
>
> for c in leg:
>
> print ('%20s | %s | %.4f%%' % (c.date(), c.amount(),
>
> as_coupon(c).rate()*100))
>
>
>
>
>
> calendar = TARGET()
>
>
>
> tddt = pd.to_datetime('today').date()
>
> todaysDate = ql.Date(tddt.day, tddt.month, tddt.year)
>
>
>
> Settings.instance().evaluationDate = todaysDate
>
> settlementDate = calendar.advance(todaysDate, 12, ql.Months)
>
>
>
> # market quotes
>
> deposits = { (3,Months): 0.047245}
>
>
>
> swaps = {
>
> (1,Years): 0.05876,
>
> (2,Years): 0.045986,
>
> (4,Years): 0.038589,
>
> (5,Years): 0.036954,
>
> (6,Years): 0.035925,
>
> (7,Years): 0.0352,
>
> (8,Years): 0.034683,
>
> (9,Years): 0.03437,
>
> (10,Years): .034186
>
> }
>
>
>
>
>
> # convert them to Quote objects
>
> for n,unit in deposits.keys():
>
> deposits[(n,unit)] = SimpleQuote(deposits[(n,unit)])
>
> for n,unit in swaps.keys():
>
> swaps[(n,unit)] = SimpleQuote(swaps[(n,unit)])
>
>
>
>
>
> # build rate helpers
>
> dayCounter = Actual360()
>
> settlementDays = 2
>
> depositHelpers = [ DepositRateHelper(QuoteHandle(deposits[(n,unit)]),
>
> Period(n,unit), settlementDays,
>
> calendar, ModifiedFollowing,
>
> False, dayCounter)
>
> for n, unit in [(3,Months) ]]
>
>
>
>
>
> swapHelpers = [ SwapRateHelper(QuoteHandle(swaps[(n,unit)]),
>
> Period(n,unit), calendar,
>
> Annual, Unadjusted,
>
> Actual360(), Euribor6M())
>
> for n, unit in swaps.keys() ]
>
>
>
>
>
> # term-structure construction
>
> helpers = depositHelpers + swapHelpers
>
>
>
> # term structure handles...why do I need both?
>
> discountTermStructure = RelinkableYieldTermStructureHandle()
>
> forecastTermStructure = RelinkableYieldTermStructureHandle()
>
>
>
> depoSwapCurve = PiecewiseLogCubicDiscount(settlementDays, TARGET(),
> helpers, Actual360())
>
> depoSwapCurve.enableExtrapolation()
>
>
>
> swapEngine = DiscountingSwapEngine(discountTermStructure)
>
>
>
> # 5Y Swap
>
> nominal = 1000000
>
> maturity1 = calendar.advance(settlementDate,5,Years)
>
>
>
>
>
> fixedRate = 0.036954
>
>
>
> spread = 0.0
>
>
>
> index = ql.USDLibor(ql.Period(3, ql.Months), forecastTermStructure)
>
>
>
> floatingLegAdjustment = ModifiedFollowing
>
> floatingLegDayCounter = index.dayCounter()
>
>
>
> fixedSchedule1 = Schedule(settlementDate, maturity1,
>
> Period(1, Years), calendar,
>
> Unadjusted, Unadjusted,
>
> DateGeneration.Forward, False)
>
> floatingSchedule1 = Schedule(settlementDate, maturity1,
>
> Period(6,Months), calendar,
>
> ModifiedFollowing, ModifiedFollowing,
>
> DateGeneration.Forward, False)
>
>
>
> # when I create the swap using this method, the cashflows remain fixed
> upon advancing the day
>
> spot1 = VanillaSwap(VanillaSwap.Receiver, nominal,
>
> fixedSchedule1, fixedRate, Actual360(),
>
> floatingSchedule1, index, spread,
>
> floatingLegDayCounter)
>
>
>
>
>
> spot1.setPricingEngine(swapEngine)
>
> discountTermStructure.linkTo(depoSwapCurve)
>
> forecastTermStructure.linkTo(depoSwapCurve)
>
>
>
>
>
> Settings.instance().evaluationDate = todaysDate
>
> print ('Fair Rate: {}'.format(spot1.fairRate()))
>
> print('NPV: {}'.format(spot1.NPV()))
>
> print('fixed cashflows:')
>
> show_cashflows(spot1.fixedLeg())
>
> print('floating cashflows:')
>
> show_cashflows(spot1.floatingLeg())
>
>
>
> ## AFTER DOING THIS THE FLOATING CASHFLOWS CHANGE AND I WOULD NOT EXPECT
> THEM TO
>
>
>
> Settings.instance().evaluationDate = calendar.advance(todaysDate, 20, Days)
>
> print (spot1.fairRate())
>
> print(spot1.NPV())
>
> print ('Fair Rate: {}'.format(spot1.fairRate()))
>
> print('NPV: {}'.format(spot1.NPV()))
>
> print('fixed cashflows:')
>
> show_cashflows(spot1.fixedLeg())
>
> print('floating cashflows:')
>
> show_cashflows(spot1.floatingLeg())
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Jack G <jac...@gm...> - 2022-12-20 00:24:45
|
Hi Dan, Just for reference on the PTD Heston, adding a path generator for PTD Heston was something I looked at during a side project a year or so ago - there is some code in an abandoned pull request here but it's fairly horrible: https://github.com/lballabio/QuantLib/pull/1185/files In the end I found exactly the problems you have mentioned for PTD Heston - hard and slow to calibrate, and I wasn't getting much convergence from the MC prices for anything beyond vanillas. A lot of this is because several of the extremely useful optimizations for Heston path generation stop working nicely in PTD Heston. Best luck with the project, Jack On Tue, 20 Dec 2022, 01:24 Dan VolPM, <dan...@gm...> wrote: > Hello experts, > > Has anyone been able to price any product in monte carlo (generating path > via the GaussianMultiPathGenerator) using either a local vol surface or a > piecewise Heston ? > I should mention we used python. > > *The problems with LocalVol is:* > - Only the AndreasenHugeVolatility does not break when generating paths, > however there is such a loss of information in the process of building it > that the prices generated are extremely far from the calibrating vanillas > - Whenever we use our (smoothed and cleaned) BlackVarianceSurface and > generate paths with it, it is converted into a localvol surface under the > cover which is perfect for path generation BUT it is virtually impossible > to actually get paths that don't break on "arbitrages". I use the quote > there for arbitrage because the test used is so granular that converting > any kind of real life market surface will fail (I'm not talking here about > the 4x4 matrices that we all use for examples but rather a huge SPX surface > with tons of strikes and maturities). Even an SVI failed at that which is > telling me either we do something very wrong or the falling var and fly > testing is just too granular. > > => this leaves us stuck unable to price any non standard payoff in LV > > *The problem with PTD Heston is:* > - It takes forever to calibrate and still has a pretty poor quality of fit > - there is no way to build a PTDHeston process like there is for regular > Heston. Consequently building paths is just impossible. > > Is there a different way to go about pricing non standard payoffs using > one of these 2 methods ? > Happy to hear from someone who can actually make it work. > > Any help would be greatly appreciated. > Thank you > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Shaun V. <svi...@ve...> - 2022-12-19 23:11:30
|
Hi All,
First, I want to thank Luigi & the community for all of the work on QuantLib. I'm a new user so apologies if my question is stupid...
I've been trying to get a feel for the mechanics of library-specifically around TermStructures and Interest Rate Swaps. In doing so, I wanted to test a base case:
* Create a simple YieldCurve instance using a 3M Short Rate future + 1Y-10Y Swap Rates
* Create a VanillaSwap on top of this structure
* Evaluate the NPV of this swap & examine the cashflows
* Advance the calendar 10 days [without changing the curve at all]
* Evaluate the NPV of the swap & examine the cashflows]
In the above experiment, given that I am not changing the curve, I would expect the cashflows to remain the same [while the NPVs would change]. However, I am unable get this working, despite running through several tutorials online (DIMA's slides, a couple of Luigi's videos). I have gleaned that this might have something to do with adding fixing days to the indices? But I'm not sure I understand the mechanics of why that would be or how I should think about managing fixings as I advance time in the library.
I'm happy to provide more information.... A messy version of the code is attached below:
import pandas as pd
import QuantLib as ql
from QuantLib import *
def show_cashflows(leg):
for c in leg:
print ('%20s | %s | %.4f%%' % (c.date(), c.amount(),
as_coupon(c).rate()*100))
calendar = TARGET()
tddt = pd.to_datetime('today').date()
todaysDate = ql.Date(tddt.day, tddt.month, tddt.year)
Settings.instance().evaluationDate = todaysDate
settlementDate = calendar.advance(todaysDate, 12, ql.Months)
# market quotes
deposits = { (3,Months): 0.047245}
swaps = {
(1,Years): 0.05876,
(2,Years): 0.045986,
(4,Years): 0.038589,
(5,Years): 0.036954,
(6,Years): 0.035925,
(7,Years): 0.0352,
(8,Years): 0.034683,
(9,Years): 0.03437,
(10,Years): .034186
}
# convert them to Quote objects
for n,unit in deposits.keys():
deposits[(n,unit)] = SimpleQuote(deposits[(n,unit)])
for n,unit in swaps.keys():
swaps[(n,unit)] = SimpleQuote(swaps[(n,unit)])
# build rate helpers
dayCounter = Actual360()
settlementDays = 2
depositHelpers = [ DepositRateHelper(QuoteHandle(deposits[(n,unit)]),
Period(n,unit), settlementDays,
calendar, ModifiedFollowing,
False, dayCounter)
for n, unit in [(3,Months) ]]
swapHelpers = [ SwapRateHelper(QuoteHandle(swaps[(n,unit)]),
Period(n,unit), calendar,
Annual, Unadjusted,
Actual360(), Euribor6M())
for n, unit in swaps.keys() ]
# term-structure construction
helpers = depositHelpers + swapHelpers
# term structure handles...why do I need both?
discountTermStructure = RelinkableYieldTermStructureHandle()
forecastTermStructure = RelinkableYieldTermStructureHandle()
depoSwapCurve = PiecewiseLogCubicDiscount(settlementDays, TARGET(), helpers, Actual360())
depoSwapCurve.enableExtrapolation()
swapEngine = DiscountingSwapEngine(discountTermStructure)
# 5Y Swap
nominal = 1000000
maturity1 = calendar.advance(settlementDate,5,Years)
fixedRate = 0.036954
spread = 0.0
index = ql.USDLibor(ql.Period(3, ql.Months), forecastTermStructure)
floatingLegAdjustment = ModifiedFollowing
floatingLegDayCounter = index.dayCounter()
fixedSchedule1 = Schedule(settlementDate, maturity1,
Period(1, Years), calendar,
Unadjusted, Unadjusted,
DateGeneration.Forward, False)
floatingSchedule1 = Schedule(settlementDate, maturity1,
Period(6,Months), calendar,
ModifiedFollowing, ModifiedFollowing,
DateGeneration.Forward, False)
# when I create the swap using this method, the cashflows remain fixed upon advancing the day
spot1 = VanillaSwap(VanillaSwap.Receiver, nominal,
fixedSchedule1, fixedRate, Actual360(),
floatingSchedule1, index, spread,
floatingLegDayCounter)
spot1.setPricingEngine(swapEngine)
discountTermStructure.linkTo(depoSwapCurve)
forecastTermStructure.linkTo(depoSwapCurve)
Settings.instance().evaluationDate = todaysDate
print ('Fair Rate: {}'.format(spot1.fairRate()))
print('NPV: {}'.format(spot1.NPV()))
print('fixed cashflows:')
show_cashflows(spot1.fixedLeg())
print('floating cashflows:')
show_cashflows(spot1.floatingLeg())
## AFTER DOING THIS THE FLOATING CASHFLOWS CHANGE AND I WOULD NOT EXPECT THEM TO
Settings.instance().evaluationDate = calendar.advance(todaysDate, 20, Days)
print (spot1.fairRate())
print(spot1.NPV())
print ('Fair Rate: {}'.format(spot1.fairRate()))
print('NPV: {}'.format(spot1.NPV()))
print('fixed cashflows:')
show_cashflows(spot1.fixedLeg())
print('floating cashflows:')
show_cashflows(spot1.floatingLeg())
|
|
From: Dan V. <dan...@gm...> - 2022-12-19 17:24:34
|
Hello experts, Has anyone been able to price any product in monte carlo (generating path via the GaussianMultiPathGenerator) using either a local vol surface or a piecewise Heston ? I should mention we used python. *The problems with LocalVol is:* - Only the AndreasenHugeVolatility does not break when generating paths, however there is such a loss of information in the process of building it that the prices generated are extremely far from the calibrating vanillas - Whenever we use our (smoothed and cleaned) BlackVarianceSurface and generate paths with it, it is converted into a localvol surface under the cover which is perfect for path generation BUT it is virtually impossible to actually get paths that don't break on "arbitrages". I use the quote there for arbitrage because the test used is so granular that converting any kind of real life market surface will fail (I'm not talking here about the 4x4 matrices that we all use for examples but rather a huge SPX surface with tons of strikes and maturities). Even an SVI failed at that which is telling me either we do something very wrong or the falling var and fly testing is just too granular. => this leaves us stuck unable to price any non standard payoff in LV *The problem with PTD Heston is:* - It takes forever to calibrate and still has a pretty poor quality of fit - there is no way to build a PTDHeston process like there is for regular Heston. Consequently building paths is just impossible. Is there a different way to go about pricing non standard payoffs using one of these 2 methods ? Happy to hear from someone who can actually make it work. Any help would be greatly appreciated. Thank you |
|
From: Ashish B. <ash...@gm...> - 2022-12-18 12:46:10
|
Strangely i tried the CME option calculator online to gat IV for this kind of option trading at intrinsic value. And still it gave some IV without any errors with Black76 model too. Not sure how they do it. Ashish On Sun, Dec 18, 2022, 5:55 PM Jonathan Sweemer <sw...@gm...> wrote: > Hi Ashish, > > It makes sense that there would be no solution in the case where an option > has no time value. I'm not sure what else QuantLib can do in this case > except perhaps more informative error messages. > > You might want to survey the literature for ways of modeling this product > outside of a Black-Scholes framework. > > On Sun, Dec 18, 2022 at 1:21 AM Ashish Bansal <ash...@gm...> > wrote: > >> My message was not going due to the screenshots so sending again without >> them. >> >> Please guide. >> >> Regards >> Ashish >> >> On Sat, Dec 17, 2022, 1:03 AM Ashish Bansal <ash...@gm...> >> wrote: >> >>> Hi all, any views here? >>> >>> On Tue, Dec 6, 2022, 10:15 PM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> Hi All, >>>> >>>> In 1 of the exchange traded option market I see strange behaviour which >>>> is failing our quantlib code to value the options. The put options for >>>> nearby month are trading only at the intrinsic value with exactly 0 time >>>> value although a good 1 month is remaining in expiry which is 4th Jan 2023. >>>> Future quotes (underlying) as of 5th Dec: >>>> >>>> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.html >>>> >>>> Option prices as of 5th Dec: >>>> >>>> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.options.html#optionProductId=782&strikeRange=ALL&expiration=782-Z2 >>>> >>>> Time value in the above trading: 16.425 - Max(160 - 143.575,0) = 0 >>>> >>>> We are using the blackscholes engine with American option and using >>>> option.impliedvolatility method to calculate the market implied volatility >>>> for these options. For these options, we are getting runtime error as root >>>> not bracketed error: >>>> RuntimeError: root not bracketed: f[0.0001,4] -> >>>> [6.394885e-14,5.818200e+01] >>>> >>>> How should we price these kinds of ITM options? >>>> >>>> Thanks >>>> Ashish Bansal >>>> >>> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Jonathan S. <sw...@gm...> - 2022-12-18 12:25:16
|
Hi Ashish, It makes sense that there would be no solution in the case where an option has no time value. I'm not sure what else QuantLib can do in this case except perhaps more informative error messages. You might want to survey the literature for ways of modeling this product outside of a Black-Scholes framework. On Sun, Dec 18, 2022 at 1:21 AM Ashish Bansal <ash...@gm...> wrote: > My message was not going due to the screenshots so sending again without > them. > > Please guide. > > Regards > Ashish > > On Sat, Dec 17, 2022, 1:03 AM Ashish Bansal <ash...@gm...> > wrote: > >> Hi all, any views here? >> >> On Tue, Dec 6, 2022, 10:15 PM Ashish Bansal <ash...@gm...> >> wrote: >> >>> Hi All, >>> >>> In 1 of the exchange traded option market I see strange behaviour which >>> is failing our quantlib code to value the options. The put options for >>> nearby month are trading only at the intrinsic value with exactly 0 time >>> value although a good 1 month is remaining in expiry which is 4th Jan 2023. >>> Future quotes (underlying) as of 5th Dec: >>> >>> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.html >>> >>> Option prices as of 5th Dec: >>> >>> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.options.html#optionProductId=782&strikeRange=ALL&expiration=782-Z2 >>> >>> Time value in the above trading: 16.425 - Max(160 - 143.575,0) = 0 >>> >>> We are using the blackscholes engine with American option and using >>> option.impliedvolatility method to calculate the market implied volatility >>> for these options. For these options, we are getting runtime error as root >>> not bracketed error: >>> RuntimeError: root not bracketed: f[0.0001,4] -> >>> [6.394885e-14,5.818200e+01] >>> >>> How should we price these kinds of ITM options? >>> >>> Thanks >>> Ashish Bansal >>> >> _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Jake H. <jak...@gm...> - 2022-12-17 16:37:51
|
Hi Jonathan, I was not aware of this functionality. Thanks for pointing it out and also for the sample file, much appreciated. Cheers Hi Jake, > > The usual way to configure the CMake build - regardless of the IDE you are > using - is to create a file called CMakeUserPresets.json in the root > directory of the QuantLib project, next to the existing CMakePresets.json > file, and specify the CMake options that you want in there. You shouldn't > modify CMakeLists.txt directly. > > I've attached a sample CMakeUserPresets.json file that you can use to > compile the main library only - not the tests, benchmarks, or examples. It > should only be necessary for you to update the BOOST_ROOT variable to point > to your local installation. > > In Visual Studio Code, just install the recommended CMake extensions, and > choose the configure and build presets like so: > > [image: image.png] > > Then all you have to do is press F7 to start the build. > > Hope this helps. > > On Sat, Dec 17, 2022 at 7:02 PM Jake Heke <jak...@gm...> wrote: > >> Ciao Cay, >> Building QuantLib with Visual Studio Code is no joke! The tool IMHO is >> more flexible than VS Community, but of course more flexibility comes at >> the price of more configuration effort. >> I was able to successfully build the whole solution wihout examples and >> test suite by using CMake. In this way the build time I think it was a bit >> shortened. >> In order to exclude those items from the build process it is enough to >> manually edit the CMake configuration file CMakeLists.txt which is located >> in the root QuanLib installation directory. >> Thanks for your support. >> Cheers >> W. >> >> Il giorno ven 16 dic 2022 alle ore 21:07 <cay...@fr...> ha >> scritto: >> >>> Ciao Jake, >>> >>> >>> >>> I have never tried to build QuantLib on MinGW, but: >>> >>> Since you are building a C++ library, you need to build the whole thing, >>> the least you have to build is the QuantLib itself excluding the examples >>> and tests. But once you have managed to build QuantLib, you might just as >>> well build the other stuff, too. >>> >>> So, there is no shortcut I am afraid. >>> >>> (Of course, in theory, you could create your own project ‘Sub-QuantLib’ >>> with only calendar.cpp and all its dependencies. But this would require >>> painfully finding out all the dependencies of calendar.cpp and removing all >>> the overhead in for instance configure.hpp. In practice, this would not be >>> advisable, really. And it wouldn’t be a shortcut either.) >>> >>> >>> >>> The best way to tackle this kind of problem in C++ is usually to present >>> the specific linker errors. >>> >>> >>> >>> Since you mentioned boost specifically, my first guess would be that >>> either the linker cannot find the boost libraries, or you have an >>> incompatible glibc version. >>> >>> >>> >>> But once again, the specific linker errors are key here. >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Cay >>> >>> >>> >>> *From:* Jake Heke <jak...@gm...> >>> *Sent:* Freitag, 16. Dezember 2022 20:10 >>> *To:* qua...@li... >>> *Subject:* [Quantlib-users] How to partially build and test the >>> QuantLib solution >>> >>> >>> >>> Hello experts, >>> I am a new QuantLib user, currently trying to build the solution on >>> Windows with Visual Studio Code, Boost, CMake and MinGW. >>> I am still not able to build it because I am getting a good list of >>> linking errors. >>> Anyway, let's suppose that I want to build and test only the >>> functionalities containted in the source file >>> \QuantLib\ql\time\calendar.cpp (with all the required dipendences of >>> course). >>> According to your experience, is there a way to do it, or in order to >>> test the calendar functionalities I am forced to build the whole solution? >>> I apologize for the newbie question and thank you in advance for your >>> time. >>> >>> Best, >>> W. >>> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Ashish B. <ash...@gm...> - 2022-12-17 16:15:17
|
My message was not going due to the screenshots so sending again without them. Please guide. Regards Ashish On Sat, Dec 17, 2022, 1:03 AM Ashish Bansal <ash...@gm...> wrote: > Hi all, any views here? > > On Tue, Dec 6, 2022, 10:15 PM Ashish Bansal <ash...@gm...> > wrote: > >> Hi All, >> >> In 1 of the exchange traded option market I see strange behaviour which >> is failing our quantlib code to value the options. The put options for >> nearby month are trading only at the intrinsic value with exactly 0 time >> value although a good 1 month is remaining in expiry which is 4th Jan 2023. >> Future quotes (underlying) as of 5th Dec: >> >> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.html >> >> Option prices as of 5th Dec: >> >> https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.options.html#optionProductId=782&strikeRange=ALL&expiration=782-Z2 >> >> Time value in the above trading: 16.425 - Max(160 - 143.575,0) = 0 >> >> We are using the blackscholes engine with American option and using >> option.impliedvolatility method to calculate the market implied volatility >> for these options. For these options, we are getting runtime error as root >> not bracketed error: >> RuntimeError: root not bracketed: f[0.0001,4] -> >> [6.394885e-14,5.818200e+01] >> >> How should we price these kinds of ITM options? >> >> Thanks >> Ashish Bansal >> > |
|
From: Jonathan S. <sw...@gm...> - 2022-12-17 12:00:44
|
Hi Jake, The usual way to configure the CMake build - regardless of the IDE you are using - is to create a file called CMakeUserPresets.json in the root directory of the QuantLib project, next to the existing CMakePresets.json file, and specify the CMake options that you want in there. You shouldn't modify CMakeLists.txt directly. I've attached a sample CMakeUserPresets.json file that you can use to compile the main library only - not the tests, benchmarks, or examples. It should only be necessary for you to update the BOOST_ROOT variable to point to your local installation. In Visual Studio Code, just install the recommended CMake extensions, and choose the configure and build presets like so: [image: image.png] Then all you have to do is press F7 to start the build. Hope this helps. On Sat, Dec 17, 2022 at 7:02 PM Jake Heke <jak...@gm...> wrote: > Ciao Cay, > Building QuantLib with Visual Studio Code is no joke! The tool IMHO is > more flexible than VS Community, but of course more flexibility comes at > the price of more configuration effort. > I was able to successfully build the whole solution wihout examples and > test suite by using CMake. In this way the build time I think it was a bit > shortened. > In order to exclude those items from the build process it is enough to > manually edit the CMake configuration file CMakeLists.txt which is located > in the root QuanLib installation directory. > Thanks for your support. > Cheers > W. > > Il giorno ven 16 dic 2022 alle ore 21:07 <cay...@fr...> ha scritto: > >> Ciao Jake, >> >> >> >> I have never tried to build QuantLib on MinGW, but: >> >> Since you are building a C++ library, you need to build the whole thing, >> the least you have to build is the QuantLib itself excluding the examples >> and tests. But once you have managed to build QuantLib, you might just as >> well build the other stuff, too. >> >> So, there is no shortcut I am afraid. >> >> (Of course, in theory, you could create your own project ‘Sub-QuantLib’ >> with only calendar.cpp and all its dependencies. But this would require >> painfully finding out all the dependencies of calendar.cpp and removing all >> the overhead in for instance configure.hpp. In practice, this would not be >> advisable, really. And it wouldn’t be a shortcut either.) >> >> >> >> The best way to tackle this kind of problem in C++ is usually to present >> the specific linker errors. >> >> >> >> Since you mentioned boost specifically, my first guess would be that >> either the linker cannot find the boost libraries, or you have an >> incompatible glibc version. >> >> >> >> But once again, the specific linker errors are key here. >> >> >> >> Cheers, >> >> >> >> Cay >> >> >> >> *From:* Jake Heke <jak...@gm...> >> *Sent:* Freitag, 16. Dezember 2022 20:10 >> *To:* qua...@li... >> *Subject:* [Quantlib-users] How to partially build and test the QuantLib >> solution >> >> >> >> Hello experts, >> I am a new QuantLib user, currently trying to build the solution on >> Windows with Visual Studio Code, Boost, CMake and MinGW. >> I am still not able to build it because I am getting a good list of >> linking errors. >> Anyway, let's suppose that I want to build and test only the >> functionalities containted in the source file >> \QuantLib\ql\time\calendar.cpp (with all the required dipendences of >> course). >> According to your experience, is there a way to do it, or in order to >> test the calendar functionalities I am forced to build the whole solution? >> I apologize for the newbie question and thank you in advance for your >> time. >> >> Best, >> W. >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Jake H. <jak...@gm...> - 2022-12-17 10:01:11
|
Ciao Cay, Building QuantLib with Visual Studio Code is no joke! The tool IMHO is more flexible than VS Community, but of course more flexibility comes at the price of more configuration effort. I was able to successfully build the whole solution wihout examples and test suite by using CMake. In this way the build time I think it was a bit shortened. In order to exclude those items from the build process it is enough to manually edit the CMake configuration file CMakeLists.txt which is located in the root QuanLib installation directory. Thanks for your support. Cheers W. Il giorno ven 16 dic 2022 alle ore 21:07 <cay...@fr...> ha scritto: > Ciao Jake, > > > > I have never tried to build QuantLib on MinGW, but: > > Since you are building a C++ library, you need to build the whole thing, > the least you have to build is the QuantLib itself excluding the examples > and tests. But once you have managed to build QuantLib, you might just as > well build the other stuff, too. > > So, there is no shortcut I am afraid. > > (Of course, in theory, you could create your own project ‘Sub-QuantLib’ > with only calendar.cpp and all its dependencies. But this would require > painfully finding out all the dependencies of calendar.cpp and removing all > the overhead in for instance configure.hpp. In practice, this would not be > advisable, really. And it wouldn’t be a shortcut either.) > > > > The best way to tackle this kind of problem in C++ is usually to present > the specific linker errors. > > > > Since you mentioned boost specifically, my first guess would be that > either the linker cannot find the boost libraries, or you have an > incompatible glibc version. > > > > But once again, the specific linker errors are key here. > > > > Cheers, > > > > Cay > > > > *From:* Jake Heke <jak...@gm...> > *Sent:* Freitag, 16. Dezember 2022 20:10 > *To:* qua...@li... > *Subject:* [Quantlib-users] How to partially build and test the QuantLib > solution > > > > Hello experts, > I am a new QuantLib user, currently trying to build the solution on > Windows with Visual Studio Code, Boost, CMake and MinGW. > I am still not able to build it because I am getting a good list of > linking errors. > Anyway, let's suppose that I want to build and test only the > functionalities containted in the source file > \QuantLib\ql\time\calendar.cpp (with all the required dipendences of > course). > According to your experience, is there a way to do it, or in order to test > the calendar functionalities I am forced to build the whole solution? > I apologize for the newbie question and thank you in advance for your time. > > Best, > W. > |
|
From: Jake H. <jak...@gm...> - 2022-12-17 09:59:16
|
Ciao Cay, Building QuantLib with Visual Studio Code is no joke! The tool IMHO is more flexible than VS Community, but of course more flexibility comes at the price of more configuration effort. I was able to successfully build the whole solution wihout examples and test suite by using CMake. In this way the build time I think it was a bit shortened. In order to exclude those items from the build process it is enough to manually edit the CMake configuration file CMakeLists.txt which is located in the root QuanLib installation directory. Thanks for your support. Cheers W. Il giorno ven 16 dic 2022 alle ore 21:07 <cay...@fr...> ha scritto: > Ciao Jake, > > > > I have never tried to build QuantLib on MinGW, but: > > Since you are building a C++ library, you need to build the whole thing, > the least you have to build is the QuantLib itself excluding the examples > and tests. But once you have managed to build QuantLib, you might just as > well build the other stuff, too. > > So, there is no shortcut I am afraid. > > (Of course, in theory, you could create your own project ‘Sub-QuantLib’ > with only calendar.cpp and all its dependencies. But this would require > painfully finding out all the dependencies of calendar.cpp and removing all > the overhead in for instance configure.hpp. In practice, this would not be > advisable, really. And it wouldn’t be a shortcut either.) > > > > The best way to tackle this kind of problem in C++ is usually to present > the specific linker errors. > > > > Since you mentioned boost specifically, my first guess would be that > either the linker cannot find the boost libraries, or you have an > incompatible glibc version. > > > > But once again, the specific linker errors are key here. > > > > Cheers, > > > > Cay > > > > *From:* Jake Heke <jak...@gm...> > *Sent:* Freitag, 16. Dezember 2022 20:10 > *To:* qua...@li... > *Subject:* [Quantlib-users] How to partially build and test the QuantLib > solution > > > > Hello experts, > I am a new QuantLib user, currently trying to build the solution on > Windows with Visual Studio Code, Boost, CMake and MinGW. > I am still not able to build it because I am getting a good list of > linking errors. > Anyway, let's suppose that I want to build and test only the > functionalities containted in the source file > \QuantLib\ql\time\calendar.cpp (with all the required dipendences of > course). > According to your experience, is there a way to do it, or in order to test > the calendar functionalities I am forced to build the whole solution? > I apologize for the newbie question and thank you in advance for your time. > > Best, > W. > |
|
From: <cay...@fr...> - 2022-12-16 20:25:47
|
Ciao Jake, I have never tried to build QuantLib on MinGW, but: Since you are building a C++ library, you need to build the whole thing, the least you have to build is the QuantLib itself excluding the examples and tests. But once you have managed to build QuantLib, you might just as well build the other stuff, too. So, there is no shortcut I am afraid. (Of course, in theory, you could create your own project ‘Sub-QuantLib’ with only calendar.cpp and all its dependencies. But this would require painfully finding out all the dependencies of calendar.cpp and removing all the overhead in for instance configure.hpp. In practice, this would not be advisable, really. And it wouldn’t be a shortcut either.) The best way to tackle this kind of problem in C++ is usually to present the specific linker errors. Since you mentioned boost specifically, my first guess would be that either the linker cannot find the boost libraries, or you have an incompatible glibc version. But once again, the specific linker errors are key here. Cheers, Cay From: Jake Heke <jak...@gm...> Sent: Freitag, 16. Dezember 2022 20:10 To: qua...@li... Subject: [Quantlib-users] How to partially build and test the QuantLib solution Hello experts, I am a new QuantLib user, currently trying to build the solution on Windows with Visual Studio Code, Boost, CMake and MinGW. I am still not able to build it because I am getting a good list of linking errors. Anyway, let's suppose that I want to build and test only the functionalities containted in the source file \QuantLib\ql\time\calendar.cpp (with all the required dipendences of course). According to your experience, is there a way to do it, or in order to test the calendar functionalities I am forced to build the whole solution? I apologize for the newbie question and thank you in advance for your time. Best, W. |
|
From: Ashish B. <ash...@gm...> - 2022-12-16 19:33:23
|
Hi all, any views here? On Tue, Dec 6, 2022, 10:15 PM Ashish Bansal <ash...@gm...> wrote: > Hi All, > > In 1 of the exchange traded option market I see strange behaviour which is > failing our quantlib code to value the options. The put options for nearby > month are trading only at the intrinsic value with exactly 0 time value > although a good 1 month is remaining in expiry which is 4th Jan 2023. > Future quotes (underlying) as of 5th Dec: > > https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.html > [image: image.png] > > Option prices as of 5th Dec: > > https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.options.html#optionProductId=782&strikeRange=ALL&expiration=782-Z2 > [image: image.png] > > Time value in the above trading: 16.425 - Max(160 - 143.575,0) = 0 > > We are using the blackscholes engine with American option and using > option.impliedvolatility method to calculate the market implied volatility > for these options. For these options, we are getting runtime error as root > not bracketed error: > RuntimeError: root not bracketed: f[0.0001,4] -> > [6.394885e-14,5.818200e+01] > > How should we price these kinds of ITM options? > > Thanks > Ashish Bansal > |
|
From: Jake H. <jak...@gm...> - 2022-12-16 19:09:52
|
Hello experts, I am a new QuantLib user, currently trying to build the solution on Windows with Visual Studio Code, Boost, CMake and MinGW. I am still not able to build it because I am getting a good list of linking errors. Anyway, let's suppose that I want to build and test only the functionalities containted in the source file \QuantLib\ql\time\calendar.cpp (with all the required dipendences of course). According to your experience, is there a way to do it, or in order to test the calendar functionalities I am forced to build the whole solution? I apologize for the newbie question and thank you in advance for your time. Best, W. |
|
From: Dan V. <dan...@gm...> - 2022-12-15 19:55:28
|
Hello, Has anyone been able to price any product in monte carlo (generating path via the GaussianMultiPathGenerator) using either a local vol surface or a piecewise Heston ? I should mention we used python. *The problems with LocalVol is:* - Only the AndreasenHugeVolatility does not break when generating paths, however there is such a loss of information in the process of building it that the prices generated are extremely far from the calibrating vanillas - Whenever we use our (smoothed and cleaned) BlackVarianceSurface and generate paths with it, it is converted into a localvol surface under the cover which is perfect for path generation BUT it is virtually impossible to actually get paths that don't break on "arbitrages". I use the quote there for arbitrage because the test used is so granular that converting any kind of real life market surface will fail (I'm not talking here about the 4x4 matrices that we all use for examples but rather a huge SPX surface with tons of strikes and maturities). Even an SVI failed at that which is telling me either we do something very wrong or the falling var and fly testing is just too granular. => this leaves us stuck unable to price any non standard payoff in LV *The problem with PTD Heston is:* - It takes forever to calibrate and still has a pretty poor quality of fit - there is no way to build a PTDHeston process like there is for regular Heston. Consequently building paths is just impossible. Is there a different way to go about pricing non standard payoffs using one of these 2 methods ? Happy to hear from someone who can actually make it work. Thank you |
|
From: Dan V. <dan...@gm...> - 2022-12-14 22:52:44
|
Hi Klaus,
Following up on this example, it turns out AH actually produces a very poor
calibration quality when fed many data points (like an SPX vol surface).
Alternatively we have tried to build a classic localvol surface from our
blackvariancesurface which works. However, when generating paths for Monte
Carlo, it appears that many paths have extremely weird jumps (from 2700 to
0.1 for example see below) which makes all valuations completely wrong
clearly.
I was wondering if this is a behavior you have observed before and could
point us in the right direction on something we may be doing wrong ?
We are feeding a SPX volatility surface with many points that would be too
long to reproduce here. Getting it to not break has taken us a lot of
effort as it appears the QL checks are extremely extremely sensitive (in
fact it is almost impossible to actually build a local vol from a
blackvariancesurface that doesn't break).
In the end we managed to get a path generation that works (very similar to
the way you generate the paths below except with a classic local vol
derived from our standard surface instead of the AH one in your code) but
we get these very strange paths which couldn't be explained even with an
insanely broken surface.
I guess my question is dual:
1. Do you know of an obvious mistake people make that leads to this kind of
behavior ?
2. If not, has anyone been able to implement real life pricing with local
vol in QL ? (by real life I mean beyond the 4x4 vol surfaces that are used
in examples that are usually well behaved enough due to the low number of
points)
Thank you so much for your help !
Attached are examples of such paths as described above. All of them have
one of these weird jumps at some point. The ones below have these jumps at
the very beginning.
[image: image.png]
On Thu, Nov 17, 2022 at 4:46 AM Wojciech Slusarski <
woj...@gm...> wrote:
> Klaus,
>
> I agree with Dan, it is very usefull, it deserves posting in
> Python/examples directory.
>
> Regards,
> Wojtek
>
> czw., 17 lis 2022, 02:29 użytkownik Dan VolPM <dan...@gm...>
> napisał:
>
>> Thank you so much Klaus, this is extremely useful and thorough and
>> definitely helps a ton !
>>
>> On Tue, Nov 15, 2022 at 5:32 PM Klaus Spanderen <kl...@sp...>
>> wrote:
>>
>>> Hi Dan,
>>>
>>>
>>>
>>> please find below an example of a Andreasen-Huge local volatility
>>> calibration, a Monte-Carlo pricing of one of the calibration options using
>>> this local volatility surface and the comparison with the expected result.
>>>
>>>
>>>
>>> W.r.t. point 1, the GeneralizedBlackScholesProcess should be constructed
>>> directly using the local volatility surface from the Andreasen-Huge
>>> algorithm (see code below), not the implied volatility surface from the
>>> Andreasen-Huge interpolation algorithm. In the latter case the process
>>> would use Dupire's equation to get back the local volatility, which is
>>> notourisly instable and might lead to arbitrage violations.
>>>
>>>
>>>
>>> I hope the example code below helps wr.t. 2 and 3.
>>>
>>>
>>>
>>> best regards
>>>
>>> Klaus
>>>
>>>
>>>
>>>
>>>
>>> import math
>>>
>>> import QuantLib as ql
>>>
>>>
>>>
>>> if __name__ == "__main__":
>>>
>>> today = ql.Date.todaysDate()
>>>
>>> ql.Settings.instance().evaluationDate = today
>>>
>>>
>>>
>>> spot = ql.QuoteHandle(ql.SimpleQuote(100))
>>>
>>>
>>>
>>> dc = ql.Actual365Fixed()
>>>
>>> qTS = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.025, dc))
>>>
>>> rTS = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.05, dc))
>>>
>>>
>>>
>>> vol_data = [
>>>
>>> # maturity in days, strike, volatility
>>>
>>> (30, 75, 0.13),
>>>
>>> (30, 100, 0.26),
>>>
>>> (30, 125, 0.3),
>>>
>>> (180, 80, 0.4),
>>>
>>> (180, 150, 0.6),
>>>
>>> (365, 110, 0.5)]
>>>
>>>
>>>
>>> calibration_set = ql.CalibrationSet(
>>>
>>> [(
>>>
>>> ql.VanillaOption(
>>>
>>> ql.PlainVanillaPayoff(ql.Option.Call, strike),
>>>
>>> ql.EuropeanExercise(today + ql.Period(maturity_in_days, ql.Days))
>>>
>>> ),
>>>
>>> ql.SimpleQuote(volatility)
>>>
>>> ) for maturity_in_days, strike, volatility in vol_data]
>>>
>>> )
>>>
>>>
>>>
>>> local_vol = ql.LocalVolTermStructureHandle(
>>>
>>> ql.AndreasenHugeLocalVolAdapter(
>>>
>>> ql.AndreasenHugeVolatilityInterpl(calibration_set, spot, rTS, qTS)
>>>
>>> )
>>>
>>> )
>>>
>>>
>>>
>>> option = calibration_set[-2][0] # maturity in days: 180, strike: 150,
>>> vol: 0.6
>>>
>>>
>>>
>>> dummy_vol = ql.BlackVolTermStructureHandle()
>>>
>>> local_vol_process = ql.GeneralizedBlackScholesProcess(spot, qTS, rTS,
>>> dummy_vol, local_vol)
>>>
>>>
>>>
>>> option.setPricingEngine(ql.MCEuropeanEngine(
>>>
>>> local_vol_process, "lowdiscrepancy",
>>>
>>> timeSteps=100, brownianBridge=True, requiredSamples=32000, seed=42)
>>>
>>> )
>>>
>>>
>>>
>>> T = dc.yearFraction(today, option.exercise().lastDate())
>>>
>>> fwd = spot.value() * qTS.discount(T) / rTS.discount(T)
>>>
>>> vol = calibration_set[-2][1].value()
>>>
>>>
>>>
>>> expected = ql.BlackCalculator(
>>>
>>> ql.as_plain_vanilla_payoff(option.payoff()), fwd, vol * math.sqrt(T),
>>> rTS.discount(T)).value()
>>>
>>>
>>>
>>> print("Expected : %.3f" % expected)
>>>
>>> print("Local Vol Monte-Carlo: %.3f" % option.NPV())
>>>
>>>
>>>
>>> time_steps = 100
>>>
>>> rsg = ql.GaussianRandomSequenceGenerator(
>>>
>>> ql.UniformRandomSequenceGenerator(time_steps,
>>> ql.UniformRandomGenerator(42))
>>>
>>> )
>>>
>>> path_generator = ql.GaussianPathGenerator(local_vol_process, 1.0,
>>> time_steps, rsg, False)
>>>
>>> next_path = path_generator.next().value()
>>>
>>>
>>>
>>> print("\nExample path: " + str({next_path.time(i): next_path.value(i)
>>> for i in range(len(next_path))}))
>>>
>>>
>>>
>>>
>>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|
|
From: Ben W. <ben...@ma...> - 2022-12-07 10:06:34
|
Ahh - thank you Luigi.... On Wed, 7 Dec 2022, 7:36 pm Luigi Ballabio, <lui...@gm...> wrote: > Hello Ben, > short answer - tm should be a handle too, as in: > > tm = ql.QuoteHandle(ql.SimpleQuote(spread/10000)) > > Luigi > > > On Wed, Dec 7, 2022 at 8:37 AM Ben Watson <ben...@ma...> > wrote: > >> I am pricing some FRN’s and struggling to get code block below work. >> >> >> >> The error on the line zsts=ql.ZeroSpreadedTermStructure(self.fc,tm) and >> what I get back is; >> >> >> >> Exception is: Wrong number or type of arguments for overloaded function >> 'new_ZeroSpreadedTermStructure'. >> >> Possible C/C++ prototypes are: >> >> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle< >> YieldTermStructure > const &,Handle< Quote > const >> &,Compounding,Frequency,DayCounter const &) >> >> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle< >> YieldTermStructure > const &,Handle< Quote > const >> &,Compounding,Frequency) >> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle< >> YieldTermStructure > const &,Handle< Quote > const &,Compounding) >> >> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle< >> YieldTermStructure > const &,Handle< Quote > const &) >> >> >> >> However self.fc is type <class >> 'QuantLib.QuantLib.RelinkableYieldTermStructureHandle'> >> >> and tm is <class 'QuantLib.QuantLib.SimpleQuote'> >> >> >> >> I have tried with a regular non-linkable <class >> 'QuantLib.QuantLib.YieldTermStructureHandle'> and still get the same >> error. >> >> >> >> Any ideas on what is going on??? By the looks of it the error message >> maybe >> misleading. >> >> >> >> >> >> def calc_dm(self,price): >> >> >> >> @timeit >> >> def FairDM(spread): >> >> tm = ql.SimpleQuote(spread/10000) >> >> print(type(self.fc),type(tm)) >> >> zsts=ql.ZeroSpreadedTermStructure(self.fc,tm) >> >> self.dc.linkTo(zsts) >> >> cp=self.frn.cleanPrice() >> >> return price-cp >> >> >> >> accuracy = 1e-1 >> >> guess =300 >> >> step = 0.1 >> >> >> >> self.frn.setPricingEngine(ql.DiscountingBondEngine(self.dc)) >> >> self.fc.linkTo(self.projection_curve) >> >> >> >> FairSpread=ql.Brent().solve(FairDM, accuracy, guess, step) >> >> self.dm_spread= FairSpread >> >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Luigi B. <lui...@gm...> - 2022-12-07 08:36:31
|
Hello Ben,
short answer - tm should be a handle too, as in:
tm = ql.QuoteHandle(ql.SimpleQuote(spread/10000))
Luigi
On Wed, Dec 7, 2022 at 8:37 AM Ben Watson <ben...@ma...>
wrote:
> I am pricing some FRN’s and struggling to get code block below work.
>
>
>
> The error on the line zsts=ql.ZeroSpreadedTermStructure(self.fc,tm) and
> what I get back is;
>
>
>
> Exception is: Wrong number or type of arguments for overloaded function
> 'new_ZeroSpreadedTermStructure'.
>
> Possible C/C++ prototypes are:
>
> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
> YieldTermStructure > const &,Handle< Quote > const
> &,Compounding,Frequency,DayCounter const &)
>
> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
> YieldTermStructure > const &,Handle< Quote > const &,Compounding,Frequency)
> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
> YieldTermStructure > const &,Handle< Quote > const &,Compounding)
>
> ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
> YieldTermStructure > const &,Handle< Quote > const &)
>
>
>
> However self.fc is type <class
> 'QuantLib.QuantLib.RelinkableYieldTermStructureHandle'>
>
> and tm is <class 'QuantLib.QuantLib.SimpleQuote'>
>
>
>
> I have tried with a regular non-linkable <class
> 'QuantLib.QuantLib.YieldTermStructureHandle'> and still get the same error.
>
>
>
> Any ideas on what is going on??? By the looks of it the error message maybe
> misleading.
>
>
>
>
>
> def calc_dm(self,price):
>
>
>
> @timeit
>
> def FairDM(spread):
>
> tm = ql.SimpleQuote(spread/10000)
>
> print(type(self.fc),type(tm))
>
> zsts=ql.ZeroSpreadedTermStructure(self.fc,tm)
>
> self.dc.linkTo(zsts)
>
> cp=self.frn.cleanPrice()
>
> return price-cp
>
>
>
> accuracy = 1e-1
>
> guess =300
>
> step = 0.1
>
>
>
> self.frn.setPricingEngine(ql.DiscountingBondEngine(self.dc))
>
> self.fc.linkTo(self.projection_curve)
>
>
>
> FairSpread=ql.Brent().solve(FairDM, accuracy, guess, step)
>
> self.dm_spread= FairSpread
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Ben W. <ben...@ma...> - 2022-12-07 07:34:36
|
I am pricing some FRN’s and struggling to get code block below work.
The error on the line zsts=ql.ZeroSpreadedTermStructure(self.fc,tm) and
what I get back is;
Exception is: Wrong number or type of arguments for overloaded function
'new_ZeroSpreadedTermStructure'.
Possible C/C++ prototypes are:
ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
YieldTermStructure > const &,Handle< Quote > const
&,Compounding,Frequency,DayCounter const &)
ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
YieldTermStructure > const &,Handle< Quote > const &,Compounding,Frequency)
ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
YieldTermStructure > const &,Handle< Quote > const &,Compounding)
ZeroSpreadedTermStructure::ZeroSpreadedTermStructure(Handle<
YieldTermStructure > const &,Handle< Quote > const &)
However self.fc is type <class
'QuantLib.QuantLib.RelinkableYieldTermStructureHandle'>
and tm is <class 'QuantLib.QuantLib.SimpleQuote'>
I have tried with a regular non-linkable <class
'QuantLib.QuantLib.YieldTermStructureHandle'> and still get the same error.
Any ideas on what is going on??? By the looks of it the error message maybe
misleading.
def calc_dm(self,price):
@timeit
def FairDM(spread):
tm = ql.SimpleQuote(spread/10000)
print(type(self.fc),type(tm))
zsts=ql.ZeroSpreadedTermStructure(self.fc,tm)
self.dc.linkTo(zsts)
cp=self.frn.cleanPrice()
return price-cp
accuracy = 1e-1
guess =300
step = 0.1
self.frn.setPricingEngine(ql.DiscountingBondEngine(self.dc))
self.fc.linkTo(self.projection_curve)
FairSpread=ql.Brent().solve(FairDM, accuracy, guess, step)
self.dm_spread= FairSpread
|
|
From: Roland L. <rol...@ac...> - 2022-12-06 19:54:44
|
Dear all, We have just published the 8th release of ORE and ORE-SWIG, updating the codebase at https://github.com/OpenSourceRisk. ORE 8 depends on QuantLib and QuantLib-SWIG 1.28. As announced by Acadia in September, we are continuing the rollout of financial instruments this time with commodity derivatives adding * Swaps * Swaptions * Digital Options * Average Price Options * Option Strips and a few more exotic Equity/FX products. Moreover, we are adding to the analytics to make ORE more widely usable * Commodity simulation integrated into the Gaussian Cross Asset Model in ORE, so that we have coverage across six asset classes now in exposure simulation and XVA * Multi-factor Hull-White / FX / Commodity simulation model * American Monte Carlo components to allow quick exposure simulation including multi-callables The full release notes can be found in the user guide under the DOCUMENTATION menu on https://opensourcerisk.org. Credit derivatives, Bond derivatives, hybrids and scripted exotics will follow in the next releases in quarterly steps, see also the Acadia press release for the previous 7th release and roadmap here<https://www.acadia.inc/news/acadia-announces-seventh-release-of-open-source-risk-engine-with-quarterly-releases-to-follow>. If you want to hear from Acadia about latest ORE developments, then feel free to sign up here<https://share.hsforms.com/1eqcUZ-9_QdSH__M7_YPSig43ul4> to receive updates by email. Please explore ORE – download the release executable, or clone the repositories and build. As usual, all feedback is welcome! Best regards, Roland The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. The acadia.inc privacy policy is available on our website. |
|
From: Ashish B. <ash...@gm...> - 2022-12-06 16:52:02
|
Hi Elric,
What a coincidence, that I sent a query related to this same error for my
scenario. I have seen this error in cases where the code is not able to
solve for the right IV to match the price. In my case the option was
trading with exactly 0 time value i.e. the option premium was dot matching
with the intrinsic value for put options. I don't see that scenario for you
but not sure what else is breaking the IV code here.
I suggest you option.NPV to calculate the price of the option using your
code and passing different volatility values to see if you are able to
achieve the target premium with any reasonable volatility.
Thanks
Ashish
On Tue, 6 Dec 2022 at 09:19, Elric StormBringer <
elr...@gm...> wrote:
>
> I actually used the code below for a test-case (Up-and-Out Barrier
> Option). I know the arguments to specify the trade is correct, because I
> can get 'PV', and 'greeks'. But when I tried to get the 'Implied
> Volatility', it fails with the following error : return _QuantLib.
> BarrierOption_impliedVolatility(self, targetValue, process, accuracy,
> maxEvaluations, minVol, maxVol)
>
> RuntimeError: root not bracketed: f[0.0001,4] -> [-nan(ind),1.127331e+01]
>
>
>
> Below is the python code : ...... Not sure if it is due to 'arguments' being insufficient, or the solver cannot solve for the Implied-vol, or something else.
>
>
> # Import required library
>> from QuantLib import *
>
>
> # Barrier Option: Up-and-Out Call
> # Strike 100, Barrier 150, Rebate 50, Exercise date 4 years
>
> #Set up the global evaluation date to today
> today = Date(28,February,2020)
> Settings.instance().evaluationDate = today
>
> # Specify option
> # ql.BarrierOption(barrierType, barrier, rebate, payoff, exercise)
> # the option below sets Up-and-Out barrier, with Barrier Level of 150, European Vanilla Call as the underlying payoff
> # of European Call Strike and European Expiry date in exercise
> option = BarrierOption(Barrier.UpOut, 150.0, 50.0,
> PlainVanillaPayoff(Option.Call, 100.0),
> EuropeanExercise(Date(29, February, 2024)))
>
> # We will now pass the market data: spot price : 100, risk-free rate: 1% and sigma: 30%
> # Underlying Price
> u = SimpleQuote(100)
> # Risk-free Rate
> r = SimpleQuote(0.01)
> # Sigma
> sigma = SimpleQuote(0.30)
>
> # Build flat curves and volatility
> riskFreeCurve = FlatForward(0, TARGET(), QuoteHandle(r), Actual360())
> volatility = BlackConstantVol(0, TARGET(), QuoteHandle(sigma), Actual360())
>
> # Build the pricing engine by encapsulating the market data in a Black-Scholes process
> # Stochastic Process
> process = BlackScholesProcess(QuoteHandle(u),
> YieldTermStructureHandle(riskFreeCurve),
> BlackVolTermStructureHandle(volatility))
>
> # Build the engine (based on an analytic formula) and set it to the option for evaluation
> option.setPricingEngine(AnalyticBarrierEngine(process))
>
> # Change the market data to get new option pricing.
> # Set initial value and define h
> u0 = u.value(); h=0.01
> P0 = option.NPV()
> print('the initial option price is', np.round(P0, 4))
>
> # Bump up the price by h
> u.setValue(u0+h)
> P_plus = option.NPV()
> print('the bumped up option price is', np.round(P_plus, 4))
>
> # Bump down the price by h
> u.setValue(u0-h)
> P_minus = option.NPV()
> print('the bumped down option price is', np.round(P_minus, 4), '\n')
>
> # Set the price back to its current value
> u.setValue(u0)
>
> # Calculate Greeks: Delta, Gamma, Vega, Theta, Rho
> delta = (P_plus - P_minus)/(2*h)
> gamma = (P_plus - 2*P0 + P_minus)/(h*h)
>
> # Update quote for rho calculation
> r0 = r.value(); h1 = 0.0001
> r.setValue(r0+h); P_plus = option.NPV()
> r.setValue(r0)
>
> # Rho
> rho = (P_plus - P0)/h1
>
> # Update quote for sigma calculation
> sigma0 = sigma.value() ; h = 0.0001
> sigma.setValue(sigma0+h) ; P_plus = option.NPV()
> sigma.setValue(sigma0)
>
> # Vega
> vega = (P_plus - P0)/h
>
> # Update quote to calculate theta
> Settings.instance().evaluationDate = today+1
> P1 = option.NPV()
> h = 1.0/365
>
> # Theta
> theta = (P1-P0)/h
>
> print(f'OptionPrice: {P0: .2f}, Delta: {delta: .2f}, Gamma: {gamma: .4f}, Theta: {theta: .2f}, \
> Vega: {vega: .2f}, Rho: {rho: .2f}')
>
> option.impliedVolatility(22.06, process)
>
>
> ---------
>
>
>
>
> On Fri, 2 Dec 2022 at 21:01, Ashish Bansal <ash...@gm...>
> wrote:
>
>> Specific to IV, i didn't calculate IV for barriers so not sure. The IV is
>> not implied for all the option types like for averaging options, it doesn't
>> work. However, i do see the same being implemented for Barriers:
>>
>> https://github.com/lballabio/QuantLib/blob/2536f0e3db681f4cb8f4972f09d561e8f085b5ea/ql/instruments/barrieroption.cpp#L51
>> Volatility BarrierOption::impliedVolatility(
>> Real targetValue,
>> const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
>> Real accuracy,
>> Size maxEvaluations,
>> Volatility minVol,
>> Volatility maxVol)
>>
>> What error are you getting? Try to enter more arguments in it and try.
>>
>> Regards
>> Ashish
>>
>> On Fri, 2 Dec 2022 at 17:15, Elric StormBringer <
>> elr...@gm...> wrote:
>>
>>> thanks everyone, very grateful for all the helpful responses.
>>>
>>> perhaps to be a bit more clear; I was having problems with the FX Touch
>>> Barrier Options
>>> 1. When I specified the option is Vanilla European : option =
>>> ql.VanillaOption(payoff, exercise)
>>> -> using the option.impliedVolatility(premium, process) *** works ***
>>> [see screenshot below[/
>>>
>>> 2. But when I specify the product type to be anything else, it no longer
>>> works, and I just get error messages...
>>> -> so, is it we need more special arguments for non-European-Vanilla? Or
>>> does the Implied Volatility work *** ONLY *** for European Vanilla Options?
>>>
>>> [image: image.png]
>>>
>>>
>>>
>>>
>>> [image: image.png]
>>>
>>>
>>> On Fri, 2 Dec 2022 at 17:41, Ashish Bansal <ash...@gm...>
>>> wrote:
>>>
>>>> Hi Elric,
>>>>
>>>> If you want a basic code for barrier then I wrote 1 in this thread:
>>>> https://sourceforge.net/p/quantlib/mailman/message/37670218/
>>>>
>>>> can also refer to the examples of barrier options in this test suite if
>>>> you are comfortable with C++:
>>>>
>>>> https://github.com/lballabio/QuantLib/blob/master/test-suite/barrieroption.cpp
>>>>
>>>> Thanks
>>>> Ashish
>>>>
>>>> On Wed, 30 Nov 2022 at 18:21, Jonathan Sweemer <sw...@gm...>
>>>> wrote:
>>>>
>>>>> Hi Kiann,
>>>>>
>>>>> I'm surprised that the error you're seeing isn't related to the
>>>>> arguments you pass to BlackScholesProcess. You should be passing term
>>>>> structure objects instead of numerical values.
>>>>>
>>>>> See these links for more information:
>>>>>
>>>>> 1.
>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/stochastic_processes.html#blackscholesprocess
>>>>> 2.
>>>>> https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/stochasticprocess.i#L116-L121
>>>>> 3.
>>>>> https://stackoverflow.com/questions/4891490/calculating-europeanoptionimpliedvolatility-in-quantlib-python
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Nov 30, 2022 at 8:13 PM Elric StormBringer <
>>>>> elr...@gm...> wrote:
>>>>>
>>>>>> Hi there, a noob using/investigationg QuantLib library via python.
>>>>>>
>>>>>> Great job there guys!
>>>>>>
>>>>>> I've been browsing the online documentation, but still having problem
>>>>>> trying to find the 'arguments' and 'fields' inside each.
>>>>>> For example, after I've defined the trade details/market-data/engine
>>>>>> for : ql.BarrierOption.impliedVolatility
>>>>>> -> I am trying to use .ImpliedVolatility.
>>>>>> -> However, I am getting errors from my input fields
>>>>>> : option_.impliedVolatility(0.01, ql.BlackScholesProcess(1.0, 0.0, 0.3))
>>>>>>
>>>>>> Can I check, what are the syntax of the data-fields to be used? The
>>>>>> error message is : impliedVolatility() missing 2 required positional
>>>>>> arguments: 'targetValue' and 'process'
>>>>>>
>>>>>> Kind regards
>>>>>> Kiann
>>>>>> _______________________________________________
>>>>>> 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: Ashish B. <ash...@gm...> - 2022-12-06 16:45:56
|
Hi All, In 1 of the exchange traded option market I see strange behaviour which is failing our quantlib code to value the options. The put options for nearby month are trading only at the intrinsic value with exactly 0 time value although a good 1 month is remaining in expiry which is 4th Jan 2023. Future quotes (underlying) as of 5th Dec: https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.html [image: image.png] Option prices as of 5th Dec: https://www.cmegroup.com/markets/agriculture/dairy/nonfat-dry-milk.quotes.options.html#optionProductId=782&strikeRange=ALL&expiration=782-Z2 [image: image.png] Time value in the above trading: 16.425 - Max(160 - 143.575,0) = 0 We are using the blackscholes engine with American option and using option.impliedvolatility method to calculate the market implied volatility for these options. For these options, we are getting runtime error as root not bracketed error: RuntimeError: root not bracketed: f[0.0001,4] -> [6.394885e-14,5.818200e+01] How should we price these kinds of ITM options? Thanks Ashish Bansal |
|
From: Elric S. <elr...@gm...> - 2022-12-06 03:49:50
|
I actually used the code below for a test-case (Up-and-Out Barrier Option).
I know the arguments to specify the trade is correct, because I can get
'PV', and 'greeks'. But when I tried to get the 'Implied Volatility', it
fails with the following error : return _QuantLib.
BarrierOption_impliedVolatility(self, targetValue, process, accuracy,
maxEvaluations, minVol, maxVol)
RuntimeError: root not bracketed: f[0.0001,4] -> [-nan(ind),1.127331e+01]
Below is the python code : ...... Not sure if it is due to 'arguments'
being insufficient, or the solver cannot solve for the Implied-vol, or
something else.
# Import required library
> from QuantLib import *
# Barrier Option: Up-and-Out Call
# Strike 100, Barrier 150, Rebate 50, Exercise date 4 years
#Set up the global evaluation date to today
today = Date(28,February,2020)
Settings.instance().evaluationDate = today
# Specify option
# ql.BarrierOption(barrierType, barrier, rebate, payoff, exercise)
# the option below sets Up-and-Out barrier, with Barrier Level of 150,
European Vanilla Call as the underlying payoff
# of European Call Strike and European Expiry date in exercise
option = BarrierOption(Barrier.UpOut, 150.0, 50.0,
PlainVanillaPayoff(Option.Call, 100.0),
EuropeanExercise(Date(29, February, 2024)))
# We will now pass the market data: spot price : 100, risk-free rate:
1% and sigma: 30%
# Underlying Price
u = SimpleQuote(100)
# Risk-free Rate
r = SimpleQuote(0.01)
# Sigma
sigma = SimpleQuote(0.30)
# Build flat curves and volatility
riskFreeCurve = FlatForward(0, TARGET(), QuoteHandle(r), Actual360())
volatility = BlackConstantVol(0, TARGET(), QuoteHandle(sigma), Actual360())
# Build the pricing engine by encapsulating the market data in a
Black-Scholes process
# Stochastic Process
process = BlackScholesProcess(QuoteHandle(u),
YieldTermStructureHandle(riskFreeCurve),
BlackVolTermStructureHandle(volatility))
# Build the engine (based on an analytic formula) and set it to the
option for evaluation
option.setPricingEngine(AnalyticBarrierEngine(process))
# Change the market data to get new option pricing.
# Set initial value and define h
u0 = u.value(); h=0.01
P0 = option.NPV()
print('the initial option price is', np.round(P0, 4))
# Bump up the price by h
u.setValue(u0+h)
P_plus = option.NPV()
print('the bumped up option price is', np.round(P_plus, 4))
# Bump down the price by h
u.setValue(u0-h)
P_minus = option.NPV()
print('the bumped down option price is', np.round(P_minus, 4), '\n')
# Set the price back to its current value
u.setValue(u0)
# Calculate Greeks: Delta, Gamma, Vega, Theta, Rho
delta = (P_plus - P_minus)/(2*h)
gamma = (P_plus - 2*P0 + P_minus)/(h*h)
# Update quote for rho calculation
r0 = r.value(); h1 = 0.0001
r.setValue(r0+h); P_plus = option.NPV()
r.setValue(r0)
# Rho
rho = (P_plus - P0)/h1
# Update quote for sigma calculation
sigma0 = sigma.value() ; h = 0.0001
sigma.setValue(sigma0+h) ; P_plus = option.NPV()
sigma.setValue(sigma0)
# Vega
vega = (P_plus - P0)/h
# Update quote to calculate theta
Settings.instance().evaluationDate = today+1
P1 = option.NPV()
h = 1.0/365
# Theta
theta = (P1-P0)/h
print(f'OptionPrice: {P0: .2f}, Delta: {delta: .2f}, Gamma: {gamma:
.4f}, Theta: {theta: .2f}, \
Vega: {vega: .2f}, Rho: {rho: .2f}')
option.impliedVolatility(22.06, process)
---------
On Fri, 2 Dec 2022 at 21:01, Ashish Bansal <ash...@gm...> wrote:
> Specific to IV, i didn't calculate IV for barriers so not sure. The IV is
> not implied for all the option types like for averaging options, it doesn't
> work. However, i do see the same being implemented for Barriers:
>
> https://github.com/lballabio/QuantLib/blob/2536f0e3db681f4cb8f4972f09d561e8f085b5ea/ql/instruments/barrieroption.cpp#L51
> Volatility BarrierOption::impliedVolatility(
> Real targetValue,
> const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
> Real accuracy,
> Size maxEvaluations,
> Volatility minVol,
> Volatility maxVol)
>
> What error are you getting? Try to enter more arguments in it and try.
>
> Regards
> Ashish
>
> On Fri, 2 Dec 2022 at 17:15, Elric StormBringer <
> elr...@gm...> wrote:
>
>> thanks everyone, very grateful for all the helpful responses.
>>
>> perhaps to be a bit more clear; I was having problems with the FX Touch
>> Barrier Options
>> 1. When I specified the option is Vanilla European : option =
>> ql.VanillaOption(payoff, exercise)
>> -> using the option.impliedVolatility(premium, process) *** works ***
>> [see screenshot below[/
>>
>> 2. But when I specify the product type to be anything else, it no longer
>> works, and I just get error messages...
>> -> so, is it we need more special arguments for non-European-Vanilla? Or
>> does the Implied Volatility work *** ONLY *** for European Vanilla Options?
>>
>> [image: image.png]
>>
>>
>>
>>
>> [image: image.png]
>>
>>
>> On Fri, 2 Dec 2022 at 17:41, Ashish Bansal <ash...@gm...>
>> wrote:
>>
>>> Hi Elric,
>>>
>>> If you want a basic code for barrier then I wrote 1 in this thread:
>>> https://sourceforge.net/p/quantlib/mailman/message/37670218/
>>>
>>> can also refer to the examples of barrier options in this test suite if
>>> you are comfortable with C++:
>>>
>>> https://github.com/lballabio/QuantLib/blob/master/test-suite/barrieroption.cpp
>>>
>>> Thanks
>>> Ashish
>>>
>>> On Wed, 30 Nov 2022 at 18:21, Jonathan Sweemer <sw...@gm...>
>>> wrote:
>>>
>>>> Hi Kiann,
>>>>
>>>> I'm surprised that the error you're seeing isn't related to the
>>>> arguments you pass to BlackScholesProcess. You should be passing term
>>>> structure objects instead of numerical values.
>>>>
>>>> See these links for more information:
>>>>
>>>> 1.
>>>> https://quantlib-python-docs.readthedocs.io/en/latest/stochastic_processes.html#blackscholesprocess
>>>> 2.
>>>> https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/stochasticprocess.i#L116-L121
>>>> 3.
>>>> https://stackoverflow.com/questions/4891490/calculating-europeanoptionimpliedvolatility-in-quantlib-python
>>>>
>>>>
>>>>
>>>> On Wed, Nov 30, 2022 at 8:13 PM Elric StormBringer <
>>>> elr...@gm...> wrote:
>>>>
>>>>> Hi there, a noob using/investigationg QuantLib library via python.
>>>>>
>>>>> Great job there guys!
>>>>>
>>>>> I've been browsing the online documentation, but still having problem
>>>>> trying to find the 'arguments' and 'fields' inside each.
>>>>> For example, after I've defined the trade details/market-data/engine
>>>>> for : ql.BarrierOption.impliedVolatility
>>>>> -> I am trying to use .ImpliedVolatility.
>>>>> -> However, I am getting errors from my input fields
>>>>> : option_.impliedVolatility(0.01, ql.BlackScholesProcess(1.0, 0.0, 0.3))
>>>>>
>>>>> Can I check, what are the syntax of the data-fields to be used? The
>>>>> error message is : impliedVolatility() missing 2 required positional
>>>>> arguments: 'targetValue' and 'process'
>>>>>
>>>>> Kind regards
>>>>> Kiann
>>>>> _______________________________________________
>>>>> 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...> - 2022-12-02 15:28:25
|
Hello,
hmm, it seems that the example is out of date. There's probably some
discrepancy between the way QuantLib was compiled and the way the example
is. If you run
quantlib-config --cflags --libs
you'll see a few flags that need to be added to your g++ command line.
You're probably missing `-std=c++14` (unfortunately, clang still uses the
pre-C++11 standard as default).
Luigi
On Fri, Dec 2, 2022 at 2:30 PM Brian Smith <bri...@gm...>
wrote:
> Hi,
>
> I have followed the instructions as provided in
> https://www.quantlib.org/install/macosx.shtml to install QL in iMac. All
> worked file, however when I tried to run the example as,
>
> g++ -I/usr/local/include/ -I/usr/local/include/boost BermudanSwaption.cpp \
> -o bermudanswaption -L/usr/local/lib/ -lQuantLib
>
> I get below error
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:21:
> error: exception specification of overriding function is more lax than base
> version const char* what() const noexcept override;
>
> ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:106:25:
> note: overridden virtual function is here virtual const char* what()
> const _NOEXCEPT; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:33:
> error: expected ';' at end of declaration list const char* what()
> const noexcept override; ^
> ;/usr/local/include/ql/errors.hpp:39:11: error: exception
> specification of overriding function is more lax than base version class
> Error : public std::exception {
> ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:105:13:
> note: overridden virtual function is here virtual ~exception()
> _NOEXCEPT; ^In file included from BermudanSwaption.cpp:26:In
> file included from /usr/local/include/ql/instruments/swaption.hpp:32:In
> file included from /usr/local/include/ql/option.hpp:27:In file included
> from /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:33:/usr/local/include/ql/patterns/singleton.hpp:98:39:
> warning: deleted function definitions are a C++11 extension
> [-Wc++11-extensions] Singleton(const Singleton&) = delete;
>
> ^/usr/local/include/ql/patterns/singleton.hpp:99:28: warning: rvalue
> references are a C++11 extension [-Wc++11-extensions]
> Singleton(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:99:34: warning: deleted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:100:50: warning: deleted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(const Singleton&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:101:39:
> warning: rvalue references are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:101:45: warning:
> deleted function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:115:23:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Singleton() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:/usr/local/include/ql/patterns/observable.hpp:57:33:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Observable() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:86:32:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] ObservableSettings() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:96:30:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool updatesEnabled_ = true,
> updatesDeferred_ = false;
> ^/usr/local/include/ql/patterns/observable.hpp:96:55: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool updatesEnabled_ = true, updatesDeferred_ =
> false;
> ^/usr/local/include/ql/patterns/observable.hpp:116:22: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Observer() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:203:20: warning: 'auto'
> type specifier is a C++11 extension [-Wc++11-extensions] for (const
> auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:203:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:208:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:208:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:211:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:211:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:217:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:217:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:233:24: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const
> auto& observable : o->observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:233:41: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions]
> for (const auto& observable : o->observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:246:20: warning:
> 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:246:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:/usr/local/include/ql/patterns/lazyobject.hpp:36:24:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] LazyObject() = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:37:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] ~LazyObject()
> override = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:37:34: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> ~LazyObject() override = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:40:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void update()
> override;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:34: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:51: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:75: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:29:/usr/local/include/ql/pricingengine.hpp:38:26:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~PricingEngine() override = default;
> ^/usr/local/include/ql/pricingengine.hpp:38:37: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> ~PricingEngine() override = default;
> ^/usr/local/include/ql/pricingengine.hpp:47:32: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] virtual
> ~arguments() = default;
> ^/usr/local/include/ql/pricingengine.hpp:53:30: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> virtual ~results() = default;
> ^/usr/local/include/ql/pricingengine.hpp:66:56: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions]
> PricingEngine::arguments* getArguments() const override { return
> &arguments_; }
> ^/usr/local/include/ql/pricingengine.hpp:67:58: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] const
> PricingEngine::results* getResults() const override { return &results_; }
>
> ^/usr/local/include/ql/pricingengine.hpp:68:22: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void reset()
> override { results_.reset(); }
> ^/usr/local/include/ql/pricingengine.hpp:69:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void update()
> override { notifyObservers(); } ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:30:/usr/local/include/ql/utilities/null.hpp:43:13:
> error: unknown type name 'constexpr' constexpr static float
> nullValue() { ^/usr/local/include/ql/utilities/null.hpp:52:13:
> error: unknown type name 'constexpr' constexpr static int
> nullValue() { ^/usr/local/include/ql/utilities/null.hpp:78:18:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Null() = default; ^In file
> included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:31:In file included from
> /usr/local/include/ql/time/date.hpp:34:/usr/local/include/ql/time/period.hpp:46:20:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Period() = default;
> ^/usr/local/include/ql/time/period.hpp:60:25: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Integer length_ = 0;
> ^/usr/local/include/ql/time/period.hpp:61:25: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] TimeUnit units_ = Days;
> ^/usr/local/include/ql/time/period.hpp:148:16: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] return
> {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:148:16: error:
> non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: warning:
> generalized initializer lists are a C++11 extension [-Wc++11-extensions]
> return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: error:
> non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55: warning:
> generalized initializer lists are a C++11 extension [-Wc++11-extensions]
> inline Period operator-(const Period& p) { return {-p.length(), p.units()};
> }
> ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator-(const Period& p) { return
> {-p.length(), p.units()}; }
> ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66:
> warning: generalized initializer lists are a C++11 extension
> [-Wc++11-extensions] inline Period operator*(Integer n, const Period& p)
> { return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator*(Integer n, const Period& p) {
> return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66:
> warning: generalized initializer lists are a C++11 extension
> [-Wc++11-extensions] inline Period operator*(const Period& p, Integer n)
> { return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator*(const Period& p, Integer n) {
> return {n * p.length(), p.units()}; }
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:31:/usr/local/include/ql/time/date.hpp:386:18:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Null() = default;
> ^/usr/local/include/ql/time/date.hpp:387:40: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions]
> operator Date() const { return {}; }
> ^~/usr/local/include/ql/time/date.hpp:387:40: error: non-aggregate type
> 'QuantLib::Date' cannot be initialized with an initializer list
> operator Date() const { return {}; }
> ^~/usr/local/include/ql/time/date.hpp:431:16: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] return
> {monthLength(m, isLeap(y)), m, y};
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/date.hpp:431:16:
> error: non-aggregate type 'QuantLib::Date' cannot be initialized with an
> initializer list return {monthLength(m, isLeap(y)), m, y};
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:88:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void calculate() const override;
> ^/usr/local/include/ql/instrument.hpp:99:42: warning: 'override' keyword
> is a C++11 extension [-Wc++11-extensions] void performCalculations()
> const override;
> ^/usr/local/include/ql/instrument.hpp:115:22: warning: 'override' keyword
> is a C++11 extension [-Wc++11-extensions] void reset() override {
> ^/usr/local/include/ql/instrument.hpp:113:23: error:
> exception specification of overriding function is more lax than base
> version class Instrument::results : public virtual
> PricingEngine::results {
> ^/usr/local/include/ql/pricingengine.hpp:53:17: note: overridden virtual
> function is here virtual ~results() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:174:15:
> warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
> const auto* results = dynamic_cast<const Instrument::results*>(r);
> ^In file included from BermudanSwaption.cpp:26:In file included
> from
> /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:44:62:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/option.hpp:59:23: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] arguments() =
> default; ^/usr/local/include/ql/option.hpp:60:31:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void validate() const override {
> ^/usr/local/include/ql/option.hpp:57:19: error: exception specification of
> overriding function is more lax than base version class
> Option::arguments : public virtual PricingEngine::arguments {
> ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden
> virtual function is here virtual ~arguments() = default;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:71:22:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void reset() override { delta = gamma = theta = vega = rho = dividendRho
> = Null<Real>(); }
> ^/usr/local/include/ql/option.hpp:81:22: warning: 'override' keyword is a
> C++11 extension [-Wc++11-extensions] void reset() override {
> ^/usr/local/include/ql/option.hpp:93:9: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] auto* arguments
> = dynamic_cast<Option::arguments*>(args); ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from
> /usr/local/include/ql/instruments/swap.hpp:30:In file included from
> /usr/local/include/ql/cashflow.hpp:28:/usr/local/include/ql/event.hpp:42:18:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~Event() override = default;
> ^/usr/local/include/ql/event.hpp:42:29: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~Event()
> override = default;
> ^/usr/local/include/ql/event.hpp:72:31: warning: 'override' keyword is a
> C++11 extension [-Wc++11-extensions] Date date() const override
> { return date_; } ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from
> /usr/local/include/ql/instruments/swap.hpp:30:In file included from
> /usr/local/include/ql/cashflow.hpp:29:/usr/local/include/ql/math/comparison.hpp:69:9:
> error: unknown type name 'constexpr' constexpr double tolerance = 42
> * QL_EPSILON; ^/usr/local/include/ql/math/comparison.hpp:100:9:
> error: unknown type name 'constexpr' constexpr double tolerance = 42
> * QL_EPSILON; ^In file included from BermudanSwaption.cpp:26:In file
> included from /usr/local/include/ql/instruments/swaption.hpp:33:In file
> included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file
> included from
> /usr/local/include/ql/instruments/swap.hpp:30:/usr/local/include/ql/cashflow.hpp:40:21:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~CashFlow() override = default;
> ^/usr/local/include/ql/cashflow.hpp:40:32: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~CashFlow()
> override = default;
> ^/usr/local/include/ql/cashflow.hpp:44:27: warning: 'override' keyword is
> a C++11 extension [-Wc++11-extensions] Date date() const override =
> 0; ^/usr/local/include/ql/cashflow.hpp:50:84:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> boost::optional<bool> includeRefDate = boost::none)
> const override;
> ^/usr/local/include/ql/cashflow.hpp:67:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> accept(AcyclicVisitor&) override;
> ^/usr/local/include/ql/cashflow.hpp:60:52: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] virtual
> Date exCouponDate() const { return {}; };
> ^~/usr/local/include/ql/cashflow.hpp:60:52: error:
> non-aggregate type 'QuantLib::Date' cannot be initialized with an
> initializer list virtual Date exCouponDate() const { return {}; };
> ^~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:68:27:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void deepUpdate() override;
> ^/usr/local/include/ql/instruments/swap.hpp:72:32: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool isExpired()
> const override;
> ^/usr/local/include/ql/instruments/swap.hpp:73:62: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/instruments/swap.hpp:74:64: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> fetchResults(const PricingEngine::results*) const override;
>
> ^/usr/local/include/ql/instruments/swap.hpp:129:35: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupExpired() const override;
> ^/usr/local/include/ql/instruments/swap.hpp:145:31: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void validate()
> const override;
> ^/usr/local/include/ql/instruments/swap.hpp:141:17: error: exception
> specification of overriding function is more lax than base version class
> Swap::arguments : public virtual PricingEngine::arguments {
> ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden virtual
> function is here virtual ~arguments() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:154:22:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void reset() override; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:30:/usr/local/include/ql/time/daycounter.hpp:49:31:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Impl() = default;
> ^/usr/local/include/ql/time/daycounter.hpp:72:24: warning:
> defaulted function definitions are a C++11 extension [-Wc++11-extensions]
> DayCounter() = default; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from
> /usr/local/include/ql/time/schedule.hpp:29:In file included from
> /usr/local/include/ql/time/calendars/nullcalendar.hpp:28:/usr/local/include/ql/time/calendar.hpp:66:31:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Impl() = default;
> ^/usr/local/include/ql/time/calendar.hpp:78:22: warning:
> defaulted function definitions are a C++11 extension [-Wc++11-extensions]
> Calendar() = default;
> ^/usr/local/include/ql/time/calendar.hpp:170:43: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool
> isWeekend(Weekday) const override;
> ^/usr/local/include/ql/time/calendar.hpp:181:43: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool
> isWeekend(Weekday) const override;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from
> /usr/local/include/ql/time/schedule.hpp:29:/usr/local/include/ql/time/calendars/nullcalendar.hpp:42:38:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return "Null"; }
>
> ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:43:43: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isWeekend(Weekday) const override { return false; }
>
> ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:44:51: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isBusinessDay(const Date&) const override { return true; }
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:/usr/local/include/ql/time/schedule.hpp:66:22:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Schedule() = default;
> ^/usr/local/include/ql/time/schedule.hpp:148:36: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] DateGeneration::Rule rule_ =
> DateGeneration::Backward;
> ^/usr/local/include/ql/time/schedule.hpp:149:26: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool endOfMonth_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:/usr/local/include/ql/instruments/vanillaswap.hpp:112:67:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void setupArguments(PricingEngine::arguments* args) const override;
>
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:113:64: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> fetchResults(const PricingEngine::results*) const override;
>
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:116:35: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> setupExpired() const override;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:137:19: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Type type = Receiver;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:150:31: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> validate() const override;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:158:22: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> reset() override; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:29:/usr/local/include/ql/settings.hpp:113:42:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool includeReferenceDateEvents_ =
> false;
> ^/usr/local/include/ql/settings.hpp:115:45: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool enforcesTodaysHistoricFixings_ = false;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:30:/usr/local/include/ql/handle.hpp:51:27:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override { notifyObservers(); }
> ^/usr/local/include/ql/handle.hpp:55:30: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool isObserver_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file included
> from /usr/local/include/ql/instruments/swaption.hpp:34:In file included
> from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:31:/usr/local/include/ql/math/interpolations/extrapolation.hpp:34:26:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Extrapolator() = default;
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:35:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Extrapolator() = default;
>
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:49:27:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool extrapolate_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file
> included from /usr/local/include/ql/instruments/swaption.hpp:34:In file
> included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:26:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~TermStructure() override = default;
> ^/usr/local/include/ql/termstructure.hpp:75:9: error: exception
> specification of overriding function is more lax than base version
> ~TermStructure() override = default;
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:17: note:
> overridden virtual function is here virtual ~Extrapolator() =
> default; ^In file included from BermudanSwaption.cpp:26:In
> file included from /usr/local/include/ql/instruments/swaption.hpp:34:In
> file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:37:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] ~TermStructure() override = default;
> ^/usr/local/include/ql/termstructure.hpp:95:23:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override;
> ^/usr/local/include/ql/termstructure.hpp:104:22: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool moving_ = false;
> ^/usr/local/include/ql/termstructure.hpp:105:31: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool updated_ = true;
> ^In file included from BermudanSwaption.cpp:26:In file included
> from /usr/local/include/ql/instruments/swaption.hpp:34:In file included
> from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:30:In file
> included from
> /usr/local/include/ql/interestrate.hpp:28:/usr/local/include/ql/time/daycounters/actual365fixed.hpp:54:38:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return std::string("Actual/365
> (Fixed)"); }
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:56:90: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> yearFraction(const Date& d1, const Date& d2, const Date&, const Date&)
> const override {
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:62:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override {
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:68:63: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> const Date& refPeriodEnd) const override;
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:72:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return std::string("Actual/365 (No
> Leap)"); }
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:73:78: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> Date::serial_type dayCount(const Date& d1, const Date& d2) const override;
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:77:63: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> const Date& refPeriodEnd) const override;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:31:/usr/local/include/ql/quote.hpp:39:18:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~Quote() override = default;
> ^/usr/local/include/ql/quote.hpp:39:29: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~Quote()
> override = default; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:/usr/local/include/ql/termstructures/yieldtermstructure.hpp:155:23:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override;
> ^/usr/local/include/ql/termstructures/yieldtermstructure.hpp:176:22:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] Size nJumps_ = 0;
> ^In file included from
> BermudanSwaption.cpp:26:/usr/local/include/ql/instruments/swaption.hpp:91:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isExpired() const override;
> ^/usr/local/include/ql/instruments/swaption.hpp:92:62: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/instruments/swaption.hpp:128:23: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> arguments() = default;
> ^/usr/local/include/ql/instruments/swaption.hpp:130:41: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Settlement::Type settlementType =
> Settlement::Physical;
> ^/usr/local/include/ql/instruments/swaption.hpp:132:31: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void validate()
> const override; ^In file included from
> BermudanSwaption.cpp:27:/usr/local/include/ql/pricingengines/swap/discountingswapengine.hpp:41:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void calculate() const override; ^In file
> included from BermudanSwaption.cpp:28:In file included from
> /usr/local/include/ql/pricingengines/swaption/treeswaptionengine.hpp:29:In
> file included from
> /usr/local/include/ql/pricingengines/latticeshortratemodelengine.hpp:28:In
> file included from /usr/local/include/ql/models/model.hpp:30:In file
> included from /usr/local/include/ql/methods/lattices/lattice.hpp:28:In file
> included from
> /usr/local/include/ql/numericalmethod.hpp:28:/usr/local/include/ql/math/array.hpp:67:20:
> warning: rvalue references are a C++11 extension [-Wc++11-extensions]
> Array(Array&&) noexcept; ^fatal error: too many errors
> emitted, stopping now [-ferror-limit=]125 warnings and 20 errors generated.*
>
> Could you please suggest how to resolve this error?
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Brian S. <bri...@gm...> - 2022-12-02 13:27:53
|
Hi, I have followed the instructions as provided in https://www.quantlib.org/install/macosx.shtml to install QL in iMac. All worked file, however when I tried to run the example as, g++ -I/usr/local/include/ -I/usr/local/include/boost BermudanSwaption.cpp \ -o bermudanswaption -L/usr/local/lib/ -lQuantLib I get below error *In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:28:In file included from /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:21: error: exception specification of overriding function is more lax than base version const char* what() const noexcept override; ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:106:25: note: overridden virtual function is here virtual const char* what() const _NOEXCEPT; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:28:In file included from /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:33: error: expected ';' at end of declaration list const char* what() const noexcept override; ^ ;/usr/local/include/ql/errors.hpp:39:11: error: exception specification of overriding function is more lax than base version class Error : public std::exception { ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:105:13: note: overridden virtual function is here virtual ~exception() _NOEXCEPT; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:28:In file included from /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from /usr/local/include/ql/patterns/observable.hpp:33:/usr/local/include/ql/patterns/singleton.hpp:98:39: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions] Singleton(const Singleton&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:99:28: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Singleton(Singleton&&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:99:34: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions] Singleton(Singleton&&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:100:50: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions] Singleton& operator=(const Singleton&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:101:39: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Singleton& operator=(Singleton&&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:101:45: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions] Singleton& operator=(Singleton&&) = delete; ^/usr/local/include/ql/patterns/singleton.hpp:115:23: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Singleton() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:28:In file included from /usr/local/include/ql/patterns/lazyobject.hpp:27:/usr/local/include/ql/patterns/observable.hpp:57:33: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~Observable() = default; ^/usr/local/include/ql/patterns/observable.hpp:86:32: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ObservableSettings() = default; ^/usr/local/include/ql/patterns/observable.hpp:96:30: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool updatesEnabled_ = true, updatesDeferred_ = false; ^/usr/local/include/ql/patterns/observable.hpp:96:55: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool updatesEnabled_ = true, updatesDeferred_ = false; ^/usr/local/include/ql/patterns/observable.hpp:116:22: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Observer() = default; ^/usr/local/include/ql/patterns/observable.hpp:203:20: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:203:37: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:208:20: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:208:37: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:211:20: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:211:37: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:217:20: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:217:37: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:233:24: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : o->observables_) ^/usr/local/include/ql/patterns/observable.hpp:233:41: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : o->observables_) ^/usr/local/include/ql/patterns/observable.hpp:246:20: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^/usr/local/include/ql/patterns/observable.hpp:246:37: warning: range-based for loop is a C++11 extension [-Wc++11-extensions] for (const auto& observable : observables_) ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:28:/usr/local/include/ql/patterns/lazyobject.hpp:36:24: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] LazyObject() = default; ^/usr/local/include/ql/patterns/lazyobject.hpp:37:23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~LazyObject() override = default; ^/usr/local/include/ql/patterns/lazyobject.hpp:37:34: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~LazyObject() override = default; ^/usr/local/include/ql/patterns/lazyobject.hpp:40:23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void update() override; ^/usr/local/include/ql/patterns/lazyobject.hpp:109:34: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ = false, alwaysForward_ = false; ^/usr/local/include/ql/patterns/lazyobject.hpp:109:51: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ = false, alwaysForward_ = false; ^/usr/local/include/ql/patterns/lazyobject.hpp:109:75: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ = false, alwaysForward_ = false; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:29:/usr/local/include/ql/pricingengine.hpp:38:26: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~PricingEngine() override = default; ^/usr/local/include/ql/pricingengine.hpp:38:37: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~PricingEngine() override = default; ^/usr/local/include/ql/pricingengine.hpp:47:32: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~arguments() = default; ^/usr/local/include/ql/pricingengine.hpp:53:30: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~results() = default; ^/usr/local/include/ql/pricingengine.hpp:66:56: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] PricingEngine::arguments* getArguments() const override { return &arguments_; } ^/usr/local/include/ql/pricingengine.hpp:67:58: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] const PricingEngine::results* getResults() const override { return &results_; } ^/usr/local/include/ql/pricingengine.hpp:68:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override { results_.reset(); } ^/usr/local/include/ql/pricingengine.hpp:69:23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void update() override { notifyObservers(); } ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:30:/usr/local/include/ql/utilities/null.hpp:43:13: error: unknown type name 'constexpr' constexpr static float nullValue() { ^/usr/local/include/ql/utilities/null.hpp:52:13: error: unknown type name 'constexpr' constexpr static int nullValue() { ^/usr/local/include/ql/utilities/null.hpp:78:18: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Null() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:31:In file included from /usr/local/include/ql/time/date.hpp:34:/usr/local/include/ql/time/period.hpp:46:20: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Period() = default; ^/usr/local/include/ql/time/period.hpp:60:25: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] Integer length_ = 0; ^/usr/local/include/ql/time/period.hpp:61:25: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] TimeUnit units_ = Days; ^/usr/local/include/ql/time/period.hpp:148:16: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] return {Integer(n), units}; ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:148:16: error: non-aggregate type 'QuantLib::Period' cannot be initialized with an initializer list return {Integer(n), units}; ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] return {Integer(n), units}; ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: error: non-aggregate type 'QuantLib::Period' cannot be initialized with an initializer list return {Integer(n), units}; ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] inline Period operator-(const Period& p) { return {-p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55: error: non-aggregate type 'QuantLib::Period' cannot be initialized with an initializer list inline Period operator-(const Period& p) { return {-p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] inline Period operator*(Integer n, const Period& p) { return {n * p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66: error: non-aggregate type 'QuantLib::Period' cannot be initialized with an initializer list inline Period operator*(Integer n, const Period& p) { return {n * p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] inline Period operator*(const Period& p, Integer n) { return {n * p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66: error: non-aggregate type 'QuantLib::Period' cannot be initialized with an initializer list inline Period operator*(const Period& p, Integer n) { return {n * p.length(), p.units()}; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:In file included from /usr/local/include/ql/instrument.hpp:31:/usr/local/include/ql/time/date.hpp:386:18: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Null() = default; ^/usr/local/include/ql/time/date.hpp:387:40: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] operator Date() const { return {}; } ^~/usr/local/include/ql/time/date.hpp:387:40: error: non-aggregate type 'QuantLib::Date' cannot be initialized with an initializer list operator Date() const { return {}; } ^~/usr/local/include/ql/time/date.hpp:431:16: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] return {monthLength(m, isLeap(y)), m, y}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/date.hpp:431:16: error: non-aggregate type 'QuantLib::Date' cannot be initialized with an initializer list return {monthLength(m, isLeap(y)), m, y}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:88:32: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void calculate() const override; ^/usr/local/include/ql/instrument.hpp:99:42: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void performCalculations() const override; ^/usr/local/include/ql/instrument.hpp:115:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override { ^/usr/local/include/ql/instrument.hpp:113:23: error: exception specification of overriding function is more lax than base version class Instrument::results : public virtual PricingEngine::results { ^/usr/local/include/ql/pricingengine.hpp:53:17: note: overridden virtual function is here virtual ~results() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:In file included from /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:174:15: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] const auto* results = dynamic_cast<const Instrument::results*>(r); ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:44:62: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupArguments(PricingEngine::arguments*) const override; ^/usr/local/include/ql/option.hpp:59:23: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] arguments() = default; ^/usr/local/include/ql/option.hpp:60:31: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void validate() const override { ^/usr/local/include/ql/option.hpp:57:19: error: exception specification of overriding function is more lax than base version class Option::arguments : public virtual PricingEngine::arguments { ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden virtual function is here virtual ~arguments() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:71:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override { delta = gamma = theta = vega = rho = dividendRho = Null<Real>(); } ^/usr/local/include/ql/option.hpp:81:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override { ^/usr/local/include/ql/option.hpp:93:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto* arguments = dynamic_cast<Option::arguments*>(args); ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from /usr/local/include/ql/instruments/swap.hpp:30:In file included from /usr/local/include/ql/cashflow.hpp:28:/usr/local/include/ql/event.hpp:42:18: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~Event() override = default; ^/usr/local/include/ql/event.hpp:42:29: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~Event() override = default; ^/usr/local/include/ql/event.hpp:72:31: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] Date date() const override { return date_; } ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from /usr/local/include/ql/instruments/swap.hpp:30:In file included from /usr/local/include/ql/cashflow.hpp:29:/usr/local/include/ql/math/comparison.hpp:69:9: error: unknown type name 'constexpr' constexpr double tolerance = 42 * QL_EPSILON; ^/usr/local/include/ql/math/comparison.hpp:100:9: error: unknown type name 'constexpr' constexpr double tolerance = 42 * QL_EPSILON; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from /usr/local/include/ql/instruments/swap.hpp:30:/usr/local/include/ql/cashflow.hpp:40:21: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~CashFlow() override = default; ^/usr/local/include/ql/cashflow.hpp:40:32: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~CashFlow() override = default; ^/usr/local/include/ql/cashflow.hpp:44:27: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] Date date() const override = 0; ^/usr/local/include/ql/cashflow.hpp:50:84: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] boost::optional<bool> includeRefDate = boost::none) const override; ^/usr/local/include/ql/cashflow.hpp:67:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void accept(AcyclicVisitor&) override; ^/usr/local/include/ql/cashflow.hpp:60:52: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions] virtual Date exCouponDate() const { return {}; }; ^~/usr/local/include/ql/cashflow.hpp:60:52: error: non-aggregate type 'QuantLib::Date' cannot be initialized with an initializer list virtual Date exCouponDate() const { return {}; }; ^~In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:68:27: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void deepUpdate() override; ^/usr/local/include/ql/instruments/swap.hpp:72:32: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isExpired() const override; ^/usr/local/include/ql/instruments/swap.hpp:73:62: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupArguments(PricingEngine::arguments*) const override; ^/usr/local/include/ql/instruments/swap.hpp:74:64: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void fetchResults(const PricingEngine::results*) const override; ^/usr/local/include/ql/instruments/swap.hpp:129:35: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupExpired() const override; ^/usr/local/include/ql/instruments/swap.hpp:145:31: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void validate() const override; ^/usr/local/include/ql/instruments/swap.hpp:141:17: error: exception specification of overriding function is more lax than base version class Swap::arguments : public virtual PricingEngine::arguments { ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden virtual function is here virtual ~arguments() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:154:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:30:/usr/local/include/ql/time/daycounter.hpp:49:31: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~Impl() = default; ^/usr/local/include/ql/time/daycounter.hpp:72:24: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] DayCounter() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from /usr/local/include/ql/time/schedule.hpp:29:In file included from /usr/local/include/ql/time/calendars/nullcalendar.hpp:28:/usr/local/include/ql/time/calendar.hpp:66:31: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~Impl() = default; ^/usr/local/include/ql/time/calendar.hpp:78:22: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Calendar() = default; ^/usr/local/include/ql/time/calendar.hpp:170:43: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isWeekend(Weekday) const override; ^/usr/local/include/ql/time/calendar.hpp:181:43: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isWeekend(Weekday) const override; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from /usr/local/include/ql/time/schedule.hpp:29:/usr/local/include/ql/time/calendars/nullcalendar.hpp:42:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] std::string name() const override { return "Null"; } ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:43:43: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isWeekend(Weekday) const override { return false; } ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:44:51: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isBusinessDay(const Date&) const override { return true; } ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:In file included from /usr/local/include/ql/instruments/vanillaswap.hpp:31:/usr/local/include/ql/time/schedule.hpp:66:22: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Schedule() = default; ^/usr/local/include/ql/time/schedule.hpp:148:36: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] DateGeneration::Rule rule_ = DateGeneration::Backward; ^/usr/local/include/ql/time/schedule.hpp:149:26: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool endOfMonth_ = false; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:33:/usr/local/include/ql/instruments/vanillaswap.hpp:112:67: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupArguments(PricingEngine::arguments* args) const override; ^/usr/local/include/ql/instruments/vanillaswap.hpp:113:64: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void fetchResults(const PricingEngine::results*) const override; ^/usr/local/include/ql/instruments/vanillaswap.hpp:116:35: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupExpired() const override; ^/usr/local/include/ql/instruments/vanillaswap.hpp:137:19: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] Type type = Receiver; ^/usr/local/include/ql/instruments/vanillaswap.hpp:150:31: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void validate() const override; ^/usr/local/include/ql/instruments/vanillaswap.hpp:158:22: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void reset() override; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file included from /usr/local/include/ql/termstructure.hpp:29:/usr/local/include/ql/settings.hpp:113:42: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool includeReferenceDateEvents_ = false; ^/usr/local/include/ql/settings.hpp:115:45: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool enforcesTodaysHistoricFixings_ = false; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file included from /usr/local/include/ql/termstructure.hpp:30:/usr/local/include/ql/handle.hpp:51:27: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void update() override { notifyObservers(); } ^/usr/local/include/ql/handle.hpp:55:30: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool isObserver_ = false; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file included from /usr/local/include/ql/termstructure.hpp:31:/usr/local/include/ql/math/interpolations/extrapolation.hpp:34:26: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Extrapolator() = default; ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:35: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~Extrapolator() = default; ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:49:27: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool extrapolate_ = false; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:26: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~TermStructure() override = default; ^/usr/local/include/ql/termstructure.hpp:75:9: error: exception specification of overriding function is more lax than base version ~TermStructure() override = default; ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:17: note: overridden virtual function is here virtual ~Extrapolator() = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:37: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~TermStructure() override = default; ^/usr/local/include/ql/termstructure.hpp:95:23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void update() override; ^/usr/local/include/ql/termstructure.hpp:104:22: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool moving_ = false; ^/usr/local/include/ql/termstructure.hpp:105:31: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] mutable bool updated_ = true; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:30:In file included from /usr/local/include/ql/interestrate.hpp:28:/usr/local/include/ql/time/daycounters/actual365fixed.hpp:54:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] std::string name() const override { return std::string("Actual/365 (Fixed)"); } ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:56:90: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] yearFraction(const Date& d1, const Date& d2, const Date&, const Date&) const override { ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:62:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] std::string name() const override { ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:68:63: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] const Date& refPeriodEnd) const override; ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:72:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] std::string name() const override { return std::string("Actual/365 (No Leap)"); } ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:73:78: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] Date::serial_type dayCount(const Date& d1, const Date& d2) const override; ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:77:63: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] const Date& refPeriodEnd) const override; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:In file included from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:31:/usr/local/include/ql/quote.hpp:39:18: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~Quote() override = default; ^/usr/local/include/ql/quote.hpp:39:29: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] ~Quote() override = default; ^In file included from BermudanSwaption.cpp:26:In file included from /usr/local/include/ql/instruments/swaption.hpp:34:/usr/local/include/ql/termstructures/yieldtermstructure.hpp:155:23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void update() override; ^/usr/local/include/ql/termstructures/yieldtermstructure.hpp:176:22: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] Size nJumps_ = 0; ^In file included from BermudanSwaption.cpp:26:/usr/local/include/ql/instruments/swaption.hpp:91:32: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool isExpired() const override; ^/usr/local/include/ql/instruments/swaption.hpp:92:62: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void setupArguments(PricingEngine::arguments*) const override; ^/usr/local/include/ql/instruments/swaption.hpp:128:23: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] arguments() = default; ^/usr/local/include/ql/instruments/swaption.hpp:130:41: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] Settlement::Type settlementType = Settlement::Physical; ^/usr/local/include/ql/instruments/swaption.hpp:132:31: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void validate() const override; ^In file included from BermudanSwaption.cpp:27:/usr/local/include/ql/pricingengines/swap/discountingswapengine.hpp:41:32: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void calculate() const override; ^In file included from BermudanSwaption.cpp:28:In file included from /usr/local/include/ql/pricingengines/swaption/treeswaptionengine.hpp:29:In file included from /usr/local/include/ql/pricingengines/latticeshortratemodelengine.hpp:28:In file included from /usr/local/include/ql/models/model.hpp:30:In file included from /usr/local/include/ql/methods/lattices/lattice.hpp:28:In file included from /usr/local/include/ql/numericalmethod.hpp:28:/usr/local/include/ql/math/array.hpp:67:20: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Array(Array&&) noexcept; ^fatal error: too many errors emitted, stopping now [-ferror-limit=]125 warnings and 20 errors generated.* Could you please suggest how to resolve this error? |