|
From: Luigi B. <lui...@gm...> - 2009-04-17 10:10:21
|
Hi Nando, sorry if I'll be short---I don't have much time and I will be gone in the afternoon. On Fri, 2009-04-17 at 11:31 +0200, Ferdinando Ametrano wrote: > > So basically, you tried to discount to yesterday with the evaluation > > date set to today? > > it is not nonsensical as (you try to make) it sounds, especially in a > dynamic environment. > I have a session on QuantLibXL with the evaluation date equal to > today. I'm asked by the control office to justify a bond price > valuation done about 2 months ago. I deserialize the xml files of that > bond and its interest rate curve as they were at the time. The yield > curve has fixed reference date. The bond clean price fails because of > the evaluation date, and it should not since both bond and interest > rate curve are coherent. I think the clean price should fail. It's true that, with a fixed reference date for the curve, you can calculate the NPV. But for the clean price you need to calculate the bond settlement date, and you can't retrieve that from the discount curve---you don't know if the reference date was t+0, t+2 or whatever. And in general, yes, it might be a pain to keep curves, instrument and evaluation date consistent. But otherwise, I'm not sure that the library can always determine when you want it to disregard the evaluation date that you set earlier in the session. I tend to think it dangerous when the code tries to double-guess the user. > ok, now that at least we agree that it should check the evaluation > date, let's try to move ahead one more step. It might check the yield > term structure reference date if a pricing engine is set: wouldn't > this be better? It would. But to retrieve the discount curve, you'll have to downcast the engine (not a big problem now, but there might be a few different engines in the future.) We'd be entering a quagmire of "it's a discounting engine? Ok, get the discount curve. It's not? It's a short-rate model engine? Ok, get the model, and get the risk-free curve from it. It's not? ..." > It would allow to price the bond in the above QuantLibXL example Again, not sure about that. NPV? Yes. Price? No. > This is the key point you can observe in Revision 16180 > (http://quantlib.svn.sourceforge.net/quantlib/?rev=16180&view=rev): > isExpired sometime refers to the evaluation date, some other times to > the term structure reference date. In my opinion the latter should be > the correct, or at least preferred, behavior. Same problem here. When it checks against the reference date, it's because we didn't move the instrument to the pricing-engine framework and we still have the discount curve available. We'll lose it if we move it into the engine. Also, it depends. If we're checking cash-flow dates, they should be checked against the curve reference date. If we're checking exercise dates, those should be checked against the evaluation date, shouldn't they? Later, Luigi -- The First Rule of Optimization: Don't do it. The Second Rule of Optimization (For experts only): Don't do it yet. -- Michael Jackson |