Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
962 views

How to use both yield curve and discount curve to value call in QuantLib

I'm new to QuantLib, and I'm trying value a simple European call. QuantLib's Black-Scholes-Merton Process makes sense to me, but I don't know how to incorporate a discount curve into it. Please see ...
  • 123
2 votes
2 answers
1k views

Using the binomial-tree approach to price an option in quantlib - with time expressed as a fraction of year

For learning purpose, I'm trying to price, with quantlib, an European option using the Cox-Ross-Rubinstein tree approach. Some examples are provided in the file ...
  • 2,542
2 votes
4 answers
2k views

Quantlib with python on mac?

Is there anyone who knows a good guide to get quantlib working for python om mac? I have tried to search online and have not found any good guidance. I need to use quantlib for a project on python. ...
  • 427
2 votes
1 answer
2k views

Quantlib bootstraping fails on 5y swap

I'm trying to build a euro swap curve with real up to date data. I should say that examples provided in github work fine. as soon as I add the 5y swap, I got the following error : ...
  • 205
2 votes
1 answer
159 views

Optimize interest rate swap calculations in Monte Carlo Simulation

I’m running a simulation in which I want to calculate the NPV of 100 swaps over 1000 (or even much more) different interest rate curves. It looks like Quantlib is not really fast in performing these ...
  • 325
2 votes
1 answer
521 views

Quantlib: day-by-day evaluation of option value

I'm using Quantlib in Python to price an FX option. I'm comparing the result to Bloomberg, to make sure the code is working correct. I want to calculate the P&L of a certain option trading ...
  • 51
2 votes
1 answer
142 views

Excel PasteSpecial Values shortcut button causing QuantLib to crash

I am experiencing a strange issue with QuantLibXL when I use the quick-access PasteOptions/Values button on the Excel right-click toolbar (apologies for the picture: it is surprisingly hard to capture ...
  • 223
2 votes
1 answer
735 views

Forward bond yield with QuantLib

I'm looking into way to calculate forward bond yield using QuantLib. In Python QuantLib book I see an example for bond futures, where ...
  • 149
2 votes
1 answer
224 views

How many parameters in a discount curve exponential spline fit?

I am investigating the ExponentialSplinesFitting class in QuantLib. I've used this fitting technique using a variety of systems in the past (including by hand!). The form is $$df(t) = \sum_{n=1}^{N}(\...
  • 223
2 votes
2 answers
3k 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 ...
  • 165
2 votes
1 answer
326 views

Quantlib: How to print the maturity dates or pillars from the helpers in Quantlib python?

I am trying to value inflation swaps using necessary functions from quantlib and successfully completed the valuation. Underneath helper function is working well for most of the swaps. But few swaps ...
  • 63
2 votes
1 answer
568 views

Pricing a Forward Rate Agreement using QuantLib Python

Can someone please help with the pricing of the following forward rate agreement using QuantLib Python? A 3x6 forward rate agreement, with a notional of $100,000, the FRA rate being 6%, The FRA ...
2 votes
1 answer
532 views

How to get the price of a bond if the yield is given or viceversa in QuantLib

For example Can u provide with a detailed example please if i have ( maturity, issue date, coupon, frequency, days_countbase, (price or yield) what is the (yield or price given this information. ...
2 votes
1 answer
2k views

Automatic fixing of missing floating rate in QuantLib's addFixing()

Due to the periodic fixing of floating rate bonds's coupon rates, in order to calculate the bond clean price one must tell the pricing engine to account for previous LIBOR rate fixing. If I am right (...
  • 2,066
2 votes
1 answer
84 views

How do you handle non integer time intervals in Quantlib for options pricing (ie intraday pricing)

I'm using QuantLib (python version) for options pricing, and am trying to figure out how to handle non integer dates. If you try and price an option at 9:30 AM and at 4 PM, you should get different ...
  • 123
2 votes
1 answer
483 views

Quantlib Black Model for Commodity Options (Interest Rate Options) is extremely light on gamma and price vs BBG, is model incorrect?

I am using the QuantLib developers example to try and price a TY option. The Delta is pretty close but the price and gamma are way off (almost by a factor of 2). Am I using the model wrong or is the ...
  • 23
2 votes
1 answer
1k views

QuantLib - Calibrating Hull White one-factor on negative interest rates

I have been working with the QuantLib Python package for some days now. Currently, I am working on calibrating a Hull White one-factor model for short rates. I am calibrating the model on the yield-...
2 votes
2 answers
1k views

Best Approach to Creating a USD LIBOR Forward Curve from Market Data

This is a very basic question, I am convinced this has been answered before but I cannot seem to find it. What is the best approach for constructing a USD Libor forward curve from market data? For ...
  • 43
2 votes
1 answer
736 views

Forward Swap Rate calculation using Quantlib

Here, we have an example for the calculation of Forward Swap Rate - How to compute forward swap rates? Below is my Forward Swap - ...
  • 647
2 votes
1 answer
794 views

Pricing Variance Swap [closed]

I want to calculate the NPV of a Variance Swap wherein the cash flow happens every months based on the standard Variance formula of the close prices of S&P500 ...
  • 347
2 votes
1 answer
247 views

Quantlib specify contract duration instead of dates

I use the following code in Python to price American put/call options. It's simple code since I'm new to using Quantlib. I would like to specify the contract duration (i.e. ...
  • 57
2 votes
1 answer
968 views

Quantlib Bond PV01 by Tenor

Having built a fixed rate bond object, and looking at here and here , is there any way of retrieving the NPV impact of a repriced bond by bucket/tenor of the Spot Curve instead of getting a simple NPV ...
  • 33
2 votes
1 answer
1k 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(...
  • 53
2 votes
1 answer
519 views

AUD Forward Rate Agreement and Forward Curve Bootstrapping

The pricing between an Australian Forward-Rate-Agreement is different compared to the US one. The question is whether this is somehow included already in the Quantlib? Also how does it compare to the ...
  • 137
2 votes
1 answer
711 views

Price Barrier Options on Baskets using Quantlib

Is it possible to price barrier options on a basket of stocks using Quantlib, e.g. a Worst-of Down-and-in-Put on a basket of 3 stocks? I already checked the ...
2 votes
1 answer
674 views

How to price touch options using quantlib?

I am new to quantlib and I want use it to to price a touch option (single/double). I searched on google for example code but I could not find anything. Hence, I am ...
  • 123
2 votes
1 answer
731 views

CallableFloatingRateBond in QuantLib: just a matter of multiple inheritance?

I would like to know what are the issues related to a possible CallableFloatingRateBond class in QuantLib and to have some hints on implementation. My (very ...
  • 2,066
2 votes
1 answer
2k views

Setting up Schedule for an amortizing floater in QuantLib

I am unsure as to the exact arguments required for the Schedule function for an amortizing floater - my code is listed below. Specifically, my question pertains to whether the schedule should always ...
  • 121
2 votes
1 answer
341 views

Quantlib HW 1f model calibration not fitting to market normal vol quotes

I am using Quantlib python to calibrate HW 1f model parameters from normal swaption vols quoted in the market (following the code in the cookbook - I fit both the mean-reversion & vol to market ...
  • 141
2 votes
2 answers
724 views

Quantlib: convert par swap rates to zero rates back and forth

I built a zero-coupon curve out of a generic par swap rate curve (Step 1) and I am trying to recover the swap curve back from the zero-coupon curve (Step 2). Step 1 works but not Step 2. I get close ...
2 votes
1 answer
614 views

Heston calibration using Quantlib and Python: failure in BlackVarianceSurface function

I have an error when trying to use the fucntion BlackVarianceSurface from quantlib. Can you help me? the error is RunTime Error: dates must be sorted unique. ...
2 votes
1 answer
569 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 ...
  • 342
2 votes
1 answer
603 views

TOIS (CHF), TONAR (JPY), AONIA(AUD) in Quantlib

I am looking for the TOIS, TONAR, AONIA in Quantlib for discounting. I only could find the EOINA, FEDFUNDS, SONIA etc.Do I miss something? In case they don't exist how can I use the corresponding rate ...
  • 137
2 votes
1 answer
2k views

How to construct interest rate trinomial tree for Hull-White model using QuantLib and Python

I need to construct a Trinomial Tree for Hull-White model. Looking at the docs: http://quantlib.org/reference/modules.html or http://quantlib.org/reference/search.php?query=Trinomial I see many ...
2 votes
1 answer
1k views

Calculating the greeks for Quantlib Python Swaptions

So I have created a Swaption object and can get the premium with the NPV() function. However, I would also like to calculate the greeks (eg. delta, vega). From some searching, I found that vega can ...
  • 21
2 votes
1 answer
453 views

QuantLibXL - Optionlet bootstrapping failure

I am trying to bootstrap the Optionlet volatility surface from a Cap/Floor volatility surface using QuantLibXL. To be specific, the data is from ICAP: ...
  • 231
2 votes
1 answer
624 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 ...
  • 141
2 votes
1 answer
400 views

Fixed rate bond pricing issue in Quantlib

I cannot retrieve the same price for a fixed bond using quantlib. ...
2 votes
1 answer
743 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 ...
  • 21
2 votes
1 answer
1k views

Implementation of the Hull and White short rate model

This is the first time I'm using quantlib, and I wanted to compare the velocity of quantlib with my own Python code. I found a tutorial about Hull and White to generate the short rate paths with ...
2 votes
1 answer
274 views

Bootstrapping spot rates based on swap rates using QuantLib

I am bootstrapping the shibor curve and fr007 curve using swap rates in China. I created my own index like following: ...
2 votes
1 answer
1k 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 ...
  • 81
2 votes
1 answer
106 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=...
  • 21
2 votes
2 answers
2k 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 ...
  • 342
2 votes
1 answer
282 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 ...
  • 153
2 votes
1 answer
980 views

Bootstrapping 3M Curve based on 6M Quotes and Basisswaps 6Mvs3M in Quantlib does not Price to zero

I am trying to understand the rate helper more in detail. In principal I want to build a 3M forward curve based on 6M quotes and 6Mvs3M quotes. The 6M works and prices to 0. I am not sure whether ...
  • 107
2 votes
1 answer
2k views

Calculating market value of a vanilla swap at a later date in QuantLib

I am following the cookbook example for pricing a Vanilla Swap in QuantLib Python, given here. Now let's assume that a week passed, and we are trying to calculate the mark to market value of the ...
2 votes
1 answer
428 views

Debugging Quantlib

I am trying to understand Quantlib's finite-difference pricer using Eclipse with GDB debugger. The code shown below prices an American put option using the Crank-Nicholson finite-difference scheme. ...
  • 203
2 votes
0 answers
101 views

Quantlib vol surface issue 'the black vol surface is not smooth enough'

I create a vol surface from the market and do smoothing(interpolation and extrapolation), and explicitly correct for any total variance decreasing on a given strike as we increase maturity. I create a ...
  • 21
2 votes
0 answers
75 views

QuantLib option.NPV() returns interpolation error

I've been trying to price some barrier options with a Heston model on Quantlib and it works quite well most of the times, but sometimes I get the error: "interpolation range is [3.4314, 4.28384] ...
  • 21

1 2
3
4 5
9