Tag Info

Hot answers tagged

14

Based on anecdata (conversations with other quants), not much. Banks develop their own models and if they do outsource the effort, they pay someone for the code + support (there are companies like Numerix or Pricing Partners which do that). QuantLib is criticized for being poorly documented and convoluted. My own observation is that the parts of QuantLib I ...


12

This is off-topic and maybe belongs to StackOverflow, but here goes. 1. Compile QuantLib The best way is to open the Visual Studio Command Prompt using a shortcut under Programs→Microsoft Visual Studio→Visual Studio Tools. Now, you need to navigate to the QuantLib folder inside the folder where you have QuantLib (there are other folders such as ...


12

It's a very good and useful question. And it is bloody hard to answer just like many other questions relating to the proprietary nature of how banks and funds implement their core technology. A better route may be to ask on the QL lists, and/or to inquire as to who actually attented the first Quantlib forum in London last month. Another route would be to ...


11

Well, actually it's designed to use whatever discretization you throw at it---but for the time being only Euler discretization is implemented, mostly for lack of time or interest on the part of contributors. If you want to use exact numerics with a process, you can just code the corresponding discretization class (you'll have to inherit from ...


7

Assuming you're referring to the local-volatility class implemented in <QuantLib/ql/termstructures/volatility/equityfx/localvolsurface.hpp>, it's among the several classes that are not exported through SWIG. You'll have to add it to the SWIG interface files (probably in volatilities.i), regenerate the wrappers and recompile them. If you need ...


7

How at ease are you with programming, dynamic linking, Makefiles and the rest? In essence, there is no magic here. QL has a very liberal license, and you "merely" have to set up your project such that it finds the quantlib headers (and hence Boost headers) during compilation the quantlib library during linking and both of those can be automated by ...


6

I'm familiar with the library, but not with the way it is exported to R. Anyway: gearings are optional multipliers of the LIBOR fixing (some bonds might pay, for instance, 0.8 times the LIBOR) and spreads are the added spreads. In your case, the gearing is 1 and the spread is 0.0140 (that is, 140 bps; rates and spread must be expressed in decimal form). ...


6

There's no class at this time to add two curves as you want, but it won't be much difficult to write it. The closest you'll get in the library is the ZeroSpreadedTermStructure class, that shows the general idea: it inherits from YieldTermStructure (by way of ZeroYieldStructure) takes a YieldTermStructure and a spread (constant, in this case) and override ...


6

Day-count conventions. You can't live with them, you can't live without them. The reason the prices differ is that the pricing engine can't calculate correctly the time over which the first coupon is discounted, and thus it gets slightly different discount factors to apply to the coupon amounts. Please sit down, it'll take some explaining. Ultimately, both ...


5

Ok, I've done some digging in the code. It's an issue with the LogLinear interpolation; while trying to find the correct rate for the 1-week node, the bootstrapper wanders unchecked into a region of negative rates and the logarithms blow up. At this time, I'm afraid the workaround is just to use some other interpolation. Or recompile the library and the ...


5

Numerical methods are only approximations. So binomial trees, Monte Carlo simulations, and finite difference methods should all produce different numbers. As for whether you should install it for your customers, that can only be answered by what you think your customers want. Do retail customers really want the potential confusion? Are they going to ...


4

I believe it's correct. However, consider that it would be easy enough, and more clear, to create a new class (at least in C++; the task is more difficult if you also want to export it to Excel). The new instrument should only inherit from Bond and implement a constructor that builds the desired cash flows via a call to FixedLeg and another to IborLeg; you ...


4

I'm guessing you're simulating rate curves etc. inside your system, and you want to reprice your instruments over the simulated curves using QuantLib. In this case, most of the logic is in your system already, and you have to plug pricing functionality in. If so, I don't think there's many steps involved besides, well, pricing the instrument on the ...


4

The formally supported way of adding extensions to QuantLib is by means of the Swig extension 'system' / library / tool. And the Swig site's page on compatibility has this to about Javascript: There is also SwigJS, a JavaScript module for SWIG so you could to familiarize yourself with a) how Swig works in the context of QuantLib and b) if/how you can ...


4

It's because of the settlement days you passed when you initialized the flat volatility curve. You're creating the spot, forward and flat volatilities as: boost::shared_ptr<BlackVarianceSurface> volatilitySurface( new BlackVarianceSurface(todaysDate, calendar, maturityArray, strikeArray, ...


4

There are two different issues at play here. One is that, of course, you want only the future cash flows to enter the calculation. This is taken care when you set the evaluation date to 6 months from today. In C++, you would say Settings::instance().evaluationDate() = today + 6*Months; I don't remember the corresponding function in QuantLibXL, but you ...


3

Answering my own question: use qlFloatingRateBond and pass it a range of strikes (one for each coupon) for both Caps and Floors arguments use BondEngine as pricing engine use IborCouponPricer with Type argument equal to "IborByBlack" as coupon pricer - This pricer also takes an OptionletVolatilitySurface as input the OptionletVolatilitySurface can be ...


3

It's hard to be sure without seeing the inputs, but I'm guessing that the implied curve changes shape because the original curve does (which you can see from your output: except for the 1-year and 5-years points, the actual discounts are different). The reason the original curve changes is probably the different position of weekends or holidays (so that, ...


3

A free to use Excel Add-on providing QuantLib-backed derivatives pricing analytics directly in Excel is available at http://www.deriscope.com Disclosure: answerer is author of the package.


3

I've never heard of it, but I've only been in the industry 2.5 years. Our C++ guys haven't even mentioned it either. They prefer using PACK/LAPACK which is mostly rooted in academia & heavily debugged. We also make heavy use of the IMSL FORTRAN libraries for hardcore statistical computation and Extreme Optimization (for .NET). One of our other ...


3

As for the first question, the schedule should start from the issue date. The bond will manage cash flows correctly based on the evaluation date. The second is a bit trickier, and I don't think I have working code handy. The general idea is: if you want to add a spread to the rate of the bond (to go from discount margin to price) you'll have to modify the ...


3

I think to have the answer: use qlBondPreviousCashFlowDate() pointing at your FloatingRateBond object to get the last date of payment; use qlInterestRateIndexFixingDate() to get the fixing date referring to the last payment date; use qlIndexAddFixings() to add a fixing rate to the fixing date you got above; repeat for each one of your bonds if they share ...


3

Tenor is just a different term for time to maturity. A schedule is generated from startDate and endDate in combination with a time to maturity and some info on calendar specifics. Here is an example from Dimitri Reiswich' Presentation from quantlib.com, I hope it makes the use of schedule clearer to you: void testingSchedule1 (){ Date begin (30 , September ...


3

There is experimental code available under https://sourceforge.net/tracker/?func=detail&atid=312740&aid=3413982&group_id=12740 Basically I tried to answer the question if you should do the riskfactor shifts on the level of the pricing engine or on the level of the market data. For me the answer is that one has to do it on the level of the ...


2

What you are observing is a natural occurence in the options market. If you think of PUT options as insurance, the premium is based on what the historical volatility of the underlying is. If option writers sold you the options at or below historical volatility they on average would loose money. So therefore, they "mark up" the historical volatility and that ...


2

The process must contain the spot price. The AnalyticEuropeanEngine will take care of calculating the forward price from the data you're passing in the process (in this case spot and risk-free-rate) and the maturity of the option. As implemented in QuantLib, though, The BlackProcess class assumes there's no dividend yield. If you want to model some kind of ...


2

Answering my own question: All the indicated numbers as obtained from ICAP need to be divided by 100, as they are percentages The OptionletStripper1 takes an IborIndex, which should have a tenor equal to 1Y. I had set it to 6M, and that seemed to cause problems Ouch!


1

You can obtain the desired effect by tweaking the bond construction. For instance, let's say you're creating a 4-years bond with semiannual coupons paying 3%, but missing the last. This makes for 7 coupons. Instead, you'll create the schedule as usual (so you have 8 periods), but specify a null last coupon when creating the bond. So: Schedule schedule = ...


1

Same feedback as quant_dev. A few quants are related to Premia but again, not directly used in production. That's more a research consortium and the latest version is not disclosed publicly (but you can pay for it if you want)



Only top voted, non community-wiki answers of a minimum length are eligible