Quick answer
QuantLib is the leading open-source library for quantitative finance, written in C++ with Python bindings (pip install QuantLib). It prices and risk-manages options (Black-Scholes, Heston, binomial, Monte Carlo), bonds, swaps and other derivatives, and bootstraps yield curves with full day-count and calendar handling.
QuantLib at a glance
- Category
- C#, Java & C++ frameworks
- Language
- C++, Python
- License
- BSD-3-Clause (modified)
- Does
- Performance analytics
- Markets
- Options, Bonds, Futures
- Best for
- Options and fixed-income strategies that need correct pricing and greeks.
- In AlgoGP
- Use the exported strategy object from your own code
Pick it if
Options and fixed-income strategies that need correct pricing and greeks.
Watch out for
Large, verbose API.
QuantLib strengths and limitations
Strengths
- Industry-standard models and conventions.
- Mature and widely used.
- Python bindings via SWIG.
Limitations
- Large, verbose API.
- No backtesting or execution.
QuantLib example
pip install QuantLibimport QuantLib as ql
today = ql.Date(20, 11, 2026); ql.Settings.instance().evaluationDate = today
option = ql.EuropeanOption(ql.PlainVanillaPayoff(ql.Option.Call, 100), ql.EuropeanExercise(ql.Date(20, 11, 2027)))
spot = ql.QuoteHandle(ql.SimpleQuote(100))
rate = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.04, ql.Actual365Fixed()))
vol = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(today, ql.TARGET(), 0.2, ql.Actual365Fixed()))
option.setPricingEngine(ql.AnalyticEuropeanEngine(ql.BlackScholesProcess(spot, rate, vol)))
print(option.NPV())Use QuantLib with AlgoGP
AlgoGP does not add QuantLib to projects automatically yet, but nothing stops you using them together. Every AlgoGP project exports plain Python with a framework-neutral strategy object, so you can call it from QuantLib yourself.
- 1
Design and backtest in AlgoGP
Describe the idea to the copilot and backtest it on AlgoGP’s normalized history.
- 2
Add any bridge to get the adapter core
Adding a bridged framework (for example Backtrader) writes
frameworks/algogp_bridge.py, whoseStrategyBridge.on_bar()returns the orders the strategy wants. - 3
Call it from QuantLib
Feed QuantLib’s bars to
StrategyBridge, place the returned orders with QuantLib, and report fills back withsync().
QuantLib: frequently asked questions
Can QuantLib backtest options strategies?
It prices them; combine it with historical data (e.g. ThetaData or ORATS) and a backtester.
QuantLib alternatives
- TA-LibC, PythonThe standard C library of 150+ technical indicators and candlestick patterns, used from Python through the TA-Lib wrapper.
- Riskfolio-LibPythonAdvanced portfolio optimization on CVXPY: 20+ risk measures (CVaR, CDaR, EVaR), risk parity, HRP/HERC and constraints, with rich plots.
- QuantConnect LEANC#, PythonThe open-source engine behind QuantConnect: event-driven backtesting and live trading in C# or Python across equities, options, futures, FX and crypto.
- StockSharpC#C#/.NET trading platform and libraries: strategy designer, backtester and connectors to dozens of brokers, exchanges and crypto venues.
Independent guide. AlgoGP is not affiliated with QuantLib. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.