Hi,
I am considering pricing daily monitored barrier options with QuantLib. For this to work, I need to set up boundary conditions depending on time steps. More specifically, barriers are only active at specified steps (day end).
I wonder how can I do this? Does the FdmDirichletBoundary class support different boundary & boundary values at different time steps? Many thanks!
Best, Henry ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi,
I don't think it supports time-dependent values as of now. You would probably have to modify its setTime() method (which currently does nothing) so that it sets the value depending on the passed time (assuming that in this respect, the new framework still works as the old one---I've fallen quite a bit behind on that part of the code). The interface of the setTime() method can't change (it's inherited), so you'll have to pass the data it needs to the constructor of your instance. Hope this helps, Luigi On Wed, Jul 17, 2013 at 7:42 AM, Haoyun XU <[hidden email]> wrote: > Hi, > > I am considering pricing daily monitored barrier options with QuantLib. For > this to work, I need to set up boundary conditions depending on time steps. > More specifically, barriers are only active at specified steps (day end). > > I wonder how can I do this? Does the FdmDirichletBoundary class support > different boundary & boundary values at different time steps? > > Many thanks! > > Best, > Henry > > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > -- <https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Haoyun XU
Hi
you might want to consider to use Peter's FdmTimeDepDirichletBoundary, which allows you to specify a time dependent value for the Dirichlet boundary condition.
If your barrier is only monitor using the closing prices but not with any intra day quotes then maybe you should only use one time step per day.
regards Klaus
On Wednesday, July 17, 2013 01:42:55 PM Haoyun XU wrote: Hi, I am considering pricing daily monitored barrier options with QuantLib. For this to work, I need to set up boundary conditions depending on time steps. More specifically, barriers are only active at specified steps (day end). I wonder how can I do this? Does the FdmDirichletBoundary class support different boundary & boundary values at different time steps? Many thanks! Best, Henry ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Haoyun XU
Hi Peter,
I have a question regarding your FdmTimeDepDirichletBoundary class: How can I apply the boundary constraint to a range of points near the boudary, instead of the exact point on the boundary? More specifically, think about the pricing of discretely monitored (daily) barrier options. Suppose we are using finite difference engine on a grid from Smin to Smax. We have ordinary Dirichlet boundary for each intraday time slice. However, for day-end time slice, extra constraint should be applied. For example, up&out put options should have 0 value for underlying price between barrier
and Smax. Any ideas how can I handle this using existing QuantLib framework?
Best, Henry
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Henry,
I am not sure if I fully understand what you have in mind, also Klaus is for sure much more the person who is qualified to answer.
What you can do with the class is to specify a boundary condition which may be a function of time t. This condition applies to the boundary
of the PDE (and to nowhere else). In addition the region in which you can solve PDEs in ql is restricted to the direct product of intervals, if I
am not mistaken.
Does that help a bit ?
kind regards
Peter
On 23 July 2013 07:42, Haoyun XU <[hidden email]> wrote:
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Henry,
At the time being QL does not support discrete barrier monitoring and it will take a bit of work to get it running. Barriers are forward skew sensitive products and therefore the question which market model to use (Local Vol, stoch Vol or local stoch vol) is more important than the difference between daily or continuously monitored barriers. Also in the equity world the price of a barrier is very sensitive to your dividend modelling. As long as your spot is not very close to the barrier I'd spent most of my time on these points and afterwards incorporate the daily observation feature. IMO people still tend to use "barrier adjustments" to do this, e.g. see the "original" paper http://www.columbia.edu/~sk75/mfBGK.pdf
If you want to implement the correct monitoring then to start with I'd use free boundary conditions and a standard mesher, which is also used to price plain vanilla options. The daily monitoring of the barrier can be incorporated by a StepCondition for every day. Please have a look into fdmlinear.cpp, class FdmHestonExpressCondition and the test case testFdmHestonExpress. In this test case a "barrier" is monitored every 4 months and a corresponding cashflow is initiated if the corresponding triggerlevel (barrier) is exceeded. You'll need to implement the corresponding barrier step condition.
hope this helps
Klaus
On Tuesday, July 23, 2013 07:29:26 PM Peter Caspers wrote: Hi Henry, I am not sure if I fully understand what you have in mind, also Klaus is for sure much more the person who is qualified to answer. What you can do with the class is to specify a boundary condition which may be a function of time t. This condition applies to the boundary of the PDE (and to nowhere else). In addition the region in which you can solve PDEs in ql is restricted to the direct product of intervals, if I am not mistaken. Does that help a bit ? kind regards Peter On 23 July 2013 07:42, Haoyun XU <[hidden email]> wrote: Hi Peter, I have a question regarding your FdmTimeDepDirichletBoundary class: How can I apply the boundary constraint to a range of points near the boudary, instead of the exact point on the boundary? More specifically, think about the pricing of discretely monitored (daily) barrier options. Suppose we are using finite difference engine on a grid from Smin to Smax. We have ordinary Dirichlet boundary for each intraday time slice. However, for day-end time slice, extra constraint should be applied. For example, up&out put options should have 0 value for underlying price between barrier and Smax. Any ideas how can I handle this using existing QuantLib framework? Best, Henry > > ---------- Forwarded message ---------- > From: Peter Caspers <[hidden email]> > To: Klaus Spanderen <[hidden email]> > Cc: > Date: Sat, 20 Jul 2013 09:22:29 +0200 > Subject: Re: [Quantlib-users] Boundary condition for each time step in finite difference engine > Hi, > sorry, there is still debug code in this class which writes messages > to std::cout. Please consider removing that before trying it out, as > shown here > > https://github.com/lballabio/quantlib/pull/17/files > > Luigi, maybe we can get this tiny fix into 1.3 ? > > Thank you > Peter > > > Klaus Spanderen <[hidden email]> writes: > >> Hi >> >> >> >> you might want to consider to use Peter's >> FdmTimeDepDirichletBoundary, which allows you to specify a time >> dependent value for the Dirichlet boundary condition. >> >> >> >> If your barrier is only monitor using the closing prices but not with >> any intra day quotes then maybe you should only use one time step per >> day. >> >> >> >> regards >> >> Klaus >> >> >> >> On Wednesday, July 17, 2013 01:42:55 PM Haoyun XU wrote: >> >> Hi, >> >> >> I am considering pricing daily monitored barrier options with >> QuantLib. For this to work, I need to set up boundary conditions >> depending on time steps. More specifically, barriers are only active >> at specified steps (day end). >> >> >> I wonder how can I do this? Does the FdmDirichletBoundary class >> support different boundary & boundary values at different time steps? >> >> >> Many thanks! >> >> >> Best, >> >> Henry >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> QuantLib-users mailing list >> [hidden email] >> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > -- <https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ _______________________________________________ ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Haoyun XU
Many thanks, Klaus & Peter.
I will look into the code you mentioned more carefully to see what I can do. Best, Henry 2013/7/24 Klaus Spanderen <[hidden email]>
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |