Barrier options
Posted by Mariano Zeron on Jan 21, 2017; 10:25am
URL: http://quantlib.414.s1.nabble.com/Barrier-options-tp17983.html
Hi,
I'm interested in pricing a barrier option not using an analytic solution, for example through a Monte Carlo simulation. I found MCBarrierEngine but so far I have had problems using it.
I seem to have a problem passing the right template argument list. I tried
boost::shared_ptr<PricingEngine> barrierEngineMC(
new MCBarrierEngine<RandomSequenceGenerator<MersenneTwisterUniformRng>, GeneralStatistics>(bsmProcess, timeSteps, 24, true, true, nSamples, 0.000001, nSamples + 10000, false, 42));
There are quite a few errors all of them related to the use of
RandomSequenceGenerator<MersenneTwisterUniformRng>
for example (I can pass all if needed):
'rsg_type' : is not a member of 'QuantLib::RandomSequenceGenerator<QuantLib::MersenneTwisterUniformRng>'
What is the right way of using this engine? As a side question but directly related to what I need, can this engine be used to price single barrier options (which I can price using the analytic pricer) or is this engine restricted to more exotic barriers?
Thanks in advance!
Mariano