コード例 #1
0
 public AnalyticDoubleBarrierBinaryEngineHelper(
     GeneralizedBlackScholesProcess process,
     CashOrNothingPayoff payoff,
     DoubleBarrierOption.Arguments arguments)
 {
     process_   = process;
     payoff_    = payoff;
     arguments_ = arguments;
 }
コード例 #2
0
        public DiscretizedDoubleBarrierOption(DoubleBarrierOption.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]);
                }
            }
        }
コード例 #3
0
 public DiscretizedDermanKaniDoubleBarrierOption(DoubleBarrierOption.Arguments args,
                                                 StochasticProcess process, TimeGrid grid = null)
 {
     unenhanced_ = new DiscretizedDoubleBarrierOption(args, process, grid);
 }