Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quantlib]

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

1
vote
0answers
25 views

How to apply multiplicative price seasonality to bond prices in quantlib?

Can someone please give a brief or any link which explains how to apply multiplicative price seasonality to inflation linked bonds in Quantlib using python modules. Have gone through most of the ...
0
votes
0answers
34 views

Pricing American Calls with Discrete Dividends using QuantLib's FDDividendAmericanEngine

When pricing an American Call on Siemens with Discrete Dividends in Reuter's OPR, I get an theoretical value of 11.428 EUR (Binomial, see pic) and 9.836 EUR (Whaley): When simulating these results ...
3
votes
0answers
56 views

How to calculate YTW (yield-to-worst) in QuantLib?

After defining a CallableFixedRateBond object in QuantLib, I can calculate YTM (yield-to-maturity) right now. I'm using Python so the function is bondYield(). Is there any way to calculate YTW (yield-...
1
vote
0answers
17 views

How do I calculate from discountfactor to zerorate in Python using Quantlib [closed]

I knew rate to discountfactor InterestRate.discountFactor(yearFraction) I want to calculation discountfactor to zerorate
1
vote
0answers
56 views

How to build an inflation term structure in QuantLib?

This is what I've got, but I'm getting weird results. Can you spot an error?: ...
2
votes
1answer
120 views

Quantlib CDS model

I have started working on CDS model using Quantlib and as a starting point, utilized code provided in GitHub Quantlib/Python examples with modifications in initial code as given at the end and have ...
1
vote
0answers
23 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. ...
2
votes
0answers
30 views

QuantLib XL Swap Valuation Fixing Dates

I want to rate IRS Swaps on an specific Valuation Date using QuantLibXL. Everything works fine besides the last Index Fixing before the Val Date. After using SwapLegAnalysis I saw that the Index ...
1
vote
1answer
103 views

How to compute the Carry + Roll-down of a bond with QuantLib?

I’m new using QuantLib (I have no idea how to use it) and I would like to know how to calculate the C+R of a bond, say the current 30Y. The textbook definition of C+R is the P&L due to the ...
1
vote
0answers
32 views

Calculating YTM, OAS, etc. in QuantLib with given bond price [duplicate]

I am attempting to use QuantLib to calculate several bond metrics such as yield to maturity, option-adjusted spread, etc. The catch is that I am already given a market price and thus have no need to ...
1
vote
0answers
86 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 ...
0
votes
2answers
156 views

CDS ISDA model/Bloomberg

I am becoming more acquainted with QuantLib as a platform. I've been using both the python implementation and QuantLib XL. As I have started to look at CDS, I would like to know if there is a ...
2
votes
1answer
253 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: ...
1
vote
1answer
31 views

Calculating QuantLib IborCoupon with / from given index fixing

How can I calc with QuantLib the coupon amount of a floating rate IborCoupon on the 3M Euribor Index with a given 3M Euribor Index Fixing? If I try the following Python code: ...
0
votes
0answers
26 views

QuantLib - Discreet Dividend Binomial Two Rate Option Implementation

Can anyone point me in the direction of an implementation example in python of a two rate, discreet dividend binomial option model?
2
votes
0answers
183 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 ...
0
votes
1answer
145 views

Basic fixed rate bond pricing issue in Quantlib

I'm trying to price a fixed rate bond in Quantlib but the result comes out wrong. I'm trying to price 1Y fixed rate bond: ...
1
vote
0answers
107 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 ...
0
votes
0answers
44 views

QuantLib FuturesRateHelper how do I input Future type = 'ASX', the 'IMM' date check is causing Runtime Error

How do I input Future type = 'ASX', the 'IMM' date check is causing Runtime Error future_maturities 1 2019-06-14 2 2019-09-13 3 2019-12-13 4 2020-03-13 5 2020-06-12 6 2020-09-11 ...
3
votes
1answer
72 views

forward + displacement

I I am trying to price a cap/floor using Quantlib in Python. the initial code from from this website: http://gouthamanbalaraman.com/blog/interest-rate-cap-floor-valuation-quantlib-python.html Here is ...
1
vote
0answers
52 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: ...
1
vote
0answers
67 views

QuantLibXL no intraday pricing, even with QL_HIGH_RESOLUTION_DATE enabled while compiling

I built QuantLibXL myself following the instruction here: https://www.quantlib.org/quantlibaddin/build_qlxl.html And in the QuantLib code, I turned on the QL_HIGH_RESOLUTION_DATE flag, before I run ...
2
votes
1answer
105 views

QuantLib CDS pricing error: negative time given

I am new to QuantLib, and I am using it to price CDS. Following is my python code: ...
2
votes
0answers
43 views

SquareRootProcess in QuantLib - Python

I would like to price an American put option using the SquareRootProcess class in QuantLib - Python but it seems that it does not exist. As the underlying follows the following model : $$\rm{d}S_t=...
3
votes
1answer
77 views

Why Quantlib Option NPV does not change when repricing?

Trying to learn Quantlib with Python, please have a look at below code: ...
2
votes
0answers
71 views

QuantLib - Synthetic deposit/FRA rates in yield curve

In my flat forwards dollar curve implemented in QuantLib I would like to add the following instrument: Today is 12/28/2018 Pillar quote is 1% p.a. (ACT/360) Pillar start is 1/30/2019 (specific ...
3
votes
1answer
190 views

QuantLib: BondFunctions.zSpread does not match clean price “exactly”

I am using QuantLib to compute prices of fixed rate bonds in different scenarios. In the first step I would like to replicate the current market price by adjusting the yield curve with the zspread. ...
2
votes
1answer
116 views

TermStructure/Evaluation Dates in Quantlib

i'm puzzled by the way Quantlib handles the evaluation date in the yield term structure classes. I have the following code as example: ...
-1
votes
1answer
309 views

How to use QuantLib in C# easily?

I am not good at environment setting. Sometimes I use QuantLib in Python. Now I am wondering if there is a instruction on how to use QuantLib in C#. I looked at the QuantLib web page, but there is not ...
0
votes
1answer
203 views

Structured Payoff Scripting in QuantLib

I'm trying to price a snowball payoff in quantlib and would like to create a payoff like: $$Coupon = PreviousCoupon + FloorPayoff$$ Would the payoff class be able to reference the previous coupon? ...
0
votes
1answer
79 views

how to change the value set by the addFixing method in QuantLib

Suppose we have had constructed an index for forecasting future interests of a floating bond, and as suggested by the official document, I used addFixing method to set a past fixing for the current ...
1
vote
1answer
132 views

Swing option pricing in QuantLib-Python

Is it possible to use the QuantLib python wrapper to price swing options? I've seen the QuantLib Github repository contains a C++ implementation, swingoption.cpp, but have found no reference to swing ...
2
votes
0answers
235 views

Calculate tenor wise DV01 of a Swap in Quantlib Python, i.e. Key-rate Duration

Is there a way I can get DV01 breakup of a Swap across different tenors of the deal in Quantlib-Python. The question asked here, follows the basic method of re-valuing the swap by shifting the curve ...
3
votes
1answer
382 views

Quantlib derivative valuation from zero curve

I have newly started with Quantlib-Python for valuing derivatives. In all the examples stated in this bolg or in other places, market quote is inserted and bootstrapping is done via individual rate ...
3
votes
1answer
180 views

QuantLib in Python : Execution time with OISRateHelper compared to Swap/Deposit RateHelper

I have been working on valuation of interest rate swaps using dual curve bootstrapping. And for this I use OISRateHelper to create a discount term structure using OIS rates. The entire code below : <...
5
votes
1answer
191 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 ...
0
votes
0answers
44 views

How can I use advance(startDate,…) or another RQuantLib function to invert yearFraction(startDate, endDate, …)?

I am using RQuantLib. I would like to convert back and forth (accurately) between a future date and a year fraction from a reference date. But I have been unable to convert reliably between the output ...
1
vote
2answers
245 views

How to change the YieldTermStructureHandle's referenceDate in QuantLib

Suppose we have already known the dates and rates of a spot rate curve, and I passed the data to the ZeroCurve class to construct a discount curve for bond pricing. What I wanna find is how to change ...
2
votes
2answers
351 views

QuantLib-Python: How to set fixed reference dates when bootstrapping the term structure?

I am borrowing from an example in the "Quantlib Python Cookbook" section 7, to ask my question. To make the point as clear as possible I simplify the code a bit. The aim is to strip the EONIA curve ...
1
vote
1answer
193 views

Using DayCounter ActualActual.ISMA in QuantLib

Suppose we have a semiannual coupon bond. The calculation date is 5/8 2017. The ex-coupon date is 4/20 2017 and next coupon date is 10/20 2017. ...
2
votes
1answer
223 views

QuantLib-Python: What is “index = Euribor1Y(term_structure)” doing?

I am currently reading thorugh the QuantLib-Python cookbook to learn about this nice pice of software. On page 141 I encountered a block of code that made me wonder what it is exactly doing. The code ...
2
votes
1answer
128 views

Quantlib - model changes in option value on day of expiry

I'm trying to model option value changes during the progression of the last trading day before expiry. All option pricing Quantlib examples that I've seen work with day-level granularity. I'm ...
1
vote
1answer
478 views

Pricing fixed coupon bond with ytm in QuantLib python

I'm new to QuantLib and I'm confused about ZeroCurve in YieldTermStructureHandle The start date is Oct 20, 2001. Assuming the ...
2
votes
1answer
143 views

QuantLib-Python: Splitting the NPV of an option into intrinsic & time

I am right now working throught the "cookbook" of Goutham Balaraman & Luigi Ballabio. By the way a very nice introduction into QuantLib-Python and a good starting point :-) In section four there ...
1
vote
1answer
499 views

QuantLib-Python: Getting a list of all holidays between D1 & D2 with function “holidayList”

I figured out that the C++ version of QuantLib offers a function called holidayList in the calendar class. ...
0
votes
0answers
73 views

Different scaling conventions for greeks

I have been following this tutorial (http://gouthamanbalaraman.com/blog/value-options-commodity-futures-black-formula-quantlib-python.html). It says in the conclusion and I quote:It is worth pointing ...
2
votes
1answer
184 views

Why we should specify the evaluation date when using Quantlib yield curve? And why updating the evaluation Date is time consuming

I was runing some tests using the yield curve structure in quantlib mainly: PiecewiseYieldCurve It seems that I have to fix the evaluation date using such a line : Settings::instance().evaluationDate(...
2
votes
1answer
98 views

QuantLib: How to change polynomial order in MCAmericanBasketEngine?

My goal is to price American basket put options using the Least squares Monte Carlo, or Longstaff-Schwartz algorithm. I currently have the one-dimensional case working with the Python file below (I ...
-1
votes
1answer
113 views

Quantlib interpolation question

I am trying to use QuantLib to create some curves, but I am finding this error I do not really know how to get around. Say for simplicity this is the example: ...
1
vote
0answers
77 views

How to debug Example_1 of the Open Risk Engine (ORE) library?

Following the manual, I have built an Open Risk Engine library and I would like to learn the library by modifying examples that come together with the library. Question: How to run, for instance, <...