The QuantLib C++ library

Overview

QuantLib: the free/open-source library for quantitative finance

Download Licensed under the BSD 3-Clause License DOI PRs Welcome

Linux build status Windows build status Mac OS build status CMake build status

Codacy Badge Code Quality: Cpp Coverage Status


The QuantLib project (http://quantlib.org) is aimed at providing a comprehensive software framework for quantitative finance. QuantLib is a free/open-source library for modeling, trading, and risk management in real-life.

QuantLib is Non-Copylefted Free Software and OSI Certified Open Source Software.

Download and usage

QuantLib can be downloaded from http://quantlib.org/download.shtml; installation instructions are available at http://quantlib.org/install.shtml for most platforms.

Documentation for the usage and the design of the QuantLib library is available from http://quantlib.org/docs.shtml.

A list of changes for each past versions of the library can be browsed at http://quantlib.org/reference/history.html.

Questions and feedback

The preferred channel for questions (and the one with the largest audience) is the quantlib-users mailing list. Instructions for subscribing are at http://quantlib.org/mailinglists.shtml.

Bugs can be reported as a GitHub issue at https://github.com/lballabio/QuantLib/issues; if you have a patch available, you can open a pull request instead (see "Contributing" below).

Contributing

The preferred way to contribute is through pull requests on GitHub. Get a GitHub account if you don't have it already and clone the repository at https://github.com/lballabio/QuantLib with the "Fork" button in the top right corner of the page. Check out your clone to your machine, code away, push your changes to your clone and submit a pull request; instructions are available at https://help.github.com/articles/fork-a-repo.

In case you need them, more detailed instructions for creating pull requests are at https://help.github.com/articles/using-pull-requests, and a basic guide to GitHub is at https://guides.github.com/activities/hello-world/. GitHub also provides interactive learning at https://lab.github.com/.

It's likely that we won't merge your code right away, and we'll ask for some changes instead. Don't be discouraged! That's normal; the library is complex, and thus it might take some time to become familiar with it and to use it in an idiomatic way.

We're looking forward to your contributions.

Comments
  • Callable Bond Pricing Issue

    Callable Bond Pricing Issue

    Hi,

    I am a big fan of Quantlib and I have been using quantlib python to price thousands of callable bonds every day (from OAS to clean price and from price to OAS). I am still learning the library as I am not so familiar with C++ and online resources on python examples are somewhat limited, so I have to explore a lot of things myself.

    Now, I have an issue with callable bond pricing. I am trying to compute the clean price of a real callable bond in the credit market, namely AES 6 05/15/26. I set the coupon rate to 10% instead of original 6% just to let you see the problem clearly on a larger scale.

    This bond is near the call date (next call is on 5/15/21, in roughly 0.5 years, and the call price is 103) so if the spread is near 0 and the valuation date is today (11/3/2020), I would expect the bond to be priced around 108 as it is "priced to next call". This is also confirmed by Bloomberg. However as I shocked the OAS of the bond to 1bp, the price I got was actually 113.27, well above that. What happens I guess is that the quantlib is mistakenly pricing in one more coupon payment (there is only half a year left so only 1 semi-annual coupon before the call).

    To replicate the bug in an even more straightforward way, I change the next call date to 11/10/2020, which is just 7 days from now, and the "clean price" I got based on 1bp of OAS is 108.19, still well above 103, which is the call price I had expected (again, it looks like one more coupon is priced in).

    Magically, If I set the next call date to 11/9/2020, the price is finally consistent with my intuition, at 103.17, meaning by just changing the call date from 11/10/2020 to 11/9/2020, the clean price dropped 5pts! This strange behavior made me wonder if the cleanPriceOAS function is in fact computing the dirty price or something else.

    I have posted my code below (you can run it directly). Could you please take a look and let me know if I am using the pricer in a correct way or there is actually a bug somewhere? Any hint or suggestion are highly appreciated here!

    import numpy as np
    import pandas as pd
    import QuantLib as ql
    from datetime import datetime, timedelta
    
    today = datetime.today()
    dayCount = ql.Thirty360()
    calendar = ql.UnitedStates()
    interpolation = ql.Linear()
    compounding = ql.Compounded
    compoundingFrequency = ql.Semiannual
    tenor = ql.Period(ql.Semiannual)
    bussinessConvention = ql.Unadjusted
    dateGeneration = ql.DateGeneration.Backward
    monthEnd = False
    
    class CallableBond(object):        
        #a wrapper I define to hold ql objects.
        def __init__(self, issue_dt = None, maturity_dt = None, coupon = None, calldates = [], callprices = []):
            self.issue_dt = issue_dt
            self.maturity_dt = maturity_dt
            self.callprices = callprices
            self.calldates = calldates
            self.coupon = coupon
            self.today_dt = today
            self.callability_schedule = ql.CallabilitySchedule()
            for i, call_dt in enumerate(self.calldates):
                callpx = self.callprices[i]
                day, month, year = call_dt.day, call_dt.month, call_dt.year
                call_date = ql.Date(day, month, year)
                callability_price  = ql.CallabilityPrice(callpx, ql.CallabilityPrice.Clean)
                self.callability_schedule.append(ql.Callability(
                                        callability_price,
                                        ql.Callability.Call,
                                        call_date))
    
        def value_bond(self, a, s, grid_points):
            model = ql.HullWhite(self.spotCurveHandle, a, s)
            engine = ql.TreeCallableFixedRateBondEngine(model, grid_points, self.spotCurveHandle)
            self.model = model
            self.bond.setPricingEngine(engine)
            return self.bond
    
        def makebond(self, asofdate = today):
            self.maturityDate = ql.Date(self.maturity_dt.day, self.maturity_dt.month, self.maturity_dt.year)
            self.dayCount = dayCount
            self.calendar = calendar
            self.interpolation = interpolation
            self.compounding = compounding
            self.compoundingFrequency = compoundingFrequency
    
    
            AsofDate = ql.Date(asofdate.day, asofdate.month, asofdate.year)
            ql.Settings.instance().evaluationDate = AsofDate
            self.asofdate = asofdate
            self.spotRates = list(np.array([0.0811, 0.0811, 0.0864, 0.0938, 0.1167, 0.1545, 0.1941, 0.3749, 0.6235, 0.8434, 1.3858, 1.6163, 1.6163])/100)
            self.spotDates = [ql.Date(3,11,2020), ql.Date(3,12,2020), ql.Date(1,2,2021), ql.Date(30,4,2021), ql.Date(3,11,2021), ql.Date(4,11,2022), ql.Date(3,11,2023), ql.Date(3,11,2025), ql.Date(4,11,2027), ql.Date(4,11,2030), ql.Date(2,11,2040), ql.Date(4,11,2050), ql.Date(3,11,2090)]
            spotCurve_asofdate = ql.ZeroCurve(self.spotDates, self.spotRates, self.dayCount, self.calendar, self.interpolation, self.compounding, self.compoundingFrequency)
            spotCurveHandle1 = ql.YieldTermStructureHandle(spotCurve_asofdate)
            self.spotCurve = spotCurve_asofdate
            self.spotCurveHandle = spotCurveHandle1
    
            self.issueDate = ql.Date(self.issue_dt.day, self.issue_dt.month, self.issue_dt.year)
            self.tenor = tenor
            self.bussinessConvention = bussinessConvention
            self.schedule = ql.Schedule(self.issueDate, self.maturityDate, self.tenor, self.calendar, self.bussinessConvention, self.bussinessConvention , dateGeneration, monthEnd)
            self.coupons = [self.coupon]
            self.settlementDays = 0
            self.faceValue = 100
            self.bond = ql.CallableFixedRateBond(
                self.settlementDays, self.faceValue,
                self.schedule, self.coupons, self.dayCount,
                ql.Following, self.faceValue, self.issueDate,
                self.callability_schedule)
            self.value_bond(0.03, 0.012, 80)
    
        def cleanPriceOAS(self, oas = None):
            if np.isnan(oas):
                return np.nan
            px = self.bond.cleanPriceOAS(oas, self.spotCurveHandle, self.dayCount, self.compounding, self.compoundingFrequency, self.spotCurveHandle.referenceDate())
            return px
    
    if __name__ == '__main__':
        issue_dt = datetime(2016, 5, 25)
        maturity_dt = datetime(2026, 5, 15)
        coupon = 10/100
        calldates, callprices = [datetime(2020, 11, 9), datetime(2022, 5, 15), datetime(2023, 5, 15), datetime(2024, 5, 15)], [103, 102, 101, 100]
        bond = CallableBond(issue_dt, maturity_dt, coupon, calldates, callprices)
        bond.makebond(datetime.today())
        print(bond.cleanPriceOAS(1/10000))   #computing the clean price for OAS=1bp, with call date 11/9/2020 would give 103.17
    
    opened by xg2202 46
  • 'static void IborCoupon::createIndexedCoupons();' instead of QL_USE_INDEXED_COUPON

    'static void IborCoupon::createIndexedCoupons();' instead of QL_USE_INDEXED_COUPON

    Hi all,

    I see some discussions around the preprocessor flag QL_USE_INDEXED_COUPON.

    One of the main disadvantages is the compile-time nature of this flag. In my opinion the results of calculation should not depend on preprocessor but should be configurable at run-time.

    I suggest to extend the Settings class and use Settings::instance().useIndexedCoupon() to switch programmatically between par and indexed coupons.

    I adjusted all code lines which link to QL_USE_INDEXED_COUPON to use Settings::instance().useIndexedCoupon() instead.

    What do you think of the changes?

    Best regards, Ralf

    opened by ralfkonrad 39
  • Resolves Issue 518

    Resolves Issue 518

    I believe that this pull request resolves all outstanding issues with the ActualActual ISMA implelmentation described in issue 518.

    The only remaining failing tests are regression tests. Differences are to be expected due to the fact that these were previously incorrect.

    Further tests that should be added:

    1. bondPrices cacluated from the pricing engine should now be consistent with prices from the bondYield(cleanPrice ....) functions for Actual Actual bonds. A test should be created to make sure that this si always true.
    2. Explicit tests of a bond accrual tested against known good values to make sure that when using a schedule all the values feed through correctly to bond accrual valuations.
    3. We must resolve the broken regression tests. I suspect this means that they may have been wrong before when using the actual actual without a schedule.

    Phil

    opened by phil20686 30
  • Missing config.hpp after make install using CMake-based build

    Missing config.hpp after make install using CMake-based build

    Hi QuantLib-devs,

    thanks for a very useful library. I'm having a slightly strange problem, no doubt related to how I am building the library - but I'm afraid I can't quite figure out what I am doing wrong. I am trying to build an alpine container with a set of C++ libraries including QuantLib and OpenSourceRiskEngine (OSRE) [1].

    Possibly quite important: I am using CMake for building QuantLib.

    At any rate, I get QuantLib to build and install just fine - can't spot anything untoward in the build output - but when I look at the install directory, it is missing ql/config.hpp:

    $  ls -l /usr/include/ql/config*
    -rw-r--r--    1 root     root           957 Jan 23 13:55 /usr/include/ql/config.ansi.hpp
    -rw-r--r--    1 root     root           963 Jan 23 13:55 /usr/include/ql/config.mingw.hpp
    -rw-r--r--    1 root     root          2664 Jan 23 13:55 /usr/include/ql/config.msvc.hpp
    -rw-r--r--    1 root     root          1508 Jan 23 13:55 /usr/include/ql/config.sun.hpp
    

    This then causes OSRE to fail:

    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../qle -I../.. -I../.. -I/home/Engine-2a56688ff4d91e378bf88620a45864824150fbc5/QuantLib -g -O2 -Wall -MT averageonindexedcoupon.lo -MD -MP -MF .deps/averageonindexedcoupon.Tpo -c averageonindexedcoupon.cpp  -fPIC -DPIC -o .libs/averageonindexedcoupon.o
    In file included from /usr/include/ql/time/frequency.hpp:30:0,
                     from /usr/include/ql/time/period.hpp:30,
                     from /usr/include/ql/time/date.hpp:32,
                     from /usr/include/ql/event.hpp:28,
                     from /usr/include/ql/cashflow.hpp:28,
                     from /usr/include/ql/cashflows/coupon.hpp:28,
                     from /usr/include/ql/cashflows/floatingratecoupon.hpp:32,
                     from ../../qle/cashflows/averageonindexedcoupon.hpp:28,
                     from averageonindexedcoupon.cpp:19:
    /usr/include/ql/qldefines.hpp:91:28: fatal error: ql/config.hpp: No such file or directory
        #include <ql/config.hpp>
    

    In case it helps, my Dockerfile for QuantLib is as follows:

    ARG quantlib_hash=a00d43fabf30ab1e7fcaeaa9f497a551b0de528c
    RUN cd /home && \
        wget https://github.com/lballabio/QuantLib/archive/${quantlib_hash}.zip && \
        unzip ${quantlib_hash}.zip && \
        cd QuantLib-${quantlib_hash} && \
        mkdir build && \
        cd build && \
        cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr .. && \
        make -j3 && \
        make install && \
        cd /home && \
        rm -rf QuantLib-${quantlib_hash} ${quantlib_hash}.zip
    

    Where the hash is of the latest commit in master at present. Any ideas on what I am doing wrong are greatly appreciated.

    Cheers

    Marco

    [1] https://github.com/OpenSourceRisk/Engine

    opened by mcraveiro 23
  • make floating rate coupons lazy

    make floating rate coupons lazy

    This MR picks up issue #415 and is similar to earlier MRs #427 and #465, which we rolled back due to possible performance issues. I can not reproduce these issues any more in the current version of ORE with underlying QuantLib 1.22. On the other hand we are seeing performance problems with some instruments referencing CMS Coupons due to multiple calls to the coupon's amount() method without the actual need to recalculate the coupon.

    One additional note: Making FloatingRateCoupon a LazyObject highlights a problem that we saw earlier because of the observability chain Swaption => Swap => Coupon: If a swaption engine does not recalculate the underlying swap, the swaption will receive only the first notification from the swap if an underlying market variable changes. This leads e.g. to missing sensitivities if calculated by bumping the relevant market quotes. The workaround so far was to register the swaption with the swap's coupons directly via registerWithObservables(swap_).

    This won't work any more, if the coupons are lazy objects themselves forwarding only the first notification. I guess what we really want is to forward any notifications from the Swap to the Swaption by calling swap_.alwaysForwardNotifications() and at the same time rely on a recursive behaviour of this method, so that nested lazy objects forward their notifications as well. This is the reason why I made alwaysForwardNotifications() virtual. I believe we can deprecate registerWithObservables() now because its only purpose was the workaround described above.

    stale 
    opened by pcaspers 22
  • Impossible greek values returned by FD American

    Impossible greek values returned by FD American

    Here are some screenshots of parameters and the corresponding impossible gamma and vega (very negative) values which makes me question the rest of the greeks as well. I'm attaching the full scheme used to price using those parameters.

    class OptionPricer(object):
        def __init__(self):
            self.calc_date = pd.to_datetime('2019-09-10')
            self.calc_date_ql = ql.Date(self.calc_date.day, self.calc_date.month, self.calc_date.year)
            self.settlement = self.calc_date_ql
            self.day_count = ql.Actual365Fixed()
            self.calendar = ql.UnitedStates()
            ql.Settings.instance().evaluationDate = self.calc_date_ql
            period = ql.Period(int(10), ql.Days)
            self.maturity_date = self.calendar.advance(ql.Date(10, 9, 2019), period)
            self.eu_exercise = ql.EuropeanExercise(self.maturity_date)
            self.am_exercise = ql.AmericanExercise(self.settlement, self.maturity_date)
            self.payoff = ql.PlainVanillaPayoff(ql.Option.Put, 110)
            self.am_option = ql.VanillaOption(self.payoff, self.am_exercise)
            self.eu_option = ql.VanillaOption(self.payoff,self.eu_exercise)
            self.spot_quote = ql.SimpleQuote(100)
            self.spot_handle = ql.QuoteHandle(self.spot_quote)
            self.vol_quote = ql.SimpleQuote(0.1)
            self.vol_handle = ql.QuoteHandle(self.vol_quote)
            self.rf_quote = ql.SimpleQuote(0.05)
            self.rf_handle = ql.QuoteHandle(self.rf_quote)
            self.div_quote = ql.SimpleQuote(0.05)
            self.div_handle = ql.QuoteHandle(self.div_quote)
            self.rf_flat_curve = ql.YieldTermStructureHandle(
                ql.FlatForward(self.calc_date_ql, self.rf_handle, self.day_count)
            )
            self.div_flat_curve = ql.YieldTermStructureHandle(
                ql.FlatForward(self.calc_date_ql, self.div_handle, self.day_count)
            )
            self.vol_flat_curve = ql.BlackVolTermStructureHandle(
                ql.BlackConstantVol(self.calc_date_ql, self.calendar, self.vol_handle, self.day_count)
            )
            self.bsm_process = ql.BlackScholesMertonProcess(self.spot_handle, self.div_flat_curve, self.rf_flat_curve, self.vol_flat_curve)
            self.engine = ql.FdBlackScholesVanillaEngine(self.bsm_process)
            self.eu_engine = ql.AnalyticEuropeanEngine(self.bsm_process)
    
            
        def numeric_first_order(self,option, quote, h = 0.0001):
            sigma0 = quote.value()
            quote.setValue(sigma0 - h)
            P_minus = option.NPV()
            quote.setValue(sigma0 + h)
            P_plus = option.NPV()
            quote.setValue(sigma0)
            return (P_plus - P_minus) / (2*h)
        
        
        def price_and_greeks(self,div_rate, rf_rate, vol, spot_price, strike_price, put_call, dte, market_price=None):
            period = ql.Period(int(dte), ql.Days)
            self.maturity_date = self.calendar.advance(self.calc_date_ql, period)
            self.am_exercise = ql.AmericanExercise(self.settlement, self.maturity_date)
    
            if put_call:
                self.payoff = ql.PlainVanillaPayoff(ql.Option.Put, strike_price)
            else:
                self.payoff = ql.PlainVanillaPayoff(ql.Option.Call, strike_price)
            
            
            T = self.day_count.yearFraction(self.calc_date_ql, self.maturity_date)
            N = max(200, int(1000 * T))
            M = max(100, int(200 *T))
            
            #self.engine = ql.FdBlackScholesVanillaEngine(self.bsm_process, M, N,int(0.2*M))
            self.engine = ql.FdBlackScholesVanillaEngine(self.bsm_process, M, N, 0, ql.FdmSchemeDesc.ImplicitEuler())
            #self.engine = ql.FdBlackScholesVanillaEngine(self.bsm_process, M, N, 0, ql.FdmSchemeDesc.TrBDF2())
            
            self.am_option = ql.VanillaOption(self.payoff, self.am_exercise)
            self.am_option.setPricingEngine(self.engine)    
            self.eu_exercise = ql.EuropeanExercise(self.maturity_date)
            self.eu_option = ql.VanillaOption(self.payoff,self.eu_exercise)
            self.eu_option.setPricingEngine(self.eu_engine)
            self.spot_quote.setValue(spot_price)
            self.vol_quote.setValue(vol)
            self.rf_quote.setValue(rf_rate)
            self.div_quote.setValue(div_rate)
            price = self.am_option.NPV()
            delta = self.am_option.delta()
            gamma = self.am_option.gamma()
            theta = self.am_option.theta()
            #if market_price is not None:
            #    print(self.am_option.impliedVolatility(market_price, self.bsm_process))
            #rho = self.numeric_first_order(self.am_option, self.rf_quote)
            vega = self.numeric_first_order(self.am_option, self.vol_quote)/100
            return price, delta, gamma, theta, vega, self.eu_option.NPV(), self.eu_option.delta(),self.eu_option.gamma(), self.eu_option.theta(), self.eu_option.vega()/100 #, rho    
    
    Screen Shot 2020-03-02 at 4 12 23 PM Screen Shot 2020-03-02 at 4 12 08 PM
    opened by feribg 21
  • Adding stdcall build config

    Adding stdcall build config

    Modifying QuantLib project file to add an stdcall build configuration. Also modified the vc14 solution file to add a minimal build for both Debug and Release. This is for use with QuantLib-SWIG for C#.

    opened by fabrice-lecuyer 21
  • Add CMake Presets

    Add CMake Presets

    Closes #1207.

    To start with, it includes the following presets:

    • Linux with GCC
    • Linux with Clang
    • Windows with MSVC (x64)
    • Windows with Clang (x64)

    Unfortunately I do not have a Mac, so was unable to add or test presets for that platform.

    opened by sweemer 20
  • [WIP] Add CMake support for Windows (MSVC)

    [WIP] Add CMake support for Windows (MSVC)

    This PR closes #326.

    Main changes:

    • Generate static and shared library projects (although nothing is exported from shared one) with meaningful names
    • Propagate QL_LINK_LIBRARY variable with the name of QuantLib library to be linked against (static one).
    • Use full qualified name for lib and dll files: i.e.: QuantLib-vc140-mt-s-gd.lib
      • I needed to put a dash after the static suffix -s due to the way CMake's handles CMAKE_DEBUG_POSTFIX
    • Modify vcproj (visual studio file) in order to generate static QuantLib library with proper name (matching that generated by auto_link.hpp).
    • Set Boost_USE_STATIC_LIBS variable to ON in order to match boost libraries automatically linked.

    Let's start to talk about all these changes.

    opened by jgsogo 20
  • Fix the accrual calculation for OvernightIndexedCoupon

    Fix the accrual calculation for OvernightIndexedCoupon

    Fix the accrual calculation for OvernightIndexedCoupon by overriding accruedAmount() in OvernightIndexedCoupon and passing date to new overload rate() function.

    fixes issue #1214

    opened by mshojatalab 19
  • Index::hasHistoricalFixing(fixingDate)

    Index::hasHistoricalFixing(fixingDate)

    I have added to ql/cashflows/floatingratecoupon.hpp

            //! whether or not the coupon is already fixed
            virtual bool isFixed() const;
    

    to check if the coupon is fixed or not. Before and after the fixing date it is obvious and at the fixing date I am using the approach for the InterestRateIndex::fixing(...) here

    https://github.com/lballabio/QuantLib/blob/a44b404a3361b625c068173a5c8e0bb9981ea374/ql/indexes/interestrateindex.cpp#L85

    I was conservative by not using c++11 features within the implementation:

        bool FloatingRateCoupon::isFixed() const {
            Date fixingDate = this->fixingDate();
            Date today = Settings::instance().evaluationDate();
    
            /* We compare serialNumber() here in case QL_HIGH_RESOLUTION_DATE is defined
             * to avoid comparing dateTimes(). */
            if (today.serialNumber() != fixingDate.serialNumber()) {
                return (fixingDate.serialNumber() < today.serialNumber());
            } else {
                try {
                    // might have been fixed, see InterestRateIndex::fixing(...)
                    Rate result = index_->pastFixing(fixingDate);
                    return result != Null<Real>();
                } catch (Error&) {
                    return false;
                }
            }
        }
    

    however the testcase I have written seems to have problems with my c++11 features only on macos.

    Also I am not sure if the implementation needs to be overwritten in derived coupon classes like IborCoupon, OvernightIndexedCoupon etc.

    opened by ralfkonrad 19
  • Add example TimeSeriesFromCSV

    Add example TimeSeriesFromCSV

    This example shows how to use a QuantLib::TimeSeries with a user defined class. The provided class - YahooQuote in this example - must implement its own specialization of QuantLib::Null.

    See the discussion in https://github.com/lballabio/QuantLib/issues/1546

    opened by ofenloch 1
  • Cant create TimeSeries with my class

    Cant create TimeSeries with my class

    Hi!

    I have a class YahooQuote and would like to create a TimeSeries with it

       std::vector<Date> dates;
       std::vector<YahooQuote> quotes;
       // ...
       // fill both vectors with data
       // ...
       // create TimeSeries
       TimeSeries<YahooQuote> series(dates.begin(), dates.end(), quotes.begin());
    

    I always get errormessages like the ones shown below. I can create and use a std::map<Date,YahooQuote> without any problems. The source tells me that TimeSeries uses std::map internally. So , shouldn't the above example work?

    Thanks for any hints and your effort

    Oliver

    In instantiation of 'QuantLib::Null<Type>::operator T() const [with T = YahooQuote]':
    [build] /home/ofenloch/workspaces/cpp/QuantLib/ql/timeseries.hpp:105:28:   required from 'T& QuantLib::TimeSeries<T, Container>::operator[](const QuantLib::Date&) [with T = YahooQuote; Container = std::map<QuantLib::Date, YahooQuote, std::less<QuantLib::Date>, std::allocator<std::pair<const QuantLib::Date, YahooQuote> > >]'
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:158:47:   required from here
    [build] /home/ofenloch/workspaces/cpp/QuantLib/ql/utilities/null.hpp:80:20: error: no matching function for call to 'YahooQuote::YahooQuote(int)'
    [build]    80 |             return T(detail::FloatingPointNull<std::is_floating_point<T>::value>::nullValue());
    [build]       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:32:5: note: candidate: 'YahooQuote::YahooQuote(const QuantLib::Date&, const Real&, const Real&, const Real&, const Real&, const Real&, const Real&)'
    [build]    32 |     YahooQuote(QuantLib::Date const& Date,
    [build]       |     ^~~~~~~~~~
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:32:5: note:   candidate expects 7 arguments, 1 provided
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:31:5: note: candidate: 'YahooQuote::YahooQuote()'
    [build]    31 |     YahooQuote(){};
    [build]       |     ^~~~~~~~~~
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:31:5: note:   candidate expects 0 arguments, 1 provided
    [build] /home/ofenloch/workspaces/cpp/QuantLib/Examples/TimeSeriesFromCSV/TimeSeriesFromCSV.cpp:29:7: note: candidate: 'constexpr YahooQuote::YahooQuote(const YahooQuote&)'
    
    opened by ofenloch 15
  • A problem of calculating YTM of amortization fixed rate bonds in QuantLib Python

    A problem of calculating YTM of amortization fixed rate bonds in QuantLib Python

    __I'm trying to calculate the ytm of bonds amortized in quantlib. The maturity of this bond is five years, starting from the second year to repay 25% of the face value until the last year.

    The cash flow of bonds is correct. I want to calculate ytm based on the current net price, but I don't know why it is wrong.

    I have the following bond:

    Maturity Date: 
    24.07.2024
    Coupon Frequency: 
    25 at 24.07.2021
    25 at 24.07.2022
    25 at 24.07.2023
    25 at 24.07.2024
    Day Count 
    Convention: ACT/365
    Coupon rate: 6.5
    

    Here is the python code

    import QuantLib as ql
    
    start_d = ql.Date(24, ql.July, 2019)
    mat_d = ql.Date(24, ql.July, 2024)
    calc_date = ql.Date(8, ql.December, 2022)
    frequency = ql.Period(ql.Annual)
    freq = ql.Annual
    dayCounter = ql.Actual365Fixed(ql.ActualActual.Bond)
    
    cleanprice = 45.83
    ql.Settings.instance().evaluationDate = calc_date
    
    schedule = ql.MakeSchedule(start_d, mat_d, frequency)
    
    bond = ql.AmortizingFixedRateBond(0, [100, 100, 75, 50, 25, 0], schedule, [0.065], dayCounter)
    for c in bond.cashflows():
        print(f"{str(c.date()):20} => {c.amount():.4}")
    
    ytm = bond.bondYield(float(cleanprice), dayCounter, ql.Compounded, freq)
    print(f"{'YTM':20} => {round(ytm * 100, 8):.6}")
    print(f"{'Accrued days':20} => {str(ql.BondFunctions.accruedDays(bond)):.4}")
    print(f"{'Accrued amount':20} => {round(bond.accruedAmount(), 8):.4}")
    

    The following is the printing of cash flow and ytm,I output accrued interest and interest days, so the accrued interest should be 138/365 * 6.5/2=1.2287, and the output result is 2.458. And the YTm finally calculated is also wrong, and the correct YTM should be 15.10%. I can't find the reason

    July 24th, 2020      => 6.5
    July 24th, 2021      => 6.5
    July 24th, 2021      => 25.0
    July 24th, 2022      => 4.875
    July 24th, 2022      => 25.0
    July 24th, 2023      => 3.25
    July 24th, 2023      => 25.0
    July 24th, 2024      => 1.625
    July 24th, 2024      => 25.0
    YTM                  => 125.183
    Accrued days         => 137
    Accrued amount       => 2.44
    
    opened by bobinghua 4
  • MakeSchedule() overshoots the specified end date

    MakeSchedule() overshoots the specified end date

    Capture Per screenshot, the formula works fine with 12M internal but breaks some for some reason with 120M interval. I specified end date in year 2198Is there a simpler way to add term to a start date? I want to create a vector of dates by adding a vector of terms to a start date. MakeSchedule() requires you to provide an end date, which is actually the thing I am trying to compute.

    Thanks!

    opened by jeschenx 4
  • short rate generation under G2 and BK

    short rate generation under G2 and BK

    Hi Luigi, Sorry, i am trying to follow the examples on the from the book (quantlibpythoncookbook). I can follow how to calibrate the model using swaptions. I was also trying to understand the short rate diffusion profile under g2 and black karasinski, but i can t find anything in the documentation very clear. For example, HullWhiteProcess is for HW1F , but for BK or G2?? are some lines of code available?? Also, another question, HW2F model, is it available?? Many thanks for your help and kind regards Damian Fallet

    opened by DFallet 1
Releases(QuantLib-v1.28)
  • QuantLib-v1.28(Oct 25, 2022)

    Downloads:

    Changes for QuantLib 1.28:

    QuantLib 1.28 includes 33 pull requests from several contributors.

    Some of the most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/24?closed=1.

    Portability

    • New language standard: as announced in the notes for the previous release, this release started using some C++14 syntax. This should be supported by most compilers released in the past several years.
    • End of support: as announced in the notes for the previous release, this release is the last to manage thread-local singletons via a user-provided sessionId function. Future releases will use the built-in language support for thread-local variables.
    • Future end of support: after the next two or three releases, using std::tuple, std::function and std::bind (instead of their boost counterparts) will become the default. If you're using ext::tuple etc. in your code (which is suggested), this should be a transparent change. If not, you'll still be able to choose the boost versions via a configure switch for a while.

    Date/time

    • Added Act/366 and Act/365.25 day counters; thanks to Ignacio Anguita (@IgnacioAnguita).
    • Added H.M. the Queen's funeral to the UK calendars; thanks to Tomass Wilson (@Wilsontomass).

    Instruments

    • Amortizing bonds were moved out of the experimental folder. Also, a couple of utility functions were provided to calculate amortization schedules and notionals.

    Pricing engines

    • Fixed results from COSHestonEngine in the case of an option with short time to expiration and deep ITM or deep OTM strike prices; thanks to Ignacio Anguita (@IgnacioAnguita).
    • The ISDA engine for CDS could calculate the fair upfront with the wrong sign; this is now fixed, thanks to Gualtiero Chiaia (@gchiaia).

    Term structures

    • The constructor for OISRateHelper now allows to specify the endOfMonth parameter; thanks to Guillaume Horel (@thrasibule).

    Finite differences

    • Fixed computation of cds boundaries in LocalVolRNDCalculator; thanks to @mdotlic.

    Experimental folder

    The ql/experimental folder contains code whose interface is not fully stable, but is released in order to get user feedback. Experimental classes make no guarantees of backward compatibility; their interfaces might change in future releases.

    • Breaking change: the constructor of the CPICapFloorTermPriceSurface class now also takes an explicit interpolation type.
    • Possibly breaking: the protected constructor for CallableBond changes its arguments. If you inherited from this class, you'll need to update your code. If you're using the existing derived bond classes, the change will be transparent.
    • Pricing engines for callable bonds worked incorrectly when the face amount was not 100. This is now fixed.
    • The impliedVolatility method for callable bonds was taking a target NPV, not a price. This implementation is now deprecated, and a new overload was added taking a price in base 100.

    Deprecated features

    • Removed features deprecated in version 1.23:
      • the constructors of ZeroCouponInflationSwap and ZeroCouponInflationSwapHelper missing an explicit CPI interpolation type;
      • the constructors of ActualActual and Thirty360 missing an explicit choice of convention, and the constructor of Thirty360 passing an isLastPeriod boolean flag.
    • Deprecated the constructors of FixedRateBond taking an InterestRate instance or not taking a Schedule instance.
    • Deprecated the constructor of FloatingRateBond not taking a Schedule instance.
    • Deprecated the constructors of AmortizingFixedRateBond taking a sinking frequency or a vector of InterestRate instances.
    • Deprecated the constructor of CPICapFloor taking a Handle to an inflation index, and its inflationIndex method returning a Handle. New versions of both were added using shared_ptr instead.
    • Deprecated one of the constructors of SabrSmileSection; a new version was added also taking an optional reference date.
    • Deprecated the old impliedVolatility method for callable bonds; see above.

    Thanks go also to Konstantin Novitsky (@novitk), Peter Caspers (@pcaspers), Klaus Spanderen (@klausspanderen), Fredrik Gerdin Börjesson (@gbfredrik) and Dirk Eddelbuettel (@eddelbuettel) for a number of smaller fixes, and to Jonathan Sweemer (@sweemer) for various improvements to the automated CI builds.

    New Contributors

    • @novitk made their first contribution in https://github.com/lballabio/QuantLib/pull/1448
    • @IgnacioAnguita made their first contribution in https://github.com/lballabio/QuantLib/pull/1453
    • @mdotlic made their first contribution in https://github.com/lballabio/QuantLib/pull/1435
    • @Wilsontomass made their first contribution in https://github.com/lballabio/QuantLib/pull/1481

    Full Changelog: https://github.com/lballabio/QuantLib/compare/QuantLib-v1.27.1...QuantLib-v1.28

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.28.tar.gz(8.87 MB)
    QuantLib-1.28.zip(11.42 MB)
  • QuantLib-v1.27.1(Aug 30, 2022)

    Downloads:

    Changes for QuantLib 1.27.1:

    QuantLib 1.27.1 is a bug-fix release.

    It restores the old implementation of Null<T> which was replaced in version 1.27 with a new one; the latter was reported to cause an internal compiler error under Visual C++ 2022 for some client code. The new version (which avoids some problems when replacing Real with some AAD-enabled types) is still available; depending on how you compile QuantLib, it can be enabled through the --enable-null-as-functions configure flag, the cmake variable QL_NULL_AS_FUNCTIONS, or the define with the same name in the ql/userconfig.hpp header (@lballabio).

    Full Changelog: https://github.com/lballabio/QuantLib/compare/QuantLib-v1.27...QuantLib-v1.27.1

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.27.1.tar.gz(8.86 MB)
    QuantLib-1.27.1.zip(11.41 MB)
  • QuantLib-v1.27(Jul 22, 2022)

    Downloads:

    Changes for QuantLib 1.27:

    QuantLib 1.27 includes 37 pull requests from several contributors.

    Some of the most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/23?closed=1.

    Portability

    • Removed support: as announced in the notes for the previous release, support for Visual Studio 2013 was dropped.
    • End of support: as announced in the notes for the previous release, this release will be the last to avoid C++14 syntax. Allowing the newer (but still oldish) standard should still support most compilers released in the past several years.
    • Future end of support: this release and the next will be the last to manage thread-local singletons via a user-provided sessionId function. Future releases will use the built-in language support for thread-local variables.
    • The Real type is now used consistently throughout the codebase, thanks to the Xcelerit dev team (@xcelerit-dev). This, along with other changes, allows its default definition to double to be replaced with one of the available third-party AAD types.
    • The test suite is now built using the header-only version of Boost.Test, thanks to Jonathan Sweemer (@sweemer). This might simplify Boost installation for some users, since in the default configuration QuantLib now only needs the Boost headers.
    • Replaced some Boost facilities with the corresponding C++11 counterparts; thanks to Klaus Spanderen (@klausspanderen) and Jonathan Sweemer (@sweemer).

    Date/time

    • Fixed the behavior of a couple of Australian holidays; thanks to Pradeep Krishnamurthy (@pradkrish) and Fredrik Gerdin Börjesson (@gbfredrik).

    Instruments

    • Added the Turnbull-Wakeman engine for discrete Asian options; thanks to Fredrik Gerdin Börjesson (@gbfredrik) for the main engine code and to Jack Gillett (@jackgillett101) for the Greeks.
    • Added more validation to barrier options; thanks to Jonathan Sweemer (@sweemer).

    Models

    • Fixed the start date of the underlying swap in swaption calibration helpers; thanks to Peter Caspers (@pcaspers).
    • Fixed parameter checks in SVI volatility smiles; thanks to Fredrik Gerdin Börjesson (@gbfredrik).

    Patterns

    • Avoid possible iterator invalidation while notifying observers; thanks to Klaus Spanderen (@klausspanderen).

    Deprecated features

    • Removed the --enable-disposable and --enable-std-unique-ptr configure switches.
    • Removed features deprecated in version 1.22 (@lballabio):
      • the unused AmericanCondition and FDAmericanCondition classes;
      • the old-style FD shout and dividend shout engines;
      • the unused OneFactorOperator class;
      • the io::to_integer function;
      • the ArrayProxy and MatrixProxy classes.
    • Deprecated the QL_NOEXCEPT and QL_CONSTEXPR macros.
    • Deprecated the QL_NULL_INTEGER and QL_NULL_REAL macros.
    • Deprecated some unused parts of the old-style FD framework (@lballabio):
      • the PdeShortRate class;
      • the ShoutCondition and FDShoutCondition classes;
      • the FDDividendEngineBase, FDDividendEngineMerton73, FDDividendEngineShiftScale and FDDividendEngine classes;
      • the FDStepConditionEngine and FDEngineAdapter classes.
    • Deprecated a number of function objects in the ql/math/functional.hpp header.
    • Deprecated the unused MultiCurveSensitivities class.
    • Deprecated the unused inner_product function.

    Thanks go also to Ryan Russell (@ryanrussell) for documentation fixes.

    New Contributors

    • @gbfredrik made their first contribution in https://github.com/lballabio/QuantLib/pull/1351
    • @pradkrish made their first contribution in https://github.com/lballabio/QuantLib/pull/1374
    • @ryanrussell made their first contribution in https://github.com/lballabio/QuantLib/pull/1395
    • @xcelerit-dev made their first contribution in https://github.com/lballabio/QuantLib/pull/1400
    • @lotzej made their first contribution in https://github.com/lballabio/QuantLib/pull/1401

    Full Changelog: https://github.com/lballabio/QuantLib/compare/QuantLib-v1.26...QuantLib-v1.27

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.27.tar.gz(8.88 MB)
    QuantLib-1.27.zip(11.42 MB)
  • QuantLib-v1.26(Apr 20, 2022)

    Downloads:

    Changes for QuantLib 1.26:

    QuantLib 1.26 includes 26 pull requests from several contributors.

    Some of the most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/22?closed=1.

    Portability

    • End of support: as announced in the notes for the previous release, this release is the last to support Visual Studio 2013.
    • End of support: this release is the last to support the long-deprecated configure switches --enable-disposable and --enable-std-unique-ptr. From the next release, Disposable will always be disabled (and eventually removed) and std::unique_ptr will always be used instead of std::auto_ptr. This has already been the default in the last few releases.
    • Future end of support: this release and the next will be the last to avoid C++14 syntax. This should still support most compilers released in the past several years (except for Visual Studio 2013, which we're already dropping in this release).
    • If tagged libraries are specified, as is the default on Windows, CMake now gives the built libraries the same names as the Visual Studio solution (for instance, QuantLib-x64-mt-s instead of QuantLib-mt-s-x64) so that the pragma in ql/auto_link.hpp works.
    • QuantLib can now also be built as a subproject in a larger CMake build (thanks to @pcaspers).

    Date/time

    • When printed, Period instances now display transparently what their units and length are, instead of doing more fancy formatting (e.g., "16 months" is now displayed instead of "1 year 4 months"). Also, Period instances that compare as equal now return the same period from their normalize method (@lballabio).

    Indexes

    • Added Tona (Tokyo overnight average) index (thanks to @nistick21).
    • Added static laggedFixing method to CPI structure which provides interpolation of inflation index fixings (@lballabio).

    Cash flows

    • The CPICoupon and CPICashFlow classes now take into account the correct dates and observation lag for interpolation (@lballabio).

    Instruments

    • Added a BondForward class that generalizes the existing FixedRateBondForward to any kind of bond (thanks to @marcin-rybacki).
    • Avoided unexpected jumps in callable bond OAS (thanks to @ralfkonrad).
    • Fixed TreeSwaptionEngine mispricing when adjusting the instrument schedule to a near exercise date (thanks to @ralfkonrad).
    • the ForwardRateAgreement class now works correctly without an explicit discount curve (@lballabio).

    Term structures

    • Dates explixitly passed to InterpolatedZeroInflationCurve are no longer adjusted automatically to the beginning of their inflation period (@lballabio).

    Deprecated features

    • Removed the MCDiscreteAveragingAsianEngine class, deprecated in version 1.21.
    • Deprecated the LsmBasisSystem::PolynomType typedef, now renamed to PolynomialType; MakeMCAmericanEngine::withPolynomOrder was also deprecated and renamed to withPolynomialOrder.
    • Deprecated the ZeroInflationCashFlow constructor taking an unused calendar and business-day convention.
    • Deprecated the CPICoupon constructor taking a number of fixing days, as well as the CPICoupon::indexObservation, CPICoupon::adjustedFixing and CPICoupon::indexFixing methods and the CPILeg::withFixingDays method.
    • Deprecated the CPICashFlow constructor taking a precalculated fixing date and a frequency.
    • Deprecated the Observer::set_type and Observable::set_type typedefs.
    • Deprecated the unused Curve class.
    • Deprecated the unused LexicographicalView class.
    • Deprecated the unused Composite class.
    • Deprecated the unused DriftTermStructure class.

    Thanks go also to @mgroncki, @sweemer and @FloridSleeves for smaller fixes, enhancements and bug reports.

    New Contributors

    • @FloridSleeves made their first contribution in https://github.com/lballabio/QuantLib/pull/1295
    • @nistick21 made their first contribution in https://github.com/lballabio/QuantLib/pull/1302

    Full Changelog: https://github.com/lballabio/QuantLib/compare/QuantLib-v1.25...QuantLib-v1.26

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.26.tar.gz(8.87 MB)
    QuantLib-1.26.zip(11.42 MB)
  • QuantLib-v1.25(Jan 18, 2022)

    Downloads:

    Changes for QuantLib 1.25:

    QuantLib 1.25 includes 35 pull requests from several contributors.

    Some of the most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/21?closed=1.

    Portability

    • End of support: this release and the next will be the last two to support Visual Studio 2013.
    • Added a few CMake presets for building the library (thanks to @sweemer).
    • When built and installed through CMake, the library now installs a QuantLibConfig.cmake file that allows other CMake projects to find and use QuantLib (thanks to @sweemer).

    Cashflows

    • Fixed the accrual calculation in overnight-indexed coupons (thanks to @mshojatalab).
    • Fixed fixing-days usage in SubPeriodsCoupon class (thanks to @marcin-rybacki).
    • IBOR coupons fixed in the past no longer need a forecast curve to return their amount (@lballabio).

    Indexes

    • Important change: inflation indexes inherited from the ZeroInflationIndex class no longer rely on their forecast curve for interpolation. For coupons that already took care of interpolation (as in the case of CPICoupon and ZeroInflationCashFlow) this should not change the results. In other cases, figures will change but should be more correct as the interpolation is now performed according to market conventions. Also, most inflation curves now assume that the index is not implemented. Year-on-year inflation indexes and curves are not affected (@lballabio).

    Instruments

    • Breaking change: convertible bonds were moved out of the ql/experimental folder. Also, being market values and not part of the contract, dividends and credit spread were moved from the bond to the BinomialConvertibleEngine class (thanks to @w31ha0).
    • The ForwardRateAgreement no longer inherits from Forward. This also made it possible to implement the amount method returning the expected cash settlement (thanks to @w31ha0). The methods from Forward were kept available but deprecated so code using them won't break. Client code might break if it performed casts to Forward.

    Models

    • Fixed formula for discount bond option in CIR++ model (thanks to @mmencke).

    Term structures

    • It is now possible to use normal volatilities in SABR smile sections, and thus in the SwaptionVolCube1 class (thanks to @w31ha0).

    Date/time

    • Added Chinese holidays for 2022 (thanks to @wegamekinglc).

    Currencies

    • Added a number of African, American, Asian and European currencies from Quaternion's QuantExt project (thanks to @OleBueker).

    Experimental folder

    The ql/experimental folder contains code whose interface is not fully stable, but is released in order to get user feedback. Experimental classes make no guarantees of backward compatibility; their interfaces might change in future releases.

    • Added experimental rate helpers for LIBOR-LIBOR and Overnight-LIBOR basis swaps (@lballabio).
    • Renamed WulinYongDoubleBarrierEngine to SuoWangDoubleBarrierEngine (thanks to @aditya113141 for the fix and @xuruilong100 for the heads-up).

    Deprecated features

    • Deprecated the constructors of zero-coupon inflation term structures taking an indexIsInterpolated boolean argument.
    • Deprecated a number of methods in the ForwardRateAgreement class that used to be inherited from Forward.
    • Deprecated a couple of constructors in the SofrFutureRateHelper class.
    • Deprecated the WulinYongDoubleBarrierEngine alias for SuoWangDoubleBarrierEngine.
    • Deprecated the protected spreadLegValue_ data member in the BlackIborCouponPricer class.

    Thanks go also to @tomwhoiscontrary, @igitur, @matthewkolbe, @bensonluk, @hsegger, @klausspanderen, @jxcv0 and @azsrz for smaller fixes, enhancements and bug reports.

    New Contributors

    • @sweemer made their first contribution in https://github.com/lballabio/QuantLib/pull/1209
    • @azsrz made their first contribution in https://github.com/lballabio/QuantLib/pull/1242
    • @jxcv0 made their first contribution in https://github.com/lballabio/QuantLib/pull/1248
    • @matthewkolbe made their first contribution in https://github.com/lballabio/QuantLib/pull/1254
    • @OleBueker made their first contribution in https://github.com/lballabio/QuantLib/pull/1262
    • @hsegger made their first contribution in https://github.com/lballabio/QuantLib/pull/1280
    • @aditya113141 made their first contribution in https://github.com/lballabio/QuantLib/pull/1279
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.25.tar.gz(8.87 MB)
    QuantLib-1.25.zip(11.41 MB)
  • QuantLib-v1.24(Oct 19, 2021)

    Downloads

    Changes for QuantLib 1.24:

    QuantLib 1.24 includes 25 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/20?closed=1.

    Portability

    • Overhauled the CMake build system (thanks to @pkovacs). Among other things, it now allows to specify the available configuration options from the cmake invocation and adds the required Boost libraries accordingly.

    Instruments

    • Avoid callable-bond mispricing when a call date is close but not equal to a coupon date (thanks to @ralfkonrad for the fix and to @aichao for the analysis). See https://github.com/lballabio/QuantLib/issues/930 for details.
    • A new RiskyBondEngine is available for bonds (thanks to @w31ha0). It prices bonds based on a risk-free discount cure and a default-probability curve used to assess the probability of each coupon payment. It makes accessible to all bonds the calculations previously available in the experimental RiskyBond class.

    Cashflows

    • The choice between par and indexed coupons was moved to IborCouponPricer (thanks to @pcaspers). This also made it possible to override the choice locally when building a VanillaSwap or a SwapRateHelper, so that coupons with both behaviors can now be used at the same time.

    Term structures

    • Cross-currency basis swap rate helpers now support both constant-notional and marked-to-market swaps (thanks to @marcin-rybacki).

    Date/time

    • Added Chilean calendar (thanks to @anubhav-pandey1).
    • Added new ThirdWednesdayInclusive date-generation rule that also adjusts start and end dates (thanks to @w31ha0).

    Patterns

    • Overhauled Singleton implementation (thanks to @pcaspers). Singletons are now initialized in a thread-safe way when sessions are enabled, global singletons (that is, independent of sessions) were made available, and static initialization was made safer.

    Test suite

    • Sped up some of the longer-running tests (thanks to @mshojatalab).

    Deprecated features

    • Deprecated default constructor for the U.S. calendar; the desired market should now be passed explicitly.
    • Deprecated the nominalTermStructure method and the corresponding data member in inflation term structures. Any object needing the nominal term structure should have it passed explicitly.
    • Deprecated the termStructure_ data member in BlackCalibrationHelper. It you're inheriting from BlackCalibrationHelper and need it, declare it in your derived class.
    • Deprecated the createAtParCoupons, createIndexedCoupons and usingAtParCoupons methods of IborCoupon, now moved to a new IborCoupon::Settings singleton (thanks to @pkovacs).
    • Deprecated the conversionType and baseCurrency static data members of Money, now moved to a new Money::Settings singleton (thanks to @pkovacs).
    • Removed features deprecated in version 1.19: the BMAIndex constructor taking a calendar, the AmericanCondition and ShoutCondition constructors taking an option type and strike, the CurveDependentStepCondition class and the StandardCurveDependentStepCondition typedef, the BlackCalibrationHelper constructor taking a yield term structure, the various inflation term structure constructors taking a yield term structure, the various yield term constructors taking a vector of jumps but not specifying a reference date.

    Thanks go also to @lballabio, @laaouini, @jackgillett101, @bnalgo and @klausspanderen for smaller fixes, enhancements and bug reports.

    New Contributors

    • @laaouini made their first contribution in https://github.com/lballabio/QuantLib/pull/1162
    • @anubhav-pandey1 made their first contribution in https://github.com/lballabio/QuantLib/pull/1155
    • @pkovacs made their first contribution in https://github.com/lballabio/QuantLib/pull/1183
    • @mshojatalab made their first contribution in https://github.com/lballabio/QuantLib/pull/1202
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.24.tar.gz(8.86 MB)
    QuantLib-1.24.zip(11.40 MB)
  • QuantLib-v1.23(Jul 14, 2021)

    Downloads:

    QuantLib-1.23.tar.gz QuantLib-1.23.zip

    Changes for QuantLib 1.23:

    QuantLib 1.23 includes 30 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/19?closed=1.

    Portability

    • On Mac OS, the -std=c++11 flag is now added automatically when needed. This applies to both configure and cmake (thanks to Leander Schulten).
    • We now assume that the compiler supports Boost::uBLAS and no longer check for it in configure. (The check was originally introduced for versions of gcc before 4.x, which don't support C++ anyway.) Please let us know if this causes problems on some systems.
    • The Period, InterestRate and InterestRateIndex classes are now visualized more clearly in the Visual Studio debugger (thanks to Francois Botha).

    Cashflows

    • Year-on-year and CPI legs are now set a default coupon pricer. In most cases, this removes the need for setting it explicitly.
    • Add new ZeroInflationCashFlow class, used in zero-coupon inflation swaps (thanks to Ralf Konrad).

    Currencies

    • Added custom constructor that allows to create bespoke currencies not already included in the library (thanks to Marcin Rybacki).

    Date/time

    • Fixed implementation of U.S. 30/360 convention (the old one is still available as 30/360 NASD).
    • The 30/360 ISDA convention can now take the termination date as a constructor argument and use it to adjust the calculation properly.
    • Added the 30/360 ISMA convention; the Bond-Basis convention is now an alias to the former.
    • The 30/360 German convention was renamed to ISDA; "German" remains as an alias.
    • Added new Canadian holiday (National Day for Truth and Reconciliation) established in 2021 (thanks to GitHub user qiubill for the heads-up).
    • Added new U.S. holiday (Juneteenth) established in 2021.
    • Added new Platinum Jubilee U.K. holiday for 2022 (thanks to Ioannis Rigopoulos for the heads-up.)
    • Added missing Christmas Eve holiday to Norwegian calendar (thanks to Prince Nanda).

    Indexes

    • Added ESTR index (thanks to Magnus Mencke).

    Instruments

    • Added zero-coupon swap (thanks to Marcin Rybacki).
    • The Type enumeration defined in several swap classes was moved to their base Swap class.
    • Fixed sign of theta in experimental Kirk engine for spread options (thanks to Xu Ruilong for the heads-up).

    Processes

    • Improved discretization of Cox-Ingersoll-Ross process to avoid occasional divergence (thanks to Magnus Mencke).

    Deprecated features

    • Deprecated default constructor for actual/actual and 30/360 day counters; the desired convention should now be passed explicitly.
    • Removed features deprecated in version 1.18: the CalibrationHelperBase typedef (now CalibrationHelper), some overloads of the CalibratedModel::calibrate and CalibratedModel::value methods, the constructors of PiecewiseYieldCurve and PiecewiseDefaultCurve taking an accuracy parameter, the constructors of BondHelper, FixedRateBondHelper and CPIBondHelper taking a boolean useCleanPrice parameter, the BondHelper::useCleanPrice() method, and the non-static Calendar::holidayList method.

    Thanks go also to Francis Duffy, Kevin Kirchhoff, Magnus Mencke and Klaus Spanderen for smaller fixes, enhancements and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.23.tar.gz(8.84 MB)
    QuantLib-1.23.zip(11.38 MB)
  • QuantLib-v1.22(Apr 15, 2021)

    Downloads:

    QuantLib-1.22.tar.gz QuantLib-1.22.zip

    Changes for QuantLib 1.22:

    QuantLib 1.22 includes 54 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/18?closed=1.

    Portability

    • As previously announced, this release drops support for Visual C++ 2012. VC++ 2013 or later is now required.
    • The Date and Array classes are now visualized more clearly in the Visual Studio debugger (thanks to Francois Botha).

    Language standard

    • QuantLib now uses the C++11 standard and no longer compiles in C++03 mode. As before, it can be compiled with later versions of the standard. For details on the C++11 features used, see the pull requests marked "C++11 modernization" at the above link; for information on possible problems, see https://www.implementingquantlib.com/2021/02/leaving-03-for-real.html.

    Cashflows

    • Revised and tested the SubPeriodCoupon class (thanks to Marcin Rybacki). The class was moved out of the ql/experimental folder and its interface can now be considered stable.
    • Add simple averaging to overnight-index coupons in addition to the existing compound averaging (thanks to Marcin Rybacki).
    • Fixed accrual calculation for inflation coupon when trading ex-coupon (thanks to GitHub user bachhani).

    Currencies

    • Added the Nigerian Naira (thanks to Bryte Morio).

    Date/time

    • Fixed actual/actual (ISMA) day counter calculation for long/short final periods (thanks to Francois Botha).
    • Updated a couple of changed rules for New Zealand calendar (thanks to Paul Giltinan).

    Indexes

    • Added hasHistoricalFixing inspector to Index class to check if the fixing for a given past date is available (thanks to Ralf Konrad).

    Instruments

    • Added new-style finite-difference engine for shout options (thanks to Klaus Spanderen). In the case of dividend shout options, an escrowed dividend model is used.
    • Revised the OvernightIndexFutures class. The class was moved out of the ql/experimental folder and its interface can now be considered stable.
    • Added an overloaded constructor for Asian options that takes all past fixings and thus allows to reprice them correctly when the evaluation date changes (thanks to Jack Gillett).
    • Added support for seasoned geometric Asian options to the Heston engine (thanks to Jack Gillett).

    Patterns

    • Faster implementation of the Observable class in the thread-safe case (thanks to Klaus Spanderen).

    Term structures

    • Added experimental rate helper for constant-notional cross-currency basis swaps (thanks to Marcin Rybacki).
    • Added volatility type and displacements to year-on-year inflation volatility surfaces (thanks to Peter Caspers).

    Deprecated features

    • Removed features deprecated in version 1.17: the Callability::Type typedef (now Bond::Price), the FdmOrnsteinUhlenbackOp typedef (now correctly spelled as FdmOrnsteinUhlenbeckOp, and a number of old-style finite-difference engines (FDAmericanEngine, FDBermudanEngine, FDDividendAmericanEngine and its variants, FDDividendEuropeanEngine and its variants, and FDEuropeanEngine) all replaced by the FdBlackScholesVanillaEngine class.
    • Deprecated the old-style finite difference engines for shout options; they are now replaced by the new FDDividendShoutEngine class.
    • Deprecated a few unused parts of the old-style finite-differences framework: the AmericanCondition class, the OneFactorOperator typedef, and the FDAmericanCondition class.

    Test suite

    • Reduced the run time for the longest-running test cases.

    Thanks go also to Francis Duffy and Cay Oest for smaller fixes, enhancements and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.22.tar.gz(8.87 MB)
    QuantLib-1.22.zip(11.40 MB)
  • QuantLib-v1.21(Jan 20, 2021)

    Downloads:

    QuantLib-1.21.tar.gz

    QuantLib-1.21.zip

    Changes for QuantLib 1.21:

    QuantLib 1.21 includes 24 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/17?closed=1.

    Portability

    • As previously announced, this is the last release to support Visual C++ 2012. Starting from next release, VC++ 2013 or later will be required in order to enable use of C++11 features.

    Instruments

    • Improve date generation for CDS schedules under the post-big-bang rules (thanks to Francis Duffy).
    • Amortizing fixed-rate bonds can now use a generic InterestRate object (thanks to Piter Dias).
    • Added Monte Carlo pricer for discrete-average arithmetic Asian options under the Heston model (thanks to Jack Gillett).
    • Added analytic and Monte Carlo pricers for discrete-average geometric Asian options under the Heston model (thanks to Jack Gillett). Together, they can also be used as a control variate in Monte Carlo models for arithmetic Asian options.
    • Added analytic pricer for continuous-average geometric Asian options under the Heston model (thanks to Jack Gillett).
    • Added analytic pricer for forward options under the Heston model (thanks to Jack Gillett).
    • Added Monte Carlo pricers for forward options under the Black-Scholes and the Heston models (thanks to Jack Gillett).

    Term structures

    • Added Dutch regulatory term structure, a.k.a. ultimate forward term structure (thanks to Marcin Rybacki).
    • Generalized exponential spline fitting to an arbitrary number of parameters; it is now also possible to fix kappa (thanks to David Sansom).
    • Fixed averaging period for 1-month SOFR futures rate helper (thanks to Eisuke Tani).

    Date/time

    • Fixed a bug and added 2017 holidays in Thailand calendar (thanks to GitHub user phil-zxx for the heads-up).
    • Updated Chinese calendar for 2021 (thanks to Cheng Li).
    • Updated Japanese calendar for 2021 (thanks to Eisuke Tani).

    Thanks go also to Francois Botha, Peter Caspers, Ralf Konrad, Matthias Siemering, Klaus Spanderen and Joseph Wang for smaller fixes, enhancements and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.21.tar.gz(8.80 MB)
    QuantLib-1.21.zip(11.32 MB)
  • QuantLib-v1.20(Oct 26, 2020)

    Changes for QuantLib 1.20:

    QuantLib 1.20 includes 24 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/16?closed=1.

    Portability

    • Support for Visual C++ 2012 is being deprecated. It will be dropped after the next release in order to enable use of C++11 features.
    • It is now possible to opt into using std::tuple instead of boost::tuple when the compiler allows it. The default is still to use the Boost implementation. The feature can be enabled by uncommenting the QL_USE_STD_TUPLE macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-std-tuple switch to ./configure on other systems. The --enable-std-tuple switch is also implied by --enable-std-classes. (Thanks to Joseph Wang.)

    Instruments

    • Added mixing-factor parameter to Heston finite-differences barrier, rebate and double-barrier engines (thanks to Jack Gillett).
    • Added a few additional results to Black swaption engine and to analytic European option engine (thanks to Peter Caspers and Marcin Rybacki).
    • Improved calculation of spot date for vanilla swap around holidays (thanks to Paul Giltinan).
    • Added ex-coupon feature to amortizing bonds, callable bonds and convertible bonds.
    • Added optional first-coupon day counter to fixed-rate bonds (thanks to Jacob Lee-Howes).

    Math

    • Added convenience classes LogCubic and LogMixedLinearCubic hiding a few default parameters (thanks to Andrea Maffezzoli).

    Models

    • Added control variate based on asymptotic expansion for the Heston model (thanks to Klaus Spanderen).

    Date/time

    • Added missing Hong Kong holiday (thanks to GitHub user CarrieMY).
    • Added a couple of one-off closing days to the Romanian calendar.
    • Added a one-off holiday to South Korean calendar (thanks to GitHub user fayce66).
    • Added a missing holiday to Turkish calendar (thanks to Berat Postalcioglu).

    Documentation

    • Added basic documentation to optimization methods (thanks to GitHub user martinbrose).

    Deprecated features

    • Features deprecate in version 1.16 were removed: a constructor of the FdmOrnsteinUhlenbeckOp class and a constructor of the SwaptionVolatilityMatrix class.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.20.tar.gz(8.74 MB)
    QuantLib-1.20.zip(11.24 MB)
  • QuantLib-v1.19(Jul 20, 2020)

    Changes for QuantLib 1.19:

    QuantLib 1.19 includes 40 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/15?closed=1.

    Portability

    • Support for Visual C++ 2012 is being deprecated. It will be dropped around the end of 2020 or the beginning of 2021 in order to enable use of C++11 features.
    • Avoided use in Makefiles of functions only available to GNU Make (thanks to GitHub user UnitedMarsupials for the heads-up).

    Build

    • Automated builds on Travis and GitHub Actions were extended. We now have a build for Mac OS X, as well as a few builds that run a number of checks on the code (including clang-tidy) and automatically open pull requests with fixes.

    Term structures

    • Added options for iterative bootstrap to widen the search domain or to keep the best result upon failure (thanks to Francis Duffy).
    • Added flat-extrapolation option to fitted bond curves (thanks to Peter Caspers).

    Instruments

    • Added finite-difference pricing engine for equity options under the Cox-Ingersoll-Ross process (thanks to Lew Wei Hao).
    • Added Heston engine based on exponentially-fitted Laguerre quadrature rule (thanks to Klaus Spanderen).
    • Added Monte Carlo pricing engines for lookback options (thanks to Lew Wei Hao).
    • Added Monte Carlo pricing engine for double-barrier options (thanks to Lew Wei Hao).
    • Added analytic pricing engine for equity options under the Vasicek model (thanks to Lew Wei Hao).
    • The Bond::yield method can now specify a guess and whether the passed price is clean or dirty (thanks to Francois Botha).

    Models

    • Improved grid scaling for FDM Heston SLV calibration, and fixed drift and diffusion for Heston SLV process (thanks to Klaus Spanderen and Peter Caspers).
    • Added mixing factor to Heston SLV process (thanks to Lew Wei Hao).

    Math

    • Improved nodes/weights for the exponentially fitted Laguerre quadrature rule and added sine and cosine quadratures (thanks to Klaus Spanderen).

    Date/time

    • Improved performance of the Calendar class (thanks to Leonardo Arcari).
    • Updated holidays for Indian and Russian calendars (thanks to Alexey Indiryakov).
    • Added missing All Souls Day holiday to Mexican calendar (thanks to GitHub user phil-zxx for the heads-up).
    • Restored New Year's Eve holiday to Eurex calendar (thanks to Joshua Engelman).

    Deprecated features

    • Features deprecate in version 1.15 were removed: constructors of inflation swap helpers, inflation-based pricing engines and inflation coupon pricers that didn't take a nominal term structure.
    • The constructor of BMAIndex taking a calendar was deprecated.
    • The constructors of several interest-rate term structures taking jumps without a reference date were deprecated.
    • The CurveDependentStepCondition class and related typedefs were deprecated.
    • The constructor of BlackCalibrationHelper taking an interest-rate structure was deprecated.
    • The constructors of several inflation curves taking a nominal curve were deprecated. The nominal curve should now be passed to the used coupon pricers.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.19.tar.gz(8.74 MB)
    QuantLib-1.19.zip(11.23 MB)
  • QuantLib-v1.18(Mar 23, 2020)

    Changes for QuantLib 1.18:

    QuantLib 1.18 includes 34 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/14?closed=1.

    Portability

    • As announced in the past release, support of Visual C++ 2010 is dropped. Also, we'll probably deprecate Visual C++ 2012 in the next release in order to drop it around the end of 2020.

    Build

    Term structures

    • A new GlobalBootstrap class can now be used with PiecewiseYieldCurve and other bootstrapped curves (thanks to Peter Caspers). It allows to produce curves close to Bloomberg's.
    • The experimental SofrFutureRateHelper class and its parent OvernightIndexFutureRateHelper can now choose to use either compounding or averaging, in order to accommodate different conventions for 1M and 3M SOFR futures (thanks to GitHub user tani3010).
    • The FraRateHelper class has new constructors that take IMM start / end offsets (thanks to Peter Caspers).
    • It is now possible to pass explicit minimum and maximum values to the IterativeBootstrap class. The accuracy parameter was also moved to the same class; passing it to the curve constructor is now deprecated.

    Instruments

    • It is now possible to build fixed-rate bonds with an arbitrary schedule, even without a regular tenor (thanks to Steven Van Haren).

    Models

    • It is now possible to use normal volatilities to calibrate a short-rate model over caps.

    Date/time

    • The Austrian calendar was added (thanks to Benjamin Schwendinger).
    • The German calendar incorrectly listed December 31st as a holiday; this is now fixed (thanks to Prasad Somwanshi).
    • Chinese holidays were updated for 2020 and the coronavirus event (thanks to Cheng Li).
    • South Korea holidays were updated for 2016-2020 (thanks to GitHub user fayce66).
    • In the calendar class, holidayList is now an instance method; the static version is deprecated. The businessDayList method was also added. (Thanks to Piotr Siejda.)
    • A bug in the 30/360 German day counter was fixed (thanks to Kobe Young for the heads-up).

    Optimizers

    • The differential evolution optimizer was updated (thanks to Peter Caspers).

    Currencies

    • Added Kazakstani Tenge to currencies (thanks to Jonathan Barber).

    Deprecated features

    • Features deprecate in version 1.14 were removed: one of the constructors of the BSMOperator class, the whole OperatorFactory class, and the typedef CalibrationHelper which was used to alias the BlackCalibrationHelper class.
    • The CalibrationHelperBase class is now called CalibrationHelper. The old name remains as a typedef but is deprecated.
    • The overload of CalibratedModel::calibrate and CalibratedModel::value taking a vector of BlackCalibrationHelpers are deprecated in favor of the ones taking a vector of CalibrationHelpers.
    • The static method Calendar::holidayList is deprecated in favor of the instance method by the same name.
    • The constructors of PiecewiseDefaultCurve and PiecewiseYieldCurve taking an accuracy parameter are deprecated in favor of passing the parameter to an instance of the bootstrap class.
    • The constructors of BondHelper and derived classes taking a boolean flag to choose between clean and dirty price are deprecated in favor of the ones taking a Bond::Price::Type argument. The useCleanPrice method is also deprecated in favor of priceType.

    Thanks go also to Ralf Konrad, Klaus Spanderen, Carlos Fidel Selva Ochoa, F. Eugene Aumson and Francois Botha for smaller fixes, enhancements, and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.18.tar.gz(8.58 MB)
    QuantLib-1.18.zip(11.05 MB)
  • QuantLib-v1.17(Dec 3, 2019)

    Changes for QuantLib 1.17:

    QuantLib 1.17 includes 30 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/13?closed=1.

    Portability

    • As of this release, support of Visual C++ 2010 is deprecated; it will be dropped in next release. Also, we'll probably deprecate Visual C++ 2012 in one of the next few releases in order to drop it around the end of 2020.

    Configuration

    • A new function compiledBoostVersion() is available, (thanks to Andrew Smith). It returns the version of Boost used to compile the library, as reported by the BOOST_VERSION macro. This can help avoid linking the library with user code compiled with a different Boost version (which can result in erratic behavior).
    • It is now possible to specify at run time whether to use indexed coupons (thanks to Ralf Konrad). The compile-time configuration is still used as a default, but it is also possible to call either of the static methods IborCoupon::createAtParCoupons or IborCoupon::createIndexedCoupons to specify your preference. For the time being, the methods above must necessarily be called before creating any instance of IborCoupon or of its derived classes.

    Build

    • As of this version, the names of the binaries produced by the included Visual C++ solution no longer contain the toolset version (e.g., v142).

    Instruments

    • Added ex-coupon functionality to floating-rate bonds (thanks to Steven Van Haren).
    • The inner structure Callability::Price was moved to the class Bond and can now be used to specify what kind of price was passed to the BondFunctions::yield method (thanks to Francois Botha).
    • It is now possible to use a par-coupon approximation for FRAs like the one used in Ibor coupons (thanks to Peter Caspers).

    Pricing engines

    • Added escrowed dividend model to the new-style FD engine for DividendVanillaOption (thanks to Klaus Spanderen).
    • Black cap/floor engine now also returns caplet deltas (thanks to Wojciech Slusarski).

    Term structures

    • OIS rate helpers can now choose whether to use as a pillar for the bootstrap either their maturity date or the end date of the last underlying fixing. This provides an alternative if the bootstrap should fail. (Thanks to Drew Saunders for the heads-up.)
    • Instances of the FittedBondDiscountCurve class now behave as simple evaluators (that is, they use the given paramters without performing root-solving) when the maxIterations parameter is set to 0. (Thanks to Nick Firoozye for the heads-up.)

    Date/time

    • Added a few special closing days to the US government bond calendar (thanks to Mike DelMedico).
    • Fixed an incorrect 2019 holiday in Chinese calendar (thanks to Cheng Li).
    • Added missing holiday to Swedish calendar (thanks to GitHub users periculus and tonyzhipengzhou).

    Deprecated features

    • The classes FDEuropeanEngine, FDAmericanEngine, FDBermudanEngine, FDDividendEuropeanEngine, FDDividendEuropeanEngineShiftScale, FDDividendAmericanEngine, FDDividendAmericanEngineShiftScale are now deprecated. They are superseded by FdBlackScholesVanillaEngine.

    Thanks go also to Joel King, Kai Striega, Francis Duffy, Tom Anderson and GitHub user lab4quant for smaller fixes, enhancements, and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.17.tar.gz(8.55 MB)
    QuantLib-1.17.zip(11.01 MB)
  • QuantLib-v1.16(Aug 5, 2019)

    Changes for QuantLib 1.16:

    QuantLib 1.16 includes 34 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/12?closed=1.

    Portability

    • Added support for Visual Studio 2019 (thanks to Paul Giltinan).

    Configuration

    • As announced in past release, the compile-time switch to force non-negative rates was removed.

    Pricing engines

    • Added constant elasticity of variance (CEV) pricing engines for vanilla options. Analytic, FD and SABR engines are available (thanks to Klaus Spanderen).
    • Added quanto pricing functionality to a couple of FD engines for DividendVanillaOption (thanks to Klaus Spanderen).

    Cash flows

    • Digital coupons can now optionally return the value of the naked option (thanks to Peter Caspers).

    Date/time

    • Updated Taiwan holidays for 2019 (thanks to Hank Liu).
    • Added two newly announced holidays to Chinese calendar (thanks to Cheng Li).
    • Updated Japan calendar (thanks to Eisuke Tani).
    • Fixed New Year's day adjustment for Canadian calendar (thanks to Roy Zywina).
    • Added a couple of exceptions for UK bank holidays (thanks to GitHub user Vililikku for the heads-up).
    • Added French calendar (thanks to GitHub user NJeanray).
    • Added public methods to expose a calendar's added and removed holidays (thanks to Francois Botha).
    • Allow the stub date of a schedule to equal the maturity.

    Deprecated features

    • Deprecated a constructor of the SwaptionVolatilityMatrix class that didn't take a calendar.
    • Removed typedefs GammaDistribution, ChiSquareDistribution, NonCentralChiSquareDistribution and InverseNonCentralChiSquareDistribution, deprecated in version 1.12. Use CumulativeGammaDistribution, CumulativeChiSquareDistribution, NonCentralCumulativeChiSquareDistribution and InverseNonCentralCumulativeChiSquareDistribution instead.
    • Removed Actual365NoLeap class, deprecated in version 1.11. It was folded into Actual365Fixed.

    Term structures

    • Take payment days into account when calculating the nodes of a bootstrapped curve based on overnight swaps.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.16.tar.gz(8.53 MB)
    QuantLib-1.16.zip(10.99 MB)
  • QuantLib-v1.15(Feb 19, 2019)

    Changes for QuantLib 1.15:

    QuantLib 1.15 includes 32 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/11?closed=1.

    Portability

    • This release drops support for Boost version 1.43 to 1.47; the minimum required version is now Boost 1.48, released in 2011.
    • Added a .clang-format file to the repository. The format is not going to be enforced, but the style file is provided as a convenience in case you want to format new code according to the conventions of the library.
    • boost::function, boost::bind and a few related classes and functions were imported into the new namespace QuantLib::ext. This allows them to be conditionally replaced with their std:: versions (see the "opt-in features" section below). The default is still to use the Boost implementation. Client code using the boost namespace explicitly doesn't need to be updated.

    Models

    • Added an experimental volatility basis model for caplet and swaptions (thanks to Sebastian Schlenkrich).

    Pricing engines

    • It is now possible to specify polynomial order and type when creating a MCAmericanBasketEngine instance (thanks to Klaus Spanderen).

    Term structures

    • Inflation curves used to store the nominal curve used during their construction. This is still supported for backward compatibility, but is deprecated. You should instead pass the nominal curve explicitly to objects that need one (e.g., inflation helpers, engines, or cashflow pricers).
    • Added experimental helpers to bootstrap an interest-rate curve on SOFR futures (thanks to Roy Zywina).

    Indexes

    • It is now possible to choose the fixing calendar for the BMA index (thanks to Jan Ladislav Dussek).

    Cash flows

    • Fixed broken observability in CMS-spread coupon pricer (thanks to Peter Caspers).

    Date/time

    • Fix implementation of Actual/Actual (ISMA) day counter in case a schedule is provided (thanks to Philip Stephens).
    • Fix implementation of Calendar::businessDaysBetween method when the initial and final date are the same (thanks to Weston Steimel).
    • Added day of mourning for G.H.W. Bush to the list of United States holidays (thanks to Joshua Engelman).
    • Updated list of Chinese holidays for 2019 (thanks to Cheng Li).
    • Added basic unit tests for the TimeGrid class (thanks to Kai Striega).

    Math

    • Prevent solver failure in Richardson extrapolation (thanks to Klaus Spanderen).

    Examples

    • Added multi-curve bootstrapping example (thanks to Jose Garcia). This examples supersedes the old swap-valuation example, that was therefore removed.

    Deprecated features

    • Up to this release, it has been possible to force interest rates to be non-negative by commenting the QL_NEGATIVE_RATES macro in ql/userconfig.hpp on Visual C++ or by passing the --disable-negative-rates switch to ./configure on other systems. This possibility will no longer be supported in future releases.

    New opt-in features

    • It is now possible to use std::function, std::bind and their related classes instead of boost::function and boost::bind. The feature can be enabled by uncommenting the QL_USE_STD_FUNCTION macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-std-function switch to ./configure on other systems. This requires using at least the C++11 standard during compilation.
    • A new ./configure switch, --enable-std-classes, was added as a shortcut for --enable-std-pointers --enable-std-unique-ptr --enable-std-function.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.15.tar.gz(8.71 MB)
    QuantLib-1.15.zip(11.16 MB)
    QuantLib-docs-1.15-html.tar.gz(29.47 MB)
  • QuantLib-v1.14(Oct 1, 2018)

    Changes for QuantLib 1.14:

    QuantLib 1.14 includes 40 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/10?closed=1.

    Portability

    • In April 2018, Microsoft ended its support for Microsoft Visual C++ 2008. As previously announced, this release drops support for it.
    • Fixed generation of RPM from QuantLib.spec (thanks to Simon Rees).
    • Avoided uses of some features removed in C++17 so that the library can be compiled under the latest standard if needed.
    • boost::shared_ptr and a few related classes and functions were imported into the new namespace QuantLib::ext. This allows them to be conditionally replaced with their std:: versions (see the "opt-in features" section below). The default is still to use the boost implementation. Client code using the boost namespace explicitly doesn't need to be updated.
    • Fixed build and tests on FreeBSD-11 (thanks to Klaus Spanderen and to Mikhail Teterin for the heads-up).
    • Fixed tests with the -ffast-math compilation flag enabled (thanks to Klaus Spanderen and to Jon Davies for the heads-up).

    Instruments and pricing engines

    • Add different settlement methods for swaptions (thanks to Peter Caspers).
    • Take into account distinct day-count conventions for different curves in the analytic barrier-option engine (thanks to GitHub user cosplay-raven).
    • Extract the correct constant coefficients to use in finite-difference vanilla-option engine when using a time-dependent Black-Scholes process (thanks to GitHub user Grant6899 for the analysis).

    Cash flows and interest rates

    • Added Bibor and THBFIX indices (thanks to Matthias Lungwitz).

    Models

    • Added a hook for using a custom smile model in the Markov functional model (thanks to Peter Caspers).
    • Added a base class CalibrationHelperBase to the hierarchy of calibration helpers in order to allow for helpers not using the Black model.
    • Return underlying dynamics from Black-Karasinski model (thanks to Fanis Antoniou).

    Finite differences

    • Added higher-order spatial operators (thanks to Klaus Spanderen).
    • Added TR-BDF2 finite-difference scheme (thanks to Klaus Spanderen).

    Term structures

    • Allow swap helpers to specify end-of-month convention (thanks to Matthias Lungwitz).

    Date/time

    • Prevented division by zero in Actual/365 Canadian day counter (thanks to Ioannis Rigopoulos for the heads-up).
    • Added Children's Day to the list of Romanian holidays (thanks to Matthias Lungwitz).
    • Added new calendar for Thailand (thanks to Matthias Lungwitz).
    • Added 30/360 German day counter (thanks to Peter Caspers and Alexey Indiryakov).

    Math

    • Fixed bug in convex-monotone interpolation (thanks to Peter Caspers for the fix and to Tom Anderson for finding the bug).

    New opt-in features

    • It is now possible to use std::shared_ptr and its related classes instead of boost::shared_ptr. Note that, unlike its boost counterpart, std::shared_ptr doesn't check for null pointers before access; this can lead to crashes. The feature can be enabled by uncommenting the QL_USE_STD_SHARED_PTR macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-std-pointers to ./configure on other systems. This requires using at least the C++11 standard during compilation.
    • It is now possible to use std::unique_ptr instead of std::auto_ptr; this makes it possible to compile the library in strict C++17 mode and to avoid deprecation warnings in C++11 and C++14 mode. The feature can be enabled by uncommenting the QL_USE_STD_UNIQUE_PTR macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-std-unique-ptr to ./configure on other systems.

    Thanks go also to Sam Danbury, Barry Devlin, Roland Kapl, and GitHub user todatamining for smaller fixes, enhancements, and bug reports.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.14.tar.gz(8.69 MB)
    QuantLib-1.14.zip(11.13 MB)
    QuantLib-docs-1.14-html.tar.gz(28.39 MB)
  • QuantLib-v1.13(May 24, 2018)

    Changes for QuantLib 1.13:

    QuantLib 1.13 includes 42 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/8?closed=1.

    Portability

    • In April 2018, Microsoft ended its support for Microsoft Visual C++ 2008. This release still includes a solution file for VC++ 2008, but we won't support it further or take bug reports for it. The next release will only contain project files for Visual C++ 2010 and later.
    • Fixed build on Solaris 12.5 in C++11 mode (thanks to Nick Glass).

    Instruments and pricing engines

    • Fix CDS calculation when the start date falls during the week-end (thanks to Guillaume Horel).
    • Allow construction of a ForwardRateAgreement instance even if the interest-rate curve is not yet linked (thanks to Tom Anderson).

    Cash flows and interest rates

    • Added Mosprime, Pribor, Robor and Wibor indices (thanks to Matthias Lungwitz).
    • Improved performance of Black pricer for LIBOR coupons (thanks to Peter Caspers).
    • Fixed experimental quanto coupon pricer (thanks to Peter Caspers).
    • Revised experimental CMS-spread coupon pricer (thanks to Peter Caspers).

    Models

    • Improvements for the experimental generalized Hull-White model (thanks to Roy Zywina).
    • Fixed drift in GSR process (thanks to Peter Caspers for the fix and to Seung Beom Bang for the heads up).
    • Fixed an out-of-bound access in the TwoFactorModel::ShortRateDynamics::process method (thanks to Weston Steimel).

    Finite differences

    • Improved Black-Scholes mesher for low volatilities and high discrete dividends (thanks to Klaus Spanderen).
    • Added method-of-lines scheme (thanks to Klaus Spanderen).

    Date/time

    • Schedule::until can now be used with schedules built from vectors of dates (thanks to GitHub user Grant6899).
    • Added Good Friday to the list of Hungarian and Czech holidays (thanks to Matthias Lungwitz).
    • Updated the list of Turkish holidays after 2014 (thanks to Matthias Lungwitz).

    Math

    • Added convenience operators to initialize array and matrices (thanks to Peter Caspers).

    Test suite

    • Added test case for CIR++ model (thanks to Klaus Spanderen).

    Thanks go also to Jose Aparicio, Roland Kapl and GitHub user lab4quant for smaller fixes and enhancements.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.13.tar.gz(8.70 MB)
    QuantLib-1.13.zip(11.13 MB)
    QuantLib-docs-1.13-html.tar.gz(28.09 MB)
  • QuantLib-v1.12.1(Apr 16, 2018)

    Changes for QuantLib 1.12.1:

    QuantLib 1.12.1 is a bug-fix release for version 1.12.

    It fixes an error that would occur during initialization of the test suite when using the newly released Boost 1.67.0 (see https://github.com/lballabio/QuantLib/pull/446 for details). Thanks to Klaus Spanderen for the prompt fix.

    The library code is unchanged from version 1.12.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.12.1.tar.gz(8.70 MB)
    QuantLib-1.12.1.zip(11.13 MB)
    QuantLib-docs-1.12.1-html.tar.gz(28.32 MB)
  • QuantLib-v1.12(Mar 1, 2018)

    Changes for QuantLib 1.12:

    QuantLib 1.12 includes 54 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/7?closed=1.

    Portability

    • As announced in the previous release, support for the Dev-C++ IDE was removed.
    • In April 2018, Microsoft will end its support for Microsoft Visual C++ 2008. Therefore, this is the last version of QuantLib to support it with maintained project files. The next release will only contain project files for Visual C++ 2010 and later.
    • It is now possible to build a usable library with CMake on Windows (thanks to Javier G. Sogo).
    • Fix autotools build outside the source tree (thanks to Joshua Ulrich).

    Instruments and pricing engines

    • Added OAS calculation to experimental callable bonds (thanks to Bojan Nikolic).
    • Avoided infinite loop for some sets of parameters in experimental variance-gamma engine (thanks to Roy Zywina).

    Cash flows

    • It is now possible to build a cash-flow leg from a schedule created from a precalculated vector of dates (thanks to Peter Caspers).

    Models

    • Affine models can now be used to bootstrap a default-probability curve (thanks to Jose Aparicio).
    • Added Andreasen-Huge volatility interpolation and local volatility calibration (thanks to Klaus Spanderen).
    • Added Rannacher smoothing steps for Heston stochastic local volatility calibration (thanks to Klaus Spanderen).

    Term structures

    • Added L2 penalty to fitted parameters of fitted bond discount curve (thanks to Robin Northcott).
    • Added an optional trading calendar to the FX-swap rate helper and and optional payment lag to the OIS rate helper (thanks to Wojciech Slusarski).
    • Fixed inconsistent treatment of strike in experimental CPI cap/floor term price surface (thanks to Francis Duffy).
    • Correctly handled the case of overlapping strike regions for caps and floors in experimental CPI cap/floor term price surface (thanks to Peter Caspers).
    • Fixed calculation of seasonality correction for interpolated inflation indexes (thanks to Francis Duffy).
    • Implemented composite zero-yield curve as combination of two existing curves via a given binary function (thanks to Francois Botha).
    • Fixed interpolation of shift in swaption volatility matrix (thanks to Peter Caspers).

    Date/time

    • Updated Chinese calendar for 2018 (thanks to Cheng Li).
    • Added Botswana calendar (thanks to Francois Botha).
    • Fixed a few problems with US calendars (thanks to Mike DelMedico and to GitHub user ittegrat).
    • User-added holidays now work correctly when intraday calculations are enabled (thanks to Klaus Spanderen for the fix and to GitHub user volchemist for the report).

    Math

    • Fixed monotonicity of Fritsch-Butland and prevented NaNs in some cases (thanks to GitHub user Grant6899 for the fix and to Tom Anderson for the report).

    Deprecated features

    • The ChiSquareDistribution, NonCentralChiSquareDistribution, InverseNonCentralChiSquareDistribution and GammaDistribution were renamed to CumulativeChiSquareDistribution, NonCentralCumulativeChiSquareDistribution, InverseNonCentralCumulativeChiSquareDistribution and CumulativeGammaDistribution, respectively (thanks to GitHub user IGonza). The old names are still available as typedefs and will be removed in a future release.

    Thanks go also to Marco Craveiro, Dirk Eddelbuettel, Lakshay Garg, Guillaume Horel, Alix Lassauzet, Patrick Lewis, and GitHub users bmmay, bingoko and tournierjc for smaller fixes and enhancements.

    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.12.tar.gz(8.68 MB)
    QuantLib-1.12.zip(11.10 MB)
    QuantLib-docs-1.12-html.tar.gz(28.32 MB)
  • QuantLib-v1.11(Mar 1, 2018)

    Changes for QuantLib 1.11:

    QuantLib 1.11 includes 47 pull requests and fixed issues from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/6?closed=1.

    Portability

    • This is the last version of QuantLib to support the now obsolete Dev-C++ IDE with a maintained project file. The project will be removed in next release.

    Instruments and pricing engines

    • Added ISDA pricing engine for credit default swaps (thanks to Guillaume Horel, Jose Aparicio and Peter Caspers).
    • Added Andersen-Piterbarg engine for the Heston model (thanks to Klaus Spanderen).
    • Improved experimental vanna-volga engine for double-barrier knock-in options (thanks to Giorgio Pazmandi).
    • Added theta calculation to experimental Kirk spread-option engine (thanks to Krzysztof Wos).

    Cash flows

    • Added optional payment lag to fixed, floating and OIS legs (thanks to Fabrice Lecuyer and Joseph Jeisman).
    • Fixed yield calculation with 30/360 US day count convention and settlement on the 31st of the month (thanks to Frank Xue).

    Models

    • Added adaptive successive over-relaxation method for implied volatility calculation (thanks to Klaus Spanderen).

    Indexes

    • Fixed day-count convention and spot lag for CAD LIBOR (thanks to Oleg Kulkov).

    Term structures

    • Optionally optimize setting up OIS helpers (thanks to Peter Caspers).

    Date/time

    • Added Actual/365 Canadian day count convention (thanks to Andrea Maggiulli).

    Math

    • Added GMRES iterative solver for large linear systems (thanks to Klaus Spanderen).
    • Updated Hong Kong calendar up to 2020 (thanks to Nicholas Bertocchi and Alix Lassauzet).

    Build

    • Added configure switch to enable unity build.

    Test suite

    • Added --fast and --faster flags to the test-suite executable. When passed, slower tests are discarded so that the test suite runs in just a few minutes.

    Deprecated features

    • Remove the HestonExpansionEngine::numberOfEvaluations method (deprecated in version 1.9).
    • Remove the MixedLinearCubicInterpolation and MixedLinearCubic constructors not specifying the behavior of the mixed interpolation (deprecated in version 1.8).
    • Remove deprecated overloads of the Swaption::impliedVolatility and CapFloor::impliedVolatility methods (deprecated in version 1.9).
    • Remove NoArbSabrModel::checkAbsorptionMatrix method (deprecated in version 1.8.1).
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.11.tar.gz(8.57 MB)
    QuantLib-1.11.zip(11.10 MB)
    QuantLib-docs-1.11-html.tar.gz(21.46 MB)
  • QuantLib-v1.10.1(Mar 1, 2018)

  • QuantLib-v1.10(Mar 1, 2018)

    Changes for QuantLib 1.10:

    QuantLib 1.10 includes 59 pull requests and fixed issues from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/5?closed=1.

    Portability

    • Added support for the recently released Visual Studio 2017.
    • Unified Visual Studio solution file. The provided QuantLib.sln file works for all versions from 2010 to 2017.
    • Added support for the recently released Boost 1.64.0 (thanks to Klaus Spanderen).
    • Converted non-ASCII characters in source files to UTF-8; this should make them work with most editors (thanks to Krzysztof Woś and Jose Aparicio).
    • Fixed some compilation issues with older versions of the Sun CC compiler and with the gcc 3.4 series. The offending code has simply been disabled; when using those compilers, is also suggested to downgrade Boost to an older version since more recent ones can give problems. Boost 1.54.0 was reported to work. It is likely that no further support will be given to these compilers in future releases.

    Instruments and pricing engines

    • Added Heston pricing engine based on Fourier-Cosine series expansion (thanks to Klaus Spanderen).
    • Added cash annuity model in Black swaption engine (thanks to Peter Caspers, Werner Kuerzinger and Paul Giltinan).
    • Add an optional exogenous discount curve to analytic Black European option engine (thanks to Paul Giltinan).

    Models

    • Added collocating local-volatility model (thanks to Klaus Spanderen).
    • Optionally disable Feller constraint in Cox-Ingersoll-Ross model (thanks to Oleksandr Khomenko).

    Interest rates

    • Allow using an arbitrary solver to calculate yield (thanks to Daniel Hrabovcak).
    • Update handling of July 4th for US LIBOR fixings (thanks to Oleg Kulkov for the heads-up).
    • Added CompoundingThenSimple convention (thanks to Martin Ross).

    Inflation

    • Use the lagged reference period to interpolate inflation fixings (thanks to Francois Botha).

    Volatility

    • Reduce the memory footprint of OptionletStripper1 (thanks to Matthias Lungwitz)

    Date/time

    • Updated Chinese calendar for 2017 (thanks to Cheng Li).
    • Added CDS2015 date-generation rule with the correct semiannual frequency (thanks to Guillaume Horel).
    • The Iceland calendar used to incorrectly adjust New Year's Day to the next Monday when falling on a holiday. That's now fixed (thanks to Stefan Gunnsteinsson for the heads-up).
    • Fixed bug that prevented correct calculation of an ECB date on the first day of a month (thanks to Nicholas Bertocchi).
    • Fixed bug in Schedule that ignored end-of-month convention when calculating reference dates for irregular coupons (thanks to Ryan Taylor).
    • Allow passing a schedule to Actual/Actual day counter for correct calculation of reference dates (thanks to Ryan Taylor).

    Math

    • Added harmonic spline interpolation (thanks to Nicholas Bertocchi).

    Examples

    • Added examples for global optimizers (thanks to Andres Hernandez).

    Deprecated features

    • Removed the SwaptionHelper constructors not taking an explicit volatility type (deprecated in version 1.8).
    • Removed the SwaptionVolatilityMatrix constructors not taking an explicit volatility type (deprecated in version 1.8).
    • Removed the BlackSwaptionEngine constructor overriding the displacement from the given volatility structure (deprecated in version 1.8).
    • Removed the FlatSmileSection and InterpolatedSmileSection constructors not taking an explicit volatility type (deprecated in version 1.8).
    • Removed the RiskyAssetSwapOption constructor taking a side (deprecated in version 1.8).

    Possibly breaking changes

    • The constructors of a few Libor-like indexes were made explicit. This means that code such as the following, which used to compile, will now break. That's probably a good thing.

       Handle<YieldTermStructure> forecast_curve;
       Euribor6M index = forecast_curve;
      
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.10.tar.gz(8.50 MB)
    QuantLib-1.10.zip(11.03 MB)
    QuantLib-docs-1.10-html.tar.gz(27.31 MB)
  • QuantLib-v1.9.2(Mar 1, 2018)

  • QuantLib-v1.9.1(Mar 1, 2018)

    Changes for QuantLib 1.9.1:

    QuantLib 1.9.1 is a bug-fix release for QuantLib 1.9.

    • Prevented a linking error when multiple compilation units included the global ql/quantlib.hpp header (thanks to Dirk Eddelbuettel).
    • Prevented a compilation error with gcc 4.4 on RedHat (thanks to GitHub user aloupos for the heads-up).
    • Prevented a compilation error with the parallel unit runner and the recently released Boost 1.63.0.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.9.1.tar.gz(8.34 MB)
    QuantLib-1.9.1.zip(10.86 MB)
    QuantLib-docs-1.9.1-html.tar.gz(27.27 MB)
  • QuantLib-v1.9(Mar 1, 2018)

    Changes for QuantLib 1.9:

    QuantLib 1.9 includes 27 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt and at https://github.com/lballabio/QuantLib/milestone/3?closed=1.

    Portability

    • Dropped support for Visual C++ 8 (2005). As of April 2016, the compiler is no longer supported by Microsoft.
    • Allow the parallel test runner to work with Boost 1.62 (thanks to Klaus Spanderen for the fix and to Andrei Borodaenko for the heads-up).

    Interest rates

    • Allow negative jumps in interest-rate curves. Previously, trying to pass one would result in an exception (thanks to Leanpub reader Jeff for the heads-up).
    • Added BBSW and Aonia indexes from Australia and BKBM and NZOCR indexes from New Zealand (thanks to Fabrice Lecuyer).

    Volatility

    • Added normal implied-volatility calculation to caps/floors (thanks to Paolo Mazzocchi).

    Instruments

    • Fix a scenario in which a CompositeInstrument instance would stop receiving notifications (thanks to Peter Caspers for the heads-up).
    • Added a few safety checks to the CVA swap engine (thanks to Andrea Maggiulli).
    • Auto-deactivate Boyle-Lau optimization for barrier options when not using a CRR tree (thanks to Riccardo Ghetta).

    Date/time

    • Changed data type for Date serial numbers to int_fast_32t to improve performance of date calculations (thanks to Peter Caspers).
    • Added ECB maintenance period dates for 2017 (thanks to Paolo Mazzocchi).
    • Fixed rule for the Japanese Mountain Day holiday (thanks to Eisuke Tani).
    • Fixed United States holidays before 1971 (thanks to Nick Glass for the heads-up).
    • Added a missing Chinese holiday (thanks to Cheng Li).
    • Ensure correct formatting when outputting dates (thanks to Peter Caspers).

    New opt-in features

    These features are disabled by default and can be enabled by defining a macro or passing a flag to ./configure. Feedback is appreciated.

    • Enable thread-safe singleton initialization (thanks to GitHub user sdgit). The feature can be enabled by uncommenting the QL_ENABLE_SINGLETON_THREAD_SAFE_INIT macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-thread-safe-singleton-init to ./configure on other systems.

    Experimental folder

    The ql/experimental folder contains code whose interface is not fully stable, but is released in order to get user feedback. Experimental classes make no guarantees of backward compatibility; their interfaces might change in future releases.

    Changes and new contributions for this release were:

    • OIS with arithmetic average (thanks to Stefano Fondi). A corresponding bootstrap helpers is also available.
    • a function to calculate multi-curve sensitivities (thanks to Michael von den Driesch).
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.9.tar.gz(8.35 MB)
    QuantLib-1.9.zip(10.86 MB)
    QuantLib-docs-1.9-html.tar.gz(27.37 MB)
  • QuantLib-v1.8.1(Mar 1, 2018)

    Changes for QuantLib 1.8.1:

    QuantLib 1.8.1 is a bug-fix release for version 1.8.

    • A test failure with Visual C++ 14 (2015) was avoided. Up to VC++14 update 2, the compiler would inline a call to std::min and std::max incorrectly causing a calculation to fail (thanks to Ivan Cherkasov for the heads-up).
    • A test failure with the upcoming Boost 1.62 was avoided. A QuantLib test was checking for the stored value of a hash whose value changed in Boost 1.62.
    • Miscellaneous fixes for the g1d swaption engine and instrument (thanks to Peter Caspers).
    • Whit Monday was no longer a holiday in Sweden since 2005 (thanks to Stefano Fondi).
    • A new holiday for election day 2016 was added to the South African calendar (thanks to Jasen Mackie).
    • A few missing CMakeLists were added to the distributed release (thanks to izavyalov for the heads-up).
    • An irregular last period in a schedule was not reported as such (thanks to Schmidt for the heads-up).
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.8.1.tar.gz(8.34 MB)
    QuantLib-1.8.1.zip(10.87 MB)
    QuantLib-docs-1.8.1-html.tar.gz(26.79 MB)
  • QuantLib-v1.8(Mar 1, 2018)

    Changes for QuantLib 1.8

    QuantLib 1.8 includes 45 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt.

    Portability

    • The minimum required Boost version is now Boost 1.43 (May 2010). However, it is strongly suggested to use a recent version, or at least Boost 1.48 (November 2011).
    • Added initial CMake support (thanks to Dmitri Nesteruk). This makes it possible to compile QuantLib on CLion and other CMake-based tools.
    • The build now generates and installs pkg-config file on Linux systems (thanks to GitHub user njwhite).

    Interest rates

    • Fixed links to documentation for LIBOR indexes (thanks to Jose Magana).

    Volatility

    • Added the possibility to price swaptions and to calculate their implied volatilities in a Black-like model with normal volatilities as well as shifted lognormal (thanks to Peter Caspers).
    • Added the possibility to price caps in a Black-like model with normal volatilities as well as shifted lognormal (thanks to Michael von den Driesch).
    • Caplet strike is correctly recomputed during stripping (thanks to Michael von den Driesch).

    Instruments

    • Added basic CVA IRS pricing engine (stand alone, no portfolio; no WWR, no collateral). Thanks to Jose Aparicio.

    Models

    • Black-Scholes processes now return the closed-formula expectation, standard deviation and variance over long periods (thanks to Peter Caspers).

    Currencies

    • Added Ukrainian hryvnia (thanks to GitHub user maksym-studenets).

    Monte Carlo

    • Use different random-number generators for calibration and pricing in Longstaff-Schwartz engine (thanks to Peter Caspers).

    Date/time

    • Added forecast dates for moving holidays to Saudi Arabia calendar up to 2022 (thanks to Jayanth R. Varma).
    • Added new Ukrainian holiday, Defender's Day (thanks to GitHub user maksym-studenets).
    • Added a few more holidays for South Korea (thanks to Faycal El Karaa).

    Math

    • Added mixed log interpolation (thanks to GitHub user sfondi).
    • Avoid mixing different types while bit-shifting in fast Fourier transform on 64-bit systems (thanks to Nikolai Nowaczyk).

    Deprecated features

    • Removed DateParser::split method (deprecated in version 1.6).

    Test suite

    The test suite is now run with a fixed evaluation date instead of using today's date. This helps avoid transient errors due to holidays. It is still possible to use today's date (or any other date) by running it as:

    $ quantlib-test-suite -- --date=today
    

    or

    $ quantlib-test-suite -- --date=2016-02-08
    

    (Thanks to Peter Caspers.)

    New opt-in features

    These features are disabled by default and can be enabled by defining a macro or passing a flag to ./configure. Feedback is appreciated.

    • Added a parallel unit-test runner (thanks to Klaus Spanderen). This was successfully used under Linux, but problems were reported on Mac OS X and occasionally on Visual C++ 2010. The feature requires Boost 1.59 or later and can be enabled by uncommenting the QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-parallel-unit-test-runner to ./configure on other systems.

    Experimental folder

    The ql/experimental folder contains code which is still not fully integrated with the library or even fully tested, but is released in order to get user feedback. Experimental classes are considered unstable; their interfaces might change in future releases.

    Changes and new contributions for this release were:

    • Stochastic local-volatility Heston model, (thanks to Klaus Spanderen and Johannes Goettker-Schnetmann). Both a Monte Carlo and a finite-difference calibration and calculation are provided.
    • Laplace interpolation (thanks to Peter Caspers).
    • Global optimizers: Hybrid Simulated Annealing, Particle Swarm Optimization, Firefly Algorithm, and Differential Evolution (thanks to Andres Hernandez).
    • A SVD-based calculation of the Moore-Penrose inverse matrix (thanks to Peter Caspers).
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.8.tar.gz(8.45 MB)
    QuantLib-1.8.zip(10.85 MB)
    QuantLib-docs-1.8-html.tar.gz(22.44 MB)
  • QuantLib-v1.7.1(Mar 1, 2018)

    Changes for QuantLib 1.7.1

    QuantLib 1.7.1 is a bug-fix release for version 1.7.

    • An unneeded dependency on the Boost.Thread library had slipped into version 1.7 and prevented a successful build when the library was not available. The dependency was removed (thanks to GitHub user MattPD).
    • Trying to build a schedule with a 4-weeks tenor would fail. This is now fixed (thanks to GitHub user smallnamespace for the heads-up).
    • A couple of errors in the list of past holidays for the Russian MOEX calendar was fixed, and the list of holidays for 2016 was added (thanks to Dmitri Nesteruk).
    • Chinese holidays for 2016 were updated (thanks to Cheng Li).
    • The correct curve is now used when calculating the at-the-money swap rate while building swaptions (thanks to Peter Caspers).
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.7.1.tar.gz(8.31 MB)
    QuantLib-1.7.1.zip(10.66 MB)
    QuantLib-docs-1.7.1-html.tar.gz(22.64 MB)
  • QuantLib-v1.7(Mar 1, 2018)

    Changes for QuantLib 1.7:

    QuantLib 1.7 includes over 50 pull requests from several contributors.

    The most notable changes are included below. A detailed list of changes is available in ChangeLog.txt.

    Interest rates

    • Added rate helper to bootstrap on cross-currency swaps (thanks to Maddalena Zanzi). The curve to be bootstrapped can be the one for either of the two currencies.
    • Added the possibility for bootstrap helpers to define their pillar date in different ways (thanks to Paolo Mazzocchi). For each helper, the date of the corresponding node can be defined as the maturity date of the corresponding instrument, as the latest date used on the term structure to price the instrument, or as a custom date. Currently, the feature is enabled for FRAs and swaps.
    • Added the possibility to pass weight when fitting a bond discount curve. Also, it is now possible to fit a spread over an existing term structure (thanks to Andres Hernandez).

    Inflation

    • Added Kerkhof seasonality model (thanks to Bernd Lewerenz).
    • Retrieve inflation fixings from the first day of the month (thanks to Gerardo Ballabio). This avoids the need to store them for each day of the corresponding month.

    Volatility

    • Improve consistency between caplet stripping and pricing (thanks to Michael von den Driesch)

    Instruments

    • Fixed usage of dividend yield in double-barrier formula (Thanks to Dean Raf for the heads-up).
    • Fixed perturbation formula for barrier options.

    Models

    • Refine update behavior of GSR model. Depending on the market change, only the appropriate recalculations are performed (thanks to Peter Caspers).
    • Improve calibration of Heston model (thanks to Peter Caspers).

    Monte Carlo

    • Added the possibility to return the estimated exercise probability from a Longstaff-Schwartz engine (thanks to Giorgio Pazmandi).

    Settings

    • Added the possibility to temporarily disable notifications to observers (thanks to Chris Higgs). When re-enabled, any pending notifications are sent.

    Date/time

    • Added Romanian and Israelian calendars (thanks to Riccardo Barone).
    • Added ECB reserve maintenance periods for 2016 (thanks to Paolo Mazzocchi).
    • Updated South Korean calendar until the end of 2032 (thanks to Paolo Mazzocchi and Faycal El Karaa).
    • Added new Mountain Day holiday for Japan (thanks to Aaron Stephanic for the heads-up).
    • Remove MLK day from list of US holidays before 1983 (thanks to John Orford for the heads-up).
    • Added Christmas Eve to BOVESPA holidays (thanks to Daniel Beren for the heads-up).

    Math

    • Added polynomial and abcd functions.
    • Added Pascal triangle coefficients.
    • Replaced home-grown implementation of incremental statistics with Boost implementation (thanks to Peter Caspers).
    • Added Goldstein line-search method (thanks to Cheng Li).

    New opt-in features

    These features are disabled by default and can be enabled by defining a macro or passing a flag to ./configure. Feedback is appreciated.

    • Added intraday component to dates (thanks to Klaus Spanderen). Date specifications now include hours, minutes, seconds, milliseconds and microseconds. Day counters are aware of the added data and include them in results. The feature can be enabled by uncommenting the QL_HIGH_RESOLUTION_DATE macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-intraday flag to ./configure on other systems.
    • Added thread-safe implementation of the Observer pattern (thanks to Klaus Spanderen). This can be used to avoid crashes when using QuantLib from languages (such as C# or Java) that run a garbage collector in a separate thread. The feature requires Boost 1.58 or later and can be enabled by uncommenting the QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN macro in ql/userconfig.hpp on Visual C++ or by passing the --enable-thread-safe-observer-pattern to ./configure on other systems.
    Source code(tar.gz)
    Source code(zip)
    QuantLib-1.7.tar.gz(8.33 MB)
    QuantLib-1.7.zip(10.66 MB)
    QuantLib-docs-1.7-html.tar.gz(22.63 MB)
  • QuantLib-v1.6.2(Mar 1, 2018)

Owner
Luigi Ballabio
One of the administrators and lead developers of the QuantLib project. Also husband, father of four, ex-physicist, and amateur musician.
Luigi Ballabio
A C library for statistical and scientific computing

Apophenia is an open statistical library for working with data sets and statistical or simulation models. It provides functions on the same level as t

null 186 Sep 11, 2022
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library

Klein ?? ?? Project Site ?? ?? Description Do you need to do any of the following? Quickly? Really quickly even? Projecting points onto lines, lines t

Jeremy Ong 635 Dec 30, 2022
linalg.h is a single header, public domain, short vector math library for C++

linalg.h linalg.h is a single header, public domain, short vector math library for C++. It is inspired by the syntax of popular shading and compute la

Sterling Orsten 758 Jan 7, 2023
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

libtommath This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written en

libtom 543 Dec 27, 2022
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions

linmath.h -- A small library for linear math as required for computer graphics linmath.h provides the most used types required for programming compute

datenwolf 729 Jan 9, 2023
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

OpenBLAS Travis CI: AppVeyor: Drone CI: Introduction OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library based on GotoBLAS2 1.13

Zhang Xianyi 4.9k Jan 5, 2023
A C++ header-only library of statistical distribution functions.

StatsLib StatsLib is a templated C++ library of statistical distribution functions, featuring unique compile-time computing capabilities and seamless

Keith O'Hara 423 Jan 3, 2023
SymEngine is a fast symbolic manipulation library, written in C++

SymEngine SymEngine is a standalone fast C++ symbolic manipulation library. Optional thin wrappers allow usage of the library from other languages, e.

null 926 Dec 24, 2022
nml is a simple matrix and linear algebra library written in standard C.

nml is a simple matrix and linear algebra library written in standard C.

Andrei Ciobanu 45 Dec 9, 2022
RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

Converting ascii text into (floating-point) numeric values is a very common problem. The fast_float header-only C++ library by Daniel Lemire does this very well, and very fast at up to or over to 1 gigabyte per second as described in more detail in a recent arXiv paper.

Dirk Eddelbuettel 18 Nov 15, 2022
📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C

Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C`. cglm provides lot of utils to help math operations to be fast and quick to write. It is community friendly, feel free to bring any issues, bugs you faced.

Recep Aslantas 1.6k Jan 2, 2023
✨sigmatch - Modern C++ 20 Signature Match / Search Library

sigmatch Modern C++ 20 Signature Match / Search Library ✨ Features ?? Header-only, no dependencies, no exceptions. ☕ Compile-time literal signature st

Sprite 55 Dec 27, 2022
C++ library for solving large sparse linear systems with algebraic multigrid method

AMGCL AMGCL is a header-only C++ library for solving large sparse linear systems with algebraic multigrid (AMG) method. AMG is one of the most effecti

Denis Demidov 578 Dec 11, 2022
Header only FFT library

dj_fft: Header-only FFT library Details This repository provides a header-only library to compute fourier transforms in 1D, 2D, and 3D. Its goal is to

Jonathan Dupuy 134 Dec 29, 2022
C++ Mathematical Expression Parsing And Evaluation Library

C++ Mathematical Expression Toolkit Library Documentation Section 00 - Introduction Section 01 - Capabilities Section 02 - Example Expressions

Arash Partow 445 Jan 4, 2023
C++ header-only fixed-point math library

fpm A C++ header-only fixed-point math library. "fpm" stands for "fixed-point math". It is designed to serve as a drop-in replacement for floating-poi

Mike Lankamp 392 Jan 7, 2023
C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates

Libmorton v0.2.7 Libmorton is a C++ header-only library with methods to efficiently encode/decode 64, 32 and 16-bit Morton codes and coordinates, in 2

Jeroen Baert 488 Dec 31, 2022
Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib

matplotlib-cpp Welcome to matplotlib-cpp, possibly the simplest C++ plotting library. It is built to resemble the plotting API used by Matlab and matp

Benno Evers 3.6k Dec 30, 2022
A modern, C++20-native, single-file header-only dense 2D matrix library.

A modern, C++20-native, single-file header-only dense 2D matrix library. Contents Example usage creating matrices basic operations row, col, size, sha

feng wang 62 Dec 17, 2022