コード例 #1
0
        public VannaVolgaDoubleBarrierEngine(Handle <DeltaVolQuote> atmVol,
                                             Handle <DeltaVolQuote> vol25Put,
                                             Handle <DeltaVolQuote> vol25Call,
                                             Handle <Quote> spotFX,
                                             Handle <YieldTermStructure> domesticTS,
                                             Handle <YieldTermStructure> foreignTS,
                                             GetOriginalEngine getEngine,
                                             bool adaptVanDelta      = false,
                                             double bsPriceWithSmile = 0.0,
                                             int series = 5)
            : base()

        {
            atmVol_            = atmVol;
            vol25Put_          = vol25Put;
            vol25Call_         = vol25Call;
            T_                 = atmVol_.link.maturity();
            spotFX_            = spotFX;
            domesticTS_        = domesticTS;
            foreignTS_         = foreignTS;
            adaptVanDelta_     = adaptVanDelta;
            bsPriceWithSmile_  = bsPriceWithSmile;
            series_            = series;
            getOriginalEngine_ = getEngine;

            Utils.QL_REQUIRE(vol25Put_.link.delta().IsEqual(-0.25), () => "25 delta put is required by vanna volga method");
            Utils.QL_REQUIRE(vol25Call_.link.delta().IsEqual(0.25), () => "25 delta call is required by vanna volga method");

            Utils.QL_REQUIRE(vol25Put_.link.maturity().IsEqual(vol25Call_.link.maturity()) &&
                             vol25Put_.link.maturity().IsEqual(atmVol_.link.maturity()), () =>
                             "Maturity of 3 vols are not the same");

            Utils.QL_REQUIRE(!domesticTS_.empty(), () => "domestic yield curve is not defined");
            Utils.QL_REQUIRE(!foreignTS_.empty(), () => "foreign yield curve is not defined");

            atmVol_.registerWith(update);
            vol25Put_.registerWith(update);
            vol25Call_.registerWith(update);
            spotFX_.registerWith(update);
            domesticTS_.registerWith(update);
            foreignTS_.registerWith(update);
        }
コード例 #2
0
 public ForwardVanillaEngine(GeneralizedBlackScholesProcess process, GetOriginalEngine getEngine)
 {
     process_ = process;
     process_.registerWith(update);
     getOriginalEngine_ = getEngine;
 }
コード例 #3
0
 public ForwardPerformanceVanillaEngine(GeneralizedBlackScholesProcess process, GetOriginalEngine getEngine)
     : base(process, getEngine)
 {
 }