Tag Info

13

I've been using QuantLib for quite a while. Let me share some experience: QuantLib is a highly sophisticated quantitative framework. It can do much and much more than a simple pricing of European option. For example, in your example, you could have changed the payoff to binary payoff or giving a monte-carlo pricing engine (rather than AnalyticEuropeanEngine)...

11

CMS adjustments in single curve context can be roughly explained if you consider a CMS swaplet by the fact that there is a single payment at the CMS rate at a single date and not on the whole strip of the underlying CMS tenor schedule. So if you are trying to hedge a CMS swaplet with the corresponding swap of CMS tenor length (with correct naïve nominal ...

11

A popular open-source option for the numerics in .NET is Math.NET (https://github.com/mathnet/mathnet-numerics). It has both managed implementations and allows you to use the optimized MKL native libraries. This use of .NET as a front-end to an optimized native library is quite common. Meta.Numerics (http://www.meta-numerics.net) is an alternative open-...

11

I provided an answer, based on an elementary approach, to an exactly same question yesterday. However, that question has disappeared, even though I like to keep a record for what I wrote. I would suggest that people do not delete their questions as they may be helpful for others. Here, I re-post that answer. We assume that, under the risk-neutral measure, ...

10

In the derivatives context, "arbitrage free" means almost surely for the probability measure under consideration. This is in opposition with statistical arbitrage used at high frequencies for example. More precisely the assumption is that there is no $T\geq 0$ and self-financed portfolio $V$ such that $V_0 = 0$, $P(V_T < 0) = 0$ and $P(V_T > 0) > ... 9 Assume you have an USD-EUR Cross Currency Swap (3M-FloatUSD+SpreadUSD vs 3M-FloatEUR+SpreadEUR) (spread on USD side is usually zero), collateralized by USD-OIS (Fed Fund) I assume you know the USD-OIS discount curve, then you know the discount curve for USD cash flows. I further assume that you know the USD-3M forwards collateralized w.r.t. USD-OIS (from ... 8 Not really a quant question, but a quick search led to this from the CME: http://www.cmegroup.com/market-data/files/CME_Group_Settlement_Procedures.pdf. Unfortunately it depends on the contract, for example: Equity Futures: For S&P and NASDAQ, the settlement price of the lead* month contract is the midpoint of the closing range determined based on pit ... 8 I recommend reading Cao, Hansch, and Wang (2004) "The Informational Content of an Open Limit Order Book". They present a simple model for an order-book price called the weighted price ($\mbox{WP}$): $$\mbox{WP}^{n_1 - n_2} = \frac{\sum_{j=n_1}^{n_2} (Q_j^d P_j^d + Q_j^s P_j^s)}{(Q_j^d + Q_j^s)}$$ Where:$n$is the order book level$Q_j$is the size at ... 7 You have the right intuition but the approach is not quite right. The issuer has the right to call back the bond at a pre-defined call price. So your decision criterion is "call when the value of the bond >= contractual call price". We are comparing prices in the decision rule, not the YTM of the callable bond with the coupon of the bond. Note that ... 7 A swap does not require a model because its price can be derived from the yield curve without any assumptions about how the yield curve may move in the future. The PFE however is an indication of by how much the swap's mark-to-market may move between now and a moment in the future. It is of course influenced by how volatile rates are. The more volatile ... 7 We actually managed to come up with the answer to this question ourselves but wanted to share the answer since it might be relevant to others as well. The calculation depends on what method is used to calculate the cost. There is the FIFO, LIFO and the average cost method, see: http://www.accounting-basics-for-students.com/fifo-method.html If FIFO or LIFO ... 7 $$\frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$ Indeed, in the pricing measure, the distribution of$r_{12}$has to be such that this relation holds. If you look at drift derivations for the LIBOR market model, a lot of work goes into making this sort of equation hold. 7 See this excellent paper by @MarkJoshi which defines/discusses the use of power numeraires. Starting from a dynamics specified under the risk-neutral measure$\mathbb{Q}\begin{align} &\frac{dS_t}{S_t} = (r-q) dt + \sigma dW_t^{\mathbb{Q}}\\ \iff& S_T\ \vert\ \mathcal{F}_t = S_t e^{(r-q-\frac{\sigma^2}{2})(T-t) + \sigma(W_T-W_t)} \tag{EQ.0} \end{... 6 I have honestly not come across a good book (or good enough review to make me buy the book) on Fund Transfer Pricing. While it is not my career focus, I had to familiarize myself a bit with the topic because of certain requirements involving funding trading operations and the performance of funding specific operations. Personally I would recommend the ... 6 The question should not be about the swaption pricing formula, its well established and widely accepted and utilized every single day. The question you SHOULD be asking, however, is which underlying volatility model you are using. Its idential to you questioning the use of B-S in transforming vols -> prices, and prices -> vols in the equity world while you ... 6 I think the reason is the following: The bund future refers to the price of a fictituous10$-year$6\%$coupon bond. The current ctd bond has a smaller coupon I think ($2\%$01/04/2022) - that would account for the price difference right? 6 I would say Start with Black Scholes to look at accuracy. In particular, you have a closed formula and you know what the characteristic function for lognormal is. Running FFT and comparing FFT pricing with the closed formula will give you an idea of what are the convergence issues, what is the behaviour at the boundaries (extreme strikes) etcetera. Then ... 6 You should use the full yield curve, discounting cash flows at specific dates using the appropriate zero-coupon interest rate. As to which yield curve, that is often a matter of convention. Generally one uses the LIBOR/swaps curve for all but the most liquid products (in which case you use the treasury curve). The curve is constructed from LIBOR/Eurodollar ... 6 I have a little more informations, so let me share it with you. Even though I think that the frameworks I presented in my question are both corrects (i.e. aribtrage free), it happens to be the case that the market seems to have more "structure". Here is a methodology that allows to retreive market quotes and which is the same as BBG (which is the best ... 6 You might want to read this: Size, Value, and Momentum in International Stock Returns by Fama and French (2011) Abstract: In the four regions (North America, Europe, Japan, and Asia Pacific) we examine, there are value premiums in average stock returns that, except for Japan, decrease with size. Except for Japan, there is return momentum everywhere,... 6 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 can ... 6 The model of choice depends on the purpose of the exercise. In general there are two types of models: Equilibrium models: These are general used use for "fitting" the spot curve to the discount function available in the market. So different models will give you different yield curves. One can use this information to see the relative value of implementing a ... 6 Independently if it makes economically sense or not, negative interest rates have become a reality for Europe which can no longer be neglected. (Even LIBOR became negative in the last months.) One common but wrong solution was to set the rate simply to zero. (One must - by the way take care - that this "solution" is not automatically applied by correction ... 6 fixedLegBPS is the basis-point sensitivity of the fixed leg, that is, how much its NPV changes when the fixed rate changes by one basis point: it's calculated as the NPV corresponding to a fixed rate of 1 bps. Since the NPV of the fixed leg is linearly proportional to the fixed rate, you can write the equation targetNPV : fixedRate = BPS : 1 basis point ... 6 And don't forget that there are wrappers as eq RQuantLib which I use on the command-line here: edd@max:~$ r -l RQuantLib -e 'print(EuropeanOption("call", 47, 40, 0.05, 0.0, 4/12, 0.2))' Concise summary of valuation for EuropeanOption value delta gamma vega theta rho divRho 6.4728 0.8899 0.0307 4.5139 0.7372 11....

6

Let's relabel this as What (TF) is SABR? Alpha, Beta and Rho are the point of the model. So explaining them is explaining the model. A model of two processes Unlike earlier models in which the volatility was modelled as a constant (Vasicek, Hull-White, etc), SABR assumes that as well as the price of the thing being stochastic, so is its volatility. That ...

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 ...

5

To add to Student T's answer, which I second: the complex setup starts making sense (and its cost gets amortized) once you start keeping the instruments around instead of throwing them away after the pricing. For instance, once the option above is built, you can change the market price of the underlying (or its volatility, or the risk free rate) by just ...

5

Here are at least three mistakes in your code: p += s0 * exp(...) should be p *= exp(...). Your volatility and rates are per annum, so divide the days by 365 (or 255) in your function asset_price. In asset_price you multiply by days inside the loop. However, the loop is already iterating over the days - so you don't take two steps of one day but two steps ...

4

You have to look at the terms and conditions on your individual bond. The way the specifications usually work is that a call will result in accrued interest being paid, effectively making up for the lost coupon. Sometimes there's even an extra penalty. A put will result in a loss of coupon in almost all cases, and so is almost always done just after a ...

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