예제 #1
0
        /// <summary>
        /// 获取行权收益
        /// </summary>
        /// <param name="pricePath">价格路径</param>
        /// <returns>行权收益</returns>
        public override Cashflow[] GetPayoff(Dictionary <Date, double> pricePath)
        {
            var prices = new Dictionary <Date, double>(pricePath);

            //merges fixings and monte carlo path
            foreach (var key in Fixings.Keys)
            {
                prices[key] = Fixings[key];
            }

            var avgPrice = ObservationDates.Average(x => prices[x]);

            return(GetPayoff(new[] { avgPrice, pricePath[ExerciseDates[0]] }));
        }