Exemplo n.º 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);
            }
        }
 public LatticeShortRateModelEngine(ShortRateModel model,
                                    TimeGrid timeGrid)
     : base(model)
 {
     timeGrid_  = new TimeGrid(timeGrid.Last(), timeGrid.size() - 1 /*timeGrid.dt(1) - timeGrid.dt(0)*/);
     timeGrid_  = timeGrid;
     timeSteps_ = 0;
     lattice_   = this.model_.link.tree(timeGrid);
 }