Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
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 ...
2
votes
1answer
1k 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 ...
1
vote
1answer
498 views

QuantLibXL swap valuation fixing dates

I'm trying to build a Excel spreadsheet with QuantLib 1.4 for swap valuation of "live" swaps; IRSs with a start date in the past, and an end date in the future. This is what I've got so far... ...
2
votes
0answers
155 views

python and quantlib - setting futures priority

In setting up a curve using deposit rates and futures in python, is there a trigger which allows one to set when the futures start? Looking for something similar to ...
1
vote
2answers
866 views

Install QuantLib on Mac OS X

What is the best way to compile and link QuantLib 1.9 on Mac OS X? I have Xcode installed and understand an #include may work, if create a new QuantLib main(), but never used this IDE before. Can i ...
2
votes
1answer
482 views

QuantLib Gsr model

Almost spent the whole day. Could anyone give a link to the Gsr model specification that is implemented in QuantLib? Or give an explanation? Any help is highly appreciated.
2
votes
2answers
606 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 ...
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%. ...
3
votes
1answer
4k 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 ...
2
votes
1answer
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 ...
4
votes
1answer
444 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 ...
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 ...
3
votes
1answer
3k views

Discounting Curve in Quantlib/Python

I'm using Python 2.7.12 with the QuantLib package. I'm trying to price fixed bonds. I understand how to create a bond object. How to get the "right" discounting curve is kind of a problem. Assuming a ...
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). ...
4
votes
1answer
600 views

How to permanently add holidays to QuantLib calendars?

I am aware of QuantLib's functions addHoliday() and removeHoliday(), but I am wondering if there is a better way to edit the ...
1
vote
1answer
133 views

Quantlib C++: How to output QL_TRACE to a log file

I am trying to output some intermediate variable values in a program using the Quantlib C++ to a text file so that I can try to debug my code to see what's going on, and the way I set up my code is ...
1
vote
1answer
389 views

Would it possible to use quantlib finance library to calculate folowing measures?

I am working on a project which addresses finances and I am curious if I could use qunatlib for it. I have already looked it a documentation about it but since I am definitely not an expert in ...
2
votes
1answer
641 views

Using quantlib to price swaps with different payment and calculation resets for floating leg

I understand the VanillaSwap object assumes that payment and calculation resets are the same, so is there any way we could use quantlib to price a swap with different reset and calculation frequencies?...
1
vote
2answers
483 views

Full value function of an American option with QuantLib FD

I am looking at the Equity Option example of QuantLib: http://quantlib.org/reference/_equity_option_8cpp-example.html and more particularly the FDAmericanEngine. However, I am not interested in the ...
0
votes
1answer
102 views

Premium result with BlackProcess not in line with online engines

I'm trying to implement BlackProcess with Quantlib (in C#) and the result I get for NPV() is not inline with some resources I can find online. Here is my code: ...
1
vote
2answers
241 views

How to install QuantLib with Python SWIG for the first time?

Have just installed Quantlib on Mac now trying SWIG for Python but get below error ...
2
votes
1answer
448 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 ...
1
vote
1answer
610 views

QuantLib FittedBondDiscountCurve fitResults [Error]

I try to use FittedBondDiscountCurve with NelsonSiegelFitting, but I faced with error when call fitResults() method: ...
0
votes
1answer
1k views

Constructing yield curve directly from yield-to-maturity data

I'm trying to use Bloomberg yield-to-maturity data for sets of sovereign bonds of different maturities to fit to a yield curve. I looked into using the QuantLib library (the FittedBondCurve ...
2
votes
1answer
893 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 ...
10
votes
4answers
824 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 ...
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 ...
1
vote
0answers
414 views

FIX engines comparison

Need help, looking for some comparison between c++ FIX engines, like onixs, antenna and some fpga solutions. If anyone has experienced some of the named engines also would like to hear the ...
-1
votes
1answer
83 views

Open source code based on quandl for security analysis and options priming

Quandl seems to be an excellent source of wide range of free/open financial data. But is there an open source code or platform that uses the quandl datasets to perform security analysis and option ...
0
votes
0answers
358 views

Quantlib xll - Converting deposit/swap curve to zero curve

I am trying to create a spreadsheet using the Quantlib xll to convert deposit/swap rates to zero rates. I tried to implement such by referencing to the C++ code listed here: How to sum interest rate ...
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 ...
5
votes
1answer
326 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 ...
3
votes
3answers
1k views

Compiling QuantLib example

I have followed the guidlines for installing QuantLib for mac from here http://quantlib.org/install/macosx.shtml and also fixed the flags using the commands: export CXXFLAGS = -stdlib=libstdc++ ...
1
vote
0answers
114 views

Quantlib binomial tree

I was trying to price options with the extendedBinomialTree class of quantlib. I actually tried at some point to modify this class in order to optimize it. Normally the drift and diffusion of the ...
2
votes
4answers
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. ...
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
632 views

Why QuantLib assumes zero rates to discount factor is continuous?

https://github.com/lballabio/QuantLib/blob/0ec43027834220baf0a554d68de79a159a2c5489/ql/termstructures/yield/zeroyieldstructure.hpp ...
1
vote
1answer
95 views

AmericanOptionImpliedVolatility strange answers for calls IV's

My data provider includes the greeks. I tried to compute the IV's myself using RQuantLib and see if they match -- for Puts it's generally close, for Calls however certain values are way way off -- any ...
0
votes
1answer
2k views

AmericanOptionImpliedVolatility - root not bracketed issue in QuantLib/R

I'm trying to compute an implied volatility -- I am trying to match real data I see in Yahoo finance which shows an IV of about 27%. My call in 'R' for the same params returns a root not bracketed ...
2
votes
1answer
343 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. ...
1
vote
1answer
226 views

QuantLib: New Instrument derived from VanillaOption + PricingEngine that must work for both VanillaOption and the derived class

The derived class is a Vanilla Option on a Future and I need to specify the expiry of the underlying future which is in general different (later) than the expiry of the Vanilla Option. I have ...
2
votes
1answer
360 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 ...
3
votes
1answer
295 views

QuantLib C++: Monte Carlo Engine with SequenceStatistics

I'm trying to implement a Monte Carlo PricingEngine that stores multidimensional statistics. I have done the following: Defined a Monte Carlo Trait that among other things stores as the ...
4
votes
1answer
298 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 ...
11
votes
4answers
3k 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 (...
5
votes
2answers
684 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 ...
1
vote
0answers
168 views

RQuantLib FixedRateBondPriceByYield() Non-tradable error

How do I use FixedRateBondPriceByYield() function on maturity date that is earlier than today? I get "non tradable error" when applying on date older than today. <...
1
vote
1answer
1k 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 : ...
0
votes
1answer
157 views

Binary Option valuation problem in R using RQuantLib; also result validation aspect

When I am trying to value Binary Option using RQuantLib I am not getting all the greeks for exctype "american" wheras "european" exctype is fine. What is the problem here ? ...
3
votes
1answer
604 views

Quantlib FuturesRateHelper triggers not a valid IMM date error

I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve. I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in imm.cpp and ...