Hello,
Is it true that the AnalyticBarrierEngine in QuantLib 0.3.8 doesn't have any support for greeks, or am I somehow mistaken? If greeks are to be implemented, what would be the best way of doing it? thanks and regards Sid __________________________________________________________ How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com |
Maybe you could modify
Quantlib FDM schemes to handle greeks. It's fairly easy.
Just take divided diference of price to get
delta. I have done it and its OK.
Daniel From: [hidden email] on behalf of Siddharth Sharma Sent: Thu 23/06/2005 13:21 To: [hidden email] Subject: [Quantlib-users] Barrier option greeks Hello, |
On 06/23/2005 06:55:26 PM, Daniel J. Duffy wrote:
> Maybe you could modify Quantlib FDM schemes to handle greeks. It's > fairly easy. Just take divided diference of price to get delta. I > have done it and its OK. That is a possibility---and indeed, delta and gamma are calculated in this way in all finite-difference engines---but one would have to write a FD engine for Barrier options first, which is missing at this time. As to the current analytic engine, one could write down the implemented formula and derive it; it's a bit of tedious work, but possible. After one's done that, one'd just assign the corresponding variable, as in: results_.value = C(1,1) + E(1); // an existing switch case results_.delta = (the expression one found); in every switch and if clause. Alternatively, a numerical estimate can be obtained by calculating the analytic prices P1 and P2 for underlying prices (u0 - du) and (u0 + du), respectively, where du is a small increment and approximate delta as (P2-P1)/(2*du). (Daniel, was this what you were suggesting?) Later, Luigi ---------------------------------------- Prediction is very difficult, especially if it's about the future. -- Niels Bohr |
In reply to this post by Siddharth Sharma-3
If you have FDM for plain
optons then barriersa are even easier because we have Dirichlet BC and no far
field ..
regards
Daniel From: Luigi Ballabio [mailto:[hidden email]] Sent: Fri 24/06/2005 12:51 To: Daniel J. Duffy Cc: Siddharth Sharma; [hidden email] Subject: Re: [Quantlib-users] Barrier option greeks On 06/23/2005 06:55:26 PM, Daniel J. Duffy wrote: |
In reply to this post by Luigi Ballabio
I have seen automatic differentiation used once an analytic library to
avoid the tedious derivation of the barrier greeks by hand, and managing the resulting code. I thought it quite elegant, but care needed to be taken to avoid roundoff errors and also performance problems when too many objects were instantiated. Gary On 6/24/05, Luigi Ballabio <[hidden email]> wrote: > > On 06/23/2005 06:55:26 PM, Daniel J. Duffy wrote: > > Maybe you could modify Quantlib FDM schemes to handle greeks. It's > > fairly easy. Just take divided diference of price to get delta. I > > have done it and its OK. > > That is a possibility---and indeed, delta and gamma are calculated in > this way in all finite-difference engines---but one would have to write > a FD engine for Barrier options first, which is missing at this time. > > As to the current analytic engine, one could write down the implemented > formula and derive it; it's a bit of tedious work, but possible. After > one's done that, one'd just assign the corresponding variable, as in: > > results_.value = C(1,1) + E(1); // an existing switch case > results_.delta = (the expression one found); > > in every switch and if clause. > > Alternatively, a numerical estimate can be obtained by calculating the > analytic prices P1 and P2 for underlying prices (u0 - du) and (u0 + > du), respectively, where du is a small increment and approximate delta > as (P2-P1)/(2*du). (Daniel, was this what you were suggesting?) > > Later, > Luigi > > ---------------------------------------- > > Prediction is very difficult, especially if it's about the future. > -- Niels Bohr > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&opclick">http://ads.osdn.com/?ad_idt77&alloc_id492&opclick > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
Free forum by Nabble | Edit this page |