protected override PathPricer <IPath> pathPricer() { TimeGrid grid = this.timeGrid(); double discount = (this.process_ as GeneralizedBlackScholesProcess) .riskFreeRate().currentLink().discount(grid.Last()); ContinuousFixedLookbackOption.Arguments arg1 = this.arguments_ as ContinuousFixedLookbackOption.Arguments; ContinuousPartialFixedLookbackOption.Arguments arg2 = this.arguments_ as ContinuousPartialFixedLookbackOption.Arguments; ContinuousFloatingLookbackOption.Arguments arg3 = this.arguments_ as ContinuousFloatingLookbackOption.Arguments; ContinuousPartialFloatingLookbackOption.Arguments arg4 = this.arguments_ as ContinuousPartialFloatingLookbackOption.Arguments; if (arg2 != null) { return(mc_looback_path_pricer(arg2, this.process_ as GeneralizedBlackScholesProcess, discount)); } else if (arg1 != null) { return(mc_looback_path_pricer(arg1, this.process_ as GeneralizedBlackScholesProcess, discount)); } else if (arg4 != null) { return(mc_looback_path_pricer(arg4, this.process_ as GeneralizedBlackScholesProcess, discount)); } else if (arg3 != null) { return(mc_looback_path_pricer(arg3, this.process_ as GeneralizedBlackScholesProcess, discount)); } else { return(null); } }
protected PathPricer <IPath> mc_looback_path_pricer(ContinuousPartialFloatingLookbackOption.Arguments args, GeneralizedBlackScholesProcess process, double discount) { FloatingTypePayoff payoff = args.payoff as FloatingTypePayoff; Utils.QL_REQUIRE(payoff != null, () => "non-floating payoff given"); double lookbackEnd = process.time(args.lookbackPeriodEnd); return(new LookbackPartialFloatingPathPricer(lookbackEnd, payoff.optionType(), discount)); }