Assembla home | Assembla project page
 

Changeset 198

Show
Ignore:
Timestamp:
05/29/08 18:13:15 (3 months ago)
Author:
snovik
Message:

New: Start MC for American Options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QLNet/Examples/EquityOption/EquityOption.cs

    r197 r198  
    252252            //// Monte Carlo Method: MC (Longstaff Schwartz) 
    253253            //method = "MC (Longstaff Schwartz)"; 
    254             //boost::shared_ptr<PricingEngine> mcengine3; 
    255             //mcengine3 = MakeMCAmericanEngine<PseudoRandom>(bsmProcess
    256             //    .withSteps(100
    257             //    .withAntitheticVariate(
    258             //    .withCalibrationSamples(4096
    259             //    .withTolerance(0.02
    260             //    .withSeed(mcSeed); 
     254            //IPricingEngine mcengine3 = new MakeMCAmericanEngine<PseudoRandom>(bsmProcess) 
     255            //                            .withSteps(100
     256            //                            .withAntitheticVariate(
     257            //                            .withCalibrationSamples(4096
     258            //                            .withTolerance(0.02
     259            //                            .withSeed(mcSeed
     260            //                            .value(); 
    261261            //americanOption.setPricingEngine(mcengine3); 
    262             //std::cout << std::setw(widths[0]) << std::left << method 
    263             //          << std::fixed 
    264             //          << std::setw(widths[1]) << std::left << "N/A" 
    265             //          << std::setw(widths[2]) << std::left << "N/A" 
    266             //          << std::setw(widths[3]) << std::left << americanOption.NPV() 
    267             //          << std::endl; 
    268  
    269             //// End test 
     262            //Console.Write("{0,-" + widths[0] + "}", method); 
     263            //Console.Write("{0,-" + widths[1] + ":0.000000}", "N/A"); 
     264            //Console.Write("{0,-" + widths[2] + ":0.000000}", "N/A"); 
     265            //Console.WriteLine("{0,-" + widths[3] + ":0.000000}", americanOption.NPV()); 
     266 
     267            // End test 
    270268 
    271269            Console.WriteLine(" \nRun completed in {0}", DateTime.Now - timer); 
  • trunk/QLNet/QLNet/QLNet.csproj

    r194 r198  
    219219    <Compile Include="Methods\lattices\tree.cs" /> 
    220220    <Compile Include="Methods\montecarlo\brownianbridge.cs" /> 
     221    <Compile Include="Methods\montecarlo\earlyexercisepathpricer.cs" /> 
     222    <Compile Include="Methods\montecarlo\longstaffschwartzpathpricer.cs" /> 
    221223    <Compile Include="Methods\montecarlo\mctraits.cs" /> 
    222224    <Compile Include="Methods\montecarlo\montecarlomodel.cs" /> 
     
    250252    <Compile Include="Pricingengines\CapFloor\BlackCapFloorEngine.cs" /> 
    251253    <Compile Include="Pricingengines\Greeks.cs" /> 
     254    <Compile Include="Pricingengines\mclongstaffschwartzengine.cs" /> 
    252255    <Compile Include="Pricingengines\mcsimulation.cs" /> 
    253256    <Compile Include="Pricingengines\Swap\Discountingswapengine.cs" /> 
     
    268271    <Compile Include="Pricingengines\vanilla\Integralengine.cs" /> 
    269272    <Compile Include="Pricingengines\vanilla\Juquadraticengine.cs" /> 
     273    <Compile Include="Pricingengines\vanilla\mcamericanengine.cs" /> 
    270274    <Compile Include="Pricingengines\vanilla\mceuropeanengine.cs" /> 
    271275    <Compile Include="Pricingengines\vanilla\mcvanillaengine.cs" />