Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
152 views

Question regarding fitting Euribor curve using different basis quotes using Quantlib Python

I am trying to fit a EUR curve based on the following instruments:- EONIA quotes 1m vs 6m basis quotes 3m (outright) quotes 6m (outright) quotes 6m vs 12m quotes (1) , (3) & (4) are simply ...
1
vote
2answers
410 views

In quantlib (python), is there a way to specify settlementdays for a swapratehelper without having to also give discountCurve?

Using the following Python code I am setting USD LIBOR Swap quotes. I found that by default settlementdays uses whatever is associated with the Index (in C++: ...
0
votes
2answers
30 views

Value a Swap with Custom Coupons with QuantLib

I'd like to valuate a custom Libor3M - Fix swap with QuantLib in Python. With custom I mean, custom starting/end/payment dates for every coupon, a fixed coupon in the float leg (starting_date < ...
0
votes
0answers
18 views

Quantlib-SWIG Python: impliedHazardRate requires “warm” discountcurve

I am getting different results from the CreditDefaultSwap().impliedHazardRate() method, depending on whether the discount curve passed is "cold" i.e. just created ...
0
votes
0answers
16 views

Swaptions vols,object using quantlib xl

How can I build a good vol surface using QuantlibXl? My goal is to price a swaption 5 year with option maturity 1Y1M. The data are:
0
votes
1answer
76 views

Heston volatility surface in Python QuantLib

Does anyone have experience with the Python QuantLib function HestonBlackVolSurface? I'm trying to produce a 3D plot of the volatility surface as done in the ...
0
votes
1answer
14 views

Which object in DateGeneration object when there are two short, long or combination in Schedule object for py QuantLib?

I'm pricing a vanilla swap. I have two stubs, front and back, and they can be short, long or a combination. In this case, what do I use in ql.Schedule object for <...
0
votes
1answer
15 views

Valuating Custom Amortization Schedule Libor IRS with QuantLib

I got to bootstrap the OIS and Libor 3M swap curves, and now I'd like to valuate some simple Libor3M - Fix IRS with QuantLib (in python). My problem is that some of the instruments I have to valuate ...
0
votes
1answer
15 views

How to make the effective date to start on a holiday/weekend in py QuantLib?

I'm trying to price a non-standard swap. However, my schedule is not returning the correct dates. In particular, the effective date starts on a Saturday but the schedule returns the next biz date ...
3
votes
3answers
5k 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. ...
1
vote
1answer
41 views

How can I extract the strike price from a Quantlib option object?

I am trying to write a Python function that performs some calculations using a list of Quantlib options, and I would like to pass only that list without other information. In particular, the strike of ...
0
votes
0answers
34 views

Digital Caps/Floors in Quantlib Python

Am I missing something or is there currently no way to price digital libor Caps/Floors in Quantlib Python? It seems there's no mention of DigitalIborCoupon in the cashflows SWIG interface.
0
votes
1answer
77 views

Monotonic Cubic Spline interpolation QuantLib python

I am new to QuantLib-Python and I am trying to replicate the implementation of a Dual Curve bootstrap using QuantLib-Python. I have followed the steps in Chapter 9 of the QuantLib Python Cookbook. ...
0
votes
1answer
56 views

Bootstrapping the 6m Sterling Libor curve

I am trying to bootstrap the 6m sterling swap curve using the depos and swap rates codes are below. I am a newbie and have been following (or at least trying to!) the python cookbook. I wanted to know ...
0
votes
1answer
30 views

Removing/Purging QuantLib/Boost

I recently updated to Ubuntu 20.04, as well as to R v4. When updating packages, I ran into an issue with QuantLib. I tried removing/reinstalling, but the reinstall was a different version. RQuantLib ...
1
vote
1answer
51 views

QuantLib 1.17 C++ does not contain some YieldTermStructure classes while QuantLib-Swig contains

I want to port some QuantLib-Swig dependent code written in Python to C++ with QuanLib-1.17. However some YieldTermStructure classes (PiecewiseLogCubicDiscount, PiecewiseLinearZero and ...
2
votes
1answer
262 views

Roll Down of Forward Starting Interest Rate Swap

I have the data for a lot of forwarding starting interest rate swaps. i.e 2Y1Y, 3Y1Y, 5Y1Y, 3Y2Y, 5Y2Y, ... (so different forwarding and maturities). I would like to calculate the roll down over 1 ...
1
vote
0answers
41 views

How to use quantlib Excel for valuation of european swaption with vol surface to calibrate?

I would like to replicate the following Bloomberg pricer in quantlib using Quantlib xl. Is it possible? Thanks
0
votes
0answers
20 views

Missing functions in QuantLibXL

I have been using the open source addin QuantLibXL extensively. This provides an easy way to use the QuantLib library in a simple Excel environment. However, there are a few of the more recent ...
1
vote
0answers
29 views

monotone convex interpolation using QuantLib

I have one yield curves for EUR6M and I want to produce EUR3M using a parallel shift to EUR6M curve. I can just add spread in 6M curve. I am facing problem that my EUR3M curve will have many more ...
1
vote
0answers
30 views

Quantlib ZeroCurve interpolation

I'd like to check how QuantLib does interpolation on rates if I use ZeroCurve constructor. As it was mentioned here, by using curve.nodes() you can get a list of ...
1
vote
2answers
67 views

QuantLib : How to get the 'last' and 'next' cash flow date and amount from the date of valuation in plain vanilla interest rate swap in Python?

Do we have any direct method to get the 'last' and 'next' cash flow date and amount from the date of valuation in Quantlib Python using fixed leg amt or floating leg amt, day counter,valuation date , ...
0
votes
1answer
32 views

Pricing Compound Options using QuantLib

I am trying to price Compound Options using QuantLib on Python. I've looked around but am unable to find any sample code. I believe that the CompoundOption Class ...
1
vote
1answer
67 views

How do I create a term structure of a bond using QuantLib?

Has anyone used QuantLib to create term structure (i.e bootstrapping process to produce spots) in python? I have been using the below example http://gouthamanbalaraman.com/blog/quantlib-term-structure-...
0
votes
0answers
44 views

Quantlib : How does interpolation technique in zero curve improve the valuation of interest rate swaps?

I am working on building zero curve using interpolation = ql.Linear(). I know that this method is very popular to build short and long end curve. But am wondering if there is any another way of ...
0
votes
1answer
61 views

Zero Curve from a par curve curve QuantLib

I'm trying to understand why pricing a par bond with zero curve, contracted from par bonds themselves doesn't give me par. (Based on examples here) ...
3
votes
1answer
78 views

Quantlib - exercise probability function?

I am using Quantlib to obtain the option value embedded in a convertible bond. I create an american option as follows: ...
3
votes
1answer
685 views

Using QuantLib Python to value FX options using stochastic volatility

I would like to use QuantLib (and in particular the python wrapper) to value FX option using the Heston model. Thanks to http://gouthamanbalaraman.com and all of the articles therein : in particular ...
1
vote
1answer
65 views

Interpolation for discount curve building QuantLib for bonds

I'm trying to figure out how to build a discount curve to price bonds from spot rates using some advance interpolation methods like PiecewiseLogCubicDiscount. I know I can build this curve with ...
1
vote
1answer
127 views

Using Discount Rates and Zero rate curve from Bloomberg in Quantlib

I'd like to use the Discount Rates and Zero rate curve from Bloomberg instead of deriving the rates from the yield curve. Can someone share a sample code to use these rates directly in VanillaSwap or ...
0
votes
1answer
43 views

How to use QuantLib.IborIndex in python?

QuantLib users. I'm trying to use ql.IborIndex(...) using this example but for USD currency. However, I receive a type error of the following. How can I use this ...
0
votes
1answer
48 views

How to use G2Process in Py QuantLib

I'm trying to do MC using G2Process object. The example I'm trying to mimic is in this link. Below is a code snippet of what I did. Please will someone guide me on ...
11
votes
5answers
13k 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++, ...
0
votes
0answers
55 views

QuantLib (Python) Heston model delta

is it possible to obtain the delta for Heston model with QuantLib-python? I am using AnalyticHestonEngine and simple European option/payoff. I am aware of the possibility of calculating numerical ...
0
votes
1answer
67 views

Zero Rates to Piecewise linear forward rates in Py QuantLib

How can I extract the piecewise linear forward rates given a term structure of zero rates for a given trade date in Py QuantLib. This is used to price an ir swap. My attempt is to create a ZeroCurve ...
5
votes
4answers
2k 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 ...
1
vote
1answer
131 views

QuantLib - Asset Swap Cash Flow Final Period

I am comparing CFs of asset swaps in QuantLib to the asset swap screen (ASW) in Bloomberg. I noticed that the final payments of both swap legs do not include an interest payment for the final period. ...
0
votes
1answer
162 views

Python Quantlib : How to value the Non Deliverable currency Interest Rate Swaps?

I followed all the procedure in Quantlib to process interest rate swap valuation through Python Quantlib. I valued more than a million records. All the valuation is almost the expected amount. But '...
1
vote
1answer
106 views

Error in QuantLib-Python when I use function “Bond”

I am using the "Bond" function in QuantLib-Python 1.14. I am planning to use it in this way: ...
0
votes
1answer
61 views

QuantLib Error “=negative probability”

I am trying to calculate the price of an american option. The code works fine for some options but for an deep out of the money call, I get the above error. Below is my code that I am trying to run. ...
0
votes
1answer
125 views

Quantlib InterpolatedDiscountCurve zero forward-rate at endpoint

I use QuantLib Python to calibrate a curve based on interpolated discount factors (https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/discountcurve.i). Using LogLinear interpolation on ...
0
votes
0answers
22 views

Why Quantlib CreditDefaultSwap::ISDA fail on roll dates: 1st iteration: failed at 1st alive instrument, pillar

I am experimenting with Quantlib CDS engine, I create a piecwise hzard rate based on CDSHelpers and try to compute default probability with it and then some specific upfront. I managed to match BBG ...
1
vote
1answer
765 views

Calibration of Theta, A(t) and B(t) of Hull White 1Factor model

I’m simulating interest rates via the HullWhite One factor model. To simulate the short rate I’m using the code from the Quantlib Python Cookbook, chapter 15 and beyond (By Goutham Balaraman and Luigi ...
1
vote
1answer
152 views

QuantLib returns slightly different bondYield when backtested

I am just starting to get familiar with QuantLib (in particular, fixed rate bond pricing functions). I read a number of examples, from which I am able to calculate bond price and bond yield. The ...
0
votes
0answers
61 views

Quantlib - Duration of a Floating Rate Bond with Spread

I've used Luigi Ballabio's workaround to calculate the duration/modified duration of a floating rate bond (which you can find here: https://www.youtube.com/watch?v=r_1wSd0hnN4). However, if I add a ...
0
votes
1answer
44 views

Why does changing the evaluationDate multiple times lead to a performance lag?

I am simulating an swaption strategy through time. Following the examples in the Python Quantlib cookbook, as I progress through time I am updating the internal evaluation date ...
0
votes
1answer
109 views

Constructing Daily Term Structure

I am very new to QuantLib and am trying to do Swaption Model calibration following the example here:http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html Appreciate ...

1
2 3 4 5