|
From: Luigi B. <lui...@gm...> - 2007-12-22 21:14:32
|
On Dec 22, 2007, at 7:28 PM, Andrea wrote: > Thank you for your answer. I have started working on the > MCBasketEngine. > I will create a new Payoff implementing the methods I needs and we'll > see if it is any good. > > I think a product should > > 1) tell the engine on which dates it needs the values of how many > underlyings. True. This can be done in the setupArguments() method of the product by storing the relevant dates in the arguments structure contained in the engine (if you're not yet familiar with how the Instrument and PricingEngine class work together, look at the draft of chapter 2 available at <http://luigi.ballabio.googlepages.com/qlbook> > 2) the mc engine should generate a matrix of that many underlyings on > those dates (removing the extra timesteps simulated only for a > discretization schemes) and pass it to the product. Yes. For this, you can use the MultiPathGenerator class. Given the dates and the dynamics of the underlyings, it will generate a MultiPath instance containing the underlying values. However, you shouldn't pass it to the product, but rather to an instance of a class derived from PathPricer (which the product will instantiate.) > 3) the product should then return how much it pays on some final date. True, with 'product' replaced by 'path pricer'. Let me know how it goes. In the meantime, have a merry Christmas. Luigi |