Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
3
votes
3answers
5k views

How to build a cross currency swap pricer?

We're looking to build a pricer to convert a funding spread in a given currency over a specific funding basis e.g. 20 bps EUR 3m€ and convert it to a funding spread to a different currency with a ...
3
votes
2answers
2k views

Excel YIELD function equivalent in python Quantlib

I am struggling to get an equivalent of Excel's YIELD function using Quantlib in python. As you can see from the Excel documentation on YIELD here, only a few parameters are needed compared to this ...
10
votes
4answers
822 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 ...
8
votes
1answer
2k 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%. ...
6
votes
1answer
3k 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 ...
0
votes
1answer
1k views

QuantLib Python price same swap on different evaluation dates

I want to use QuantLib Python to price a swap at 2 different evaluation dates during the life time of the swap. The following is what I've tried so far: ...
4
votes
1answer
4k views

QuantLib Python Swap Yield Curve Bootstrapping Dates and Maturities

This is somewhat related to the question I asked here but simpler. I am trying to bootstrap a yield curve from swaps, and am having a problem with the dates/maturities that are coming out. The code ...
4
votes
2answers
2k 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: ...
4
votes
1answer
561 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 ...
2
votes
1answer
299 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 ...
3
votes
1answer
601 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
4k 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 ...
2
votes
1answer
159 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
vote
1answer
1k views

Calculating Discount Margin on a floating rate bond using QuantLib

Going off Luigi's hint on this answer: Setting up Schedule for an amortizing floater in QuantLib I was able to cobble something together but I'm unable to verify if it's correct. TLDR: I was able to ...
3
votes
1answer
2k views

How to sum interest rate curves in QuantLib

C++ code taken from Bonds.cpp and slightly amended: ...
3
votes
1answer
228 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 ...
2
votes
1answer
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 ...
2
votes
1answer
444 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(...
0
votes
1answer
939 views

QL-Python Bootstrapping Yield Curve FuturesRateHelper throwing off results

I'm trying to perform a bootstrap of a yield curve from deposit rates, futures, and swaps, and the interpolation is "blowing up" for the futures maturities being off by two orders of magnitude (100x). ...