Questions tagged [quantlib]

Quantlib is an open-source C++ library for quantitative finance.

Filter by
Sorted by
Tagged with
26 votes
4 answers
5k views

QuantLib in industry

How much is QuantLib used in industry and how much street cred does it have?
John Smith's user avatar
16 votes
1 answer
2k views

Is QuantLib more trouble than it's worth?

I'm just starting to work with QuantLib and wonder if I'm going down a very wrong path. I'm working on a site that presents the visitor with a table of streamed real-time options data, including ...
Pete Wilson's user avatar
12 votes
5 answers
20k views

How to learn QuantLib-python at first?

In my project, I have to get the delta of up and out call option (with vol surface). I found out that QuantLib might help me on that. Since my main language is python and I don't know well about C++, ...
hopflink's user avatar
  • 233
12 votes
4 answers
5k views

Why does it take so many lines of code to price even the simplest of options with QuantLib

I have been looking at QuantLib I am trying to figure out why I need to write so much boilerplate code even when pricing the "simplest" of European Options using the analytical Black-Scholes formula (...
BigONotation's user avatar
11 votes
1 answer
4k views

How to calculate the local volatility surface using QuantLib?

I'd like to calculate the local volatility surface for a series of option strikes, similar to the surface described in this paper: http://www.ederman.com/new/docs/gs-local_volatility_surface.pdf ...
Contango's user avatar
  • 1,490
10 votes
1 answer
5k views

Mixed local-stochastic volatility model in Quantlib

At a conference the speaker mentioned that it is a standard approach today to use a mix of local and stochastic volatility model in equity, FX and interest rates. Can you please suggest the most ...
opt's user avatar
  • 559
10 votes
4 answers
1k views

How do you check your option calculations?

I'm implementing a bunch of different algorithms to price options/find Greeks: finite difference, Monte Carlo, binomial... I'm not really sure how to check my calculations. I tried using QuantLib to ...
user avatar
9 votes
2 answers
6k views

using quantlib function in my c++ program

I want to include the QuantLib function for option greeks calculations in my own C++ code. My question is: can I just include those functions? I don't want to use the rest of their stuff. I obviously ...
quant_in_making's user avatar
9 votes
3 answers
11k views

What is the best alternative of Quantlib library

We need to build a Fixed Income Portfolio Risk Analytics solution. Somehow due to administrative reason we can't use Quantlib which is written in C++, even call it through SWIG via JNI. We have tried ...
pmr's user avatar
  • 325
9 votes
1 answer
815 views

QuantLib and exact numerical simulation

I've just downloaded quantlib and started playing around with it, and it looks like it's designed primarily to use Euler discretizations for everything -- so far as I can tell, there's not even a ...
user3296's user avatar
  • 278
8 votes
1 answer
4k views

Simple QuantLib Bond Math

I am new to QuantLib and am trying to get it to replicate some simple bond math. Suppose we have a 5-year bond with annual coupon payments of \$5 and face value of \$100, and interest rate of 4%. ...
cpage's user avatar
  • 261
8 votes
1 answer
6k views

Pricing a FixedRateBond in Quantlib: yield vs TermStructure

I am trying to price a simple U.S. treasury in QuantLib, using two methods. The first method calls FixedRatebond.dirtyPrice(...), passing in a YTM and other parameters. The second method involves ...
nickos556's user avatar
  • 193
8 votes
1 answer
6k views

Use QuantLib Python to calculate Swap DV01

I would want to use QuantLib Python to calculate DV01 of an interest rate swap. Initially I was thinking of calculating the fixed leg DV01 and floating leg DV01 separately, then add both legs DV01 ...
lcheng's user avatar
  • 237
8 votes
1 answer
4k views

Issue Using QuantLib and Python to Calculate Price and Greeks for American Option With Discrete Dividends

I am having trouble using QuantLib with Python to calculate American options with discrete dividends. I am using Anaconda, Spyder, Python 3.6, and the most recent version of QuantLib. I created ...
fmc100's user avatar
  • 83
8 votes
0 answers
3k views

Replicating Bloomberg Swap Prices with QuantLib

I'm trying to learn more about the QuantLib python package and as an exercise I'm trying to replicate some swaps on Bloomberg. However, when I do so, it seems like my swaps are consistently ...
K. Mao's user avatar
  • 181
7 votes
3 answers
4k views

VaR implementation using quantlib?

I am thinking of writing a VaR framework for my existing system, using quantlib to do the bulk of the calculations. Despite several searches, I have not as yet come across a quantlib VaR ...
Homunculus Reticulli's user avatar
7 votes
2 answers
1k views

Multithreading Monte-Carlo pricing in QuantLib for a single product

I've been actively using QuantLib for structured product pricing using Monte Carlo. Due to the fact that at a great deal of paths are often needed and one needs to speed up the calculation and all ...
saintb's user avatar
  • 73
7 votes
1 answer
940 views

Definition of gearings, spreads and curve in RQuantLib's Floating Rate Bond function

Consider the RQuantLib package function FloatingRateBond(). This takes as inputs gearings ...
Lisa Ann's user avatar
  • 2,111
7 votes
2 answers
3k views

Use QuantLib Python to calculate roll-down of a swap

I would want to use QuantLib Python to calculate 6-month roll-down of a 5-year swap. I believe that the calculation I need to do is as follows: $Rolldown=r_{0,5Y}-r_{0,4.5Y}$ Where $r_{0,5Y}$ is ...
lcheng's user avatar
  • 237
7 votes
1 answer
3k views

QuantLib: Black / BSM processes and pricing via volatility surface. Different results?

I start this question with a couple of C++ functions that will be useful to show some results. So start your Visual Studio C++ Express or Ceemple or whatever you want and copy & paste this: ...
Lisa Ann's user avatar
  • 2,111
7 votes
1 answer
4k views

What is the best solution to use QuantLib within Excel?

Excel is likely the most widespread instrument across all not-only-quants desks; in addition, we have to keep in mind that Bloomberg and Reuters allow to easily import real time data in Excel, and ...
Lisa Ann's user avatar
  • 2,111
7 votes
1 answer
4k views

Use QuantLib Python to calculate yield curve par rates

I would want to use QuantLib Python to calculate par rates of a swap curve. The following code is what I've done so far: ...
lcheng's user avatar
  • 237
6 votes
2 answers
2k views

What are the best [free]resources to learn C++ particularly for quantitative finance?

What are the best free, online resources to learn C++ for quant finance? The course by quantnet seems too expensive for a broke student like me! If there are any free online resources, let me know! ...
Vishnu Talanki's user avatar
6 votes
2 answers
269 views

Best practice in QuantLib Python to include borrow rate

When pricing a vanilla option, there are at a minimum 3 yield curves to consider: risk free yield curve = YC dividend yield curve = DC (or discrete dividends for American options but not the topic ...
volPMNYC's user avatar
6 votes
1 answer
797 views

OpenGamma's Strata - Computational Overhead

I've been looking at the open-source library Strata (maintained by OpenGamma), which is written in Java. Now, upon inspection of the FX Forward Pricer and Payment Pricer I noticed two things: All ...
Phil-ZXX's user avatar
  • 1,192
6 votes
1 answer
2k views

Pricing Fixed-To-Floater bond in QuantLib

Wandering through QuantLib's Financial instruments documentation, I noticed no class for fixed-to-floater bonds exist. Then I was wondering what a suitable way to price such an instrument would be ...
Lisa Ann's user avatar
  • 2,111
6 votes
2 answers
256 views

Replicating QuantLib plain vanilla Interest Rate Swap valuation

I'm learning QuantLib-Python and trying to replicate an Interest Rate Swap valuation on a custom curve constructed by passing lists of dates and discounting factors. Please see my code below ...
Hasek's user avatar
  • 764
6 votes
1 answer
238 views

BlackProcess' constructor $x_{0}$ argument in QuantLib

I am currently using BlackProcess to price options and I have a doubt related to the $x_{0}$ argument of the constructor: I've figured out it should be the forward ...
Lisa Ann's user avatar
  • 2,111
6 votes
1 answer
378 views

Pricing a bond with variable strike collar with QuantLibXL

I am trying to price a floating rate bond with a capped and floored interest rate. The strikes of the caps and floors vary, but are known in advance. I am trying to do this with QuantLibXL, but I am ...
LCC's user avatar
  • 231
5 votes
4 answers
3k views

How to select the initial guess for implied volatility?

When we calculate the implied volatility, we would need to give the solver a range to start with. For example, QuantLib uses [0,4.0] for the range, which is another way of saying try all possible ...
SmallChess's user avatar
  • 2,255
5 votes
1 answer
8k views

Quantlib python dual curve bootstrapping example

Apologies if this has been asked in the forum (I couldn't find any examples)- Can someone please point me to a worked example in python using Quantlib for dual curve bootstrapping (using EONIA for ...
sumit_uk1's user avatar
  • 141
5 votes
1 answer
4k views

SABR Model Pricing Engine in Python QuantLib

I am looking for a SABR model pricing engine in Python QuantLib setting. I do know that it exists in C++ version, but not sure if available in Python. Any suggestion/feedback with respect to Python ...
Desi_Quant's user avatar
5 votes
1 answer
7k views

How to calculate bond yield in QuantLib - Python

I want to calculate yield of bond having market price and coupons. I try to replicate C++ from (https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/) in Python ...
Kirill Dolmatov's user avatar
5 votes
1 answer
6k views

Quantlib-Python: use zero rates to get the originally bootstrapped curve

Let's say I am trying to build a curve using deposits, future and swaps with one of the three Quantlib methods in Python as below: ...
opt's user avatar
  • 559
5 votes
1 answer
1k views

Bootstrap with QuantLib: Fair Swap or zero NPV

In all brevity What is the termination condition used in QuantLib's curve bootstrapping? Can I modify this setup to my needs, e.g. can I tune this to a higher accuracy? Background When bootstrapping ...
Kermittfrog's user avatar
  • 6,425
5 votes
3 answers
10k views

Pricing a fixed rate bond in Quantlib Python

I'm trying to implement a pricing model for fixed rate bonds with the code below. ...
Gregmf90's user avatar
5 votes
1 answer
657 views

How many ways can QuantLib handle the price of option on its maturity date?

I have been playing with QuantLib for some time. This is a great framework with amazing design and capabilities. However, one thing that I find hard to understand is the way it handles the price of ...
funnycrab's user avatar
  • 108
5 votes
1 answer
2k views

Set-Up OvernightIndex Quantlib

somehow I am struggling on my old question concerning set-up an Overnight index in QuantLib (see question: Old Question). What I don't understand is how can I set-up the ...
JonDoe's user avatar
  • 137
5 votes
1 answer
772 views

Python Quantlib yield curve dates different than input

Thanks very much for your help in advance. I am trying to understand the yield curve construction from Python Quantlib. And it seems I cannot get the curve output the same dates(nodes) as my input ...
user89877's user avatar
5 votes
1 answer
499 views

QuantLib: Is the StochasticProcess class adapt for a HJM type of modelling?

I would like to use the following model in QuantLib: $\frac{dF(t,T)}{F(t,T)} = \sigma_se^{-\beta(T-t)}dW_{t}^{1} + \sigma_L\left(1-e^{-\beta(T-t)}\right)dW_{t}^{2}$ This is a reformulation of the ...
Giancarlo Giuffra's user avatar
5 votes
2 answers
955 views

Are there missing methods in QuantLib python?

I'm reading Introduction to Selected Classes of the QuantLib Library I by Dimitri Reiswich and am trying to "convert" it to Python. It seems to me that some C++ possibilities aren't available in ...
euri10's user avatar
  • 205
4 votes
2 answers
330 views

Calculation of Cashflows Using ISMA Day Count in Fixed-Rate Bond

I'm working with a fixed-rate bond in QuantLib, and I have set the day count convention to ISMA, but I would like to understand how this specific day count convention is used in the calculation of the ...
Roshan Yadav's user avatar
4 votes
1 answer
874 views

Black model: Delta - strike relationship regardless of expiry?

While wandering through some QuantLib experimental classes for FX trading, I've found this Black Delta Calculator. By reading its .cpp, it seems that no use of ...
Lisa Ann's user avatar
  • 2,111
4 votes
1 answer
2k views

How to price a bond at specified dates in QuantLib

I am wondering what's the most efficient way (i.e. the method which involves the fewest arguments) to price a bond at a specified date, e.g. a future date (as instance, 6 months from now) in QuantLib. ...
Lisa Ann's user avatar
  • 2,111
4 votes
1 answer
2k views

QuantLib Python: caplet/swaption pricing under dual curve

Is there a way to price caplets/swaptions in QuantLib python (v 1.6.2) under dual curve i.e. pass projection curve for forwards and discounting curve for discounting the cash flows? Goutham has an ...
InnocentR's user avatar
  • 692
4 votes
1 answer
2k views

Why is there a difference in American option prices when comparing pricing methods (Python)?

I have written a Python script to price American options using Least Squares Monte Carlo and added a QuantLib implementation below (analytical/binomial/finite difference) to compare. The problem is ...
AlexAbrahams's user avatar
4 votes
2 answers
3k views

Swap Bootstrapping with quantlib

I've been trying to get the zero rates of the Chilean Swap curve with Quantlib in Python, but I haven't been able to set up the parameters correctly. This is my code: ...
Jose Pedro Melo's user avatar
4 votes
1 answer
2k views

How to manage evaluation date changes in QuantLib while using ImpliedTermStructure Class

I will not attach the whole code 'cause it would be just a huge waste of space and it would be not useful for this question's purpose. What I am going to attach here is a snippet code and its output, ...
Lisa Ann's user avatar
  • 2,111
4 votes
1 answer
332 views

Yield curve bootstrapping not producing expected cash flow start date

I'm currently working on building a yield curve using OIS swaps. However, I'm encountering an issue with the cash flow start date that I'm struggling to understand. Here's a simplified version of my ...
TourEiffel's user avatar
4 votes
2 answers
1k views

Valuing structured loans in QuantLib

I'm trying to figure out if it's possible to value structured products, mainly loans, in quantlib. The idea is to build a bond class with different cash flows. For example, a loan could have coupons ...
Jose Pedro Melo's user avatar

1
2 3 4 5
10