public AnalyticBinaryBarrierEngine_helper(
     GeneralizedBlackScholesProcess process,
     StrikedTypePayoff payoff,
     AmericanExercise exercise,
     BarrierOption.Arguments arguments)
 {
     process_   = process;
     payoff_    = payoff;
     exercise_  = exercise;
     arguments_ = arguments;
 }
Exemple #2
0
        public override void setupArguments(IPricingEngineArguments args)
        {
            base.setupArguments(args);

            BarrierOption.Arguments moreArgs = args as BarrierOption.Arguments;
            if (!(moreArgs != null))
            {
                throw new ApplicationException("wrong argument type");
            }

            moreArgs.barrierType = barrierType_;
            moreArgs.barrier     = barrier_;
            moreArgs.rebate      = rebate_;
        }
        public DiscretizedBarrierOption(BarrierOption.Arguments args, StochasticProcess process, TimeGrid grid = null)
        {
            arguments_ = args;
            vanilla_   = new DiscretizedVanillaOption(arguments_, process, grid);

            Utils.QL_REQUIRE(args.exercise.dates().Count > 0, () => "specify at least one stopping date");

            stoppingTimes_ = new InitializedList <double>(args.exercise.dates().Count);
            for (int i = 0; i < stoppingTimes_.Count; ++i)
            {
                stoppingTimes_[i] = process.time(args.exercise.date(i));
                if (grid != null && !grid.empty())
                {
                    // adjust to the given grid
                    stoppingTimes_[i] = grid.closestTime(stoppingTimes_[i]);
                }
            }
        }
 public DiscretizedDermanKaniBarrierOption(BarrierOption.Arguments args,
                                           StochasticProcess process, TimeGrid grid = null)
 {
     unenhanced_ = new DiscretizedBarrierOption(args, process, grid);
 }