Exemplo n.º 1
0
 /// <summary>
 /// 获取行权收益
 /// </summary>
 /// <param name="pricePath">价格路径</param>
 /// <returns>行权收益</returns>
 //this one is used in Monte Carlo, and Monte carlo is used to Pricing European option
 public override Cashflow[] GetPayoff(Dictionary <Date, double> pricePath)
 {
     if (Exercise == OptionExercise.European)
     {
         return(GetPayoff(new[] { pricePath[ExerciseDates.Single()] }));
     }
     else
     {
         //American or Bermudan
         return(GetPayoff(new[] { pricePath[ExerciseDates.Single()] }));
     }
 }
Exemplo n.º 2
0
        public override IOption Clone(OptionExercise exercise)
        {
            var newExerciseSchedule = (exercise == OptionExercise.European) ? new Date[] { ExerciseDates.Last() } : ExerciseDates;

            return(new LookbackOption(
                       startDate: this.StartDate,
                       maturityDate: this.UnderlyingMaturityDate,
                       exercise: exercise,
                       strikeStyle: this.StrikeStyle,
                       optionType: this.OptionType,
                       strike: this.Strike,
                       underlyingInstrumentType: this.UnderlyingProductType,
                       calendar: this.Calendar,
                       dayCount: this.DayCount,
                       payoffCcy: this.PayoffCcy,
                       settlementCcy: this.SettlementCcy,
                       fixings: this.Fixings,
                       exerciseDates: newExerciseSchedule,
                       observationDates: this.ObservationDates,
                       notional: this.Notional,
                       settlementGap: this.SettlmentGap,
                       optionPremiumPaymentDate: this.OptionPremiumPaymentDate,
                       optionPremium: this.OptionPremium,
                       isMoneynessOption: this.IsMoneynessOption,
                       initialSpotPrice: this.InitialSpotPrice,
                       dividends: this.Dividends,
                       hasNightMarket: this.HasNightMarket,
                       commodityFuturesPreciseTimeMode: this.CommodityFuturesPreciseTimeMode));
        }