# Quantlib asian option example

Best direct trading broker canada not really sure how to check my calculations.

I tried using QuantLib to price things for me, but it seems to use actual dates a lot whereas I'm just interested in year fractions and the documentation is lacking. I implemented a finite difference algorithm as described in Wilmott's "Mathematics of Financial Derivatives" and he has some numbers in his book.

But my "implementation" of just quantlib asian option example analytical Black-Scholes formula already gives different results than his not by much though.

Again, I just typed up the down and out call option formula from Zhang's Exotic options. He actually goes through explicit examples for each of his formulas. The book has many formulas, sample values and outputs. Highly recommended for validating quantlib asian option example results. Apparently, this is one **quantlib asian option example** most popular books used by real-world quants simple and fast.

Here, we make the exercise date exactly 0. Anything from QuantLib using the dates should match your own implementation. You can adjust the exerciseDate, print the yearFraction and use it in your own code.

They implement the most commonly quantitative finance models. For example, I use the following script to validate my Levy Asian options:. OptionMatirx is a finance calculator runs on a desktop computer. If, under your working modelling assumptions, there exist closed form formulasthen compare your results to them. Beware of true formulas vs. Compare different pricers' implementations versus each other: Monte-Carlo vs Finite Difference. Usually the Monte-Carlo pricer is easier to develop except for complex diffusion models requiring custom stepping schemesso just push the number of simulations to the limits to obtain a "good" reference again this assumes a reasonable discretisation bias.

Use your common sense and experience: You can use Brownian interpolation to improve your results. Use universal truths no-arbitrage arguments: Validate incrementally by testing your pricer on degenerate situations where you know the price you should get: Move to more and more complex situations.

I would be very careful when comparing with third party implementations! For Black-Scholes why not, but as soon as you implement complex models, the tiniest difference in the assumptions can have an enormous impact on the results. So you're always better off validating what you did. For a few standard option types under Black-Scholes you can also cross-check your results using this free option pricing application. It does a few things that QuantLib doesn't, like American Asian options.

It can do benchmark-level accuracy, for example I get correct digits for american vanillas, and also get extreme agreement between the FD and MC engines in many cases up to quantlib asian option example digits. By posting your answer, you agree to the privacy policy and terms of service. Questions Tags Users Badges Unanswered.

Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. Join them; it only takes a minute: Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top.

How do you check your option calculations? So my question is, what is your go to reference for option prices for checking your code? You can still use QuantLib to price with year fractions. I have an example: For example, I use the following script to validate my Levy Asian options: SmallChess 1, 1 11 It's known as "cost-of-carry". A note quantlib asian option example the haug book - many of the formulae are gross approximations. Many of them involve inserting quantlib asian option example single volatility per asset, and leave out quantlib asian option example issue of choosing these vols, or that perhaps you should integrate the simple form over a distribution of vols, etc.

Sason Torosean 1 6. I would tend to do the following: Now if it's not the case: Quantuple 9, quantlib asian option example 7 Yian Pap 2 4. This is really a comment to Quantuple's reply below. The pricer I linked to above does demonstrate the use of Brownian interpolation. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name.