Example #1
0
        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);
            }
        }
Example #2
0
        protected PathPricer <IPath> mc_looback_path_pricer(ContinuousFloatingLookbackOption.Arguments args,
                                                            GeneralizedBlackScholesProcess process,
                                                            double discount)
        {
            FloatingTypePayoff payoff = args.payoff as FloatingTypePayoff;

            Utils.QL_REQUIRE(payoff != null, () => "non-floating  payoff given");

            return(new LookbackFloatingPathPricer(payoff.optionType(),
                                                  discount));
        }