Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        /// <summary>
        /// Creates an Ibor cap/floor leg.
        /// <para>
        /// The Ibor index should be {@code EUR_EURIBOR_3M} or {@code EUR_EURIBOR_6M} to match the availability of the curve
        /// data in <seealso cref="IborCapletFloorletDataSet"/>.
        ///
        /// </para>
        /// </summary>
        /// <param name="index">  the index </param>
        /// <param name="startDate">  the start date </param>
        /// <param name="endDate">  the end date </param>
        /// <param name="strikeSchedule">  the strike </param>
        /// <param name="notionalSchedule">  the notional </param>
        /// <param name="putCall">  cap or floor </param>
        /// <param name="payRec">  pay or receive </param>
        /// <returns> the instance </returns>
        public static ResolvedIborCapFloorLeg createCapFloorLeg(IborIndex index, LocalDate startDate, LocalDate endDate, ValueSchedule strikeSchedule, ValueSchedule notionalSchedule, PutCall putCall, PayReceive payRec)
        {
            IborCapFloorLeg leg = createCapFloorLegUnresolved(index, startDate, endDate, strikeSchedule, notionalSchedule, putCall, payRec);

            return(leg.resolve(REF_DATA));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an Ibor cap/floor leg.
        /// <para>
        /// The Ibor index should be {@code EUR_EURIBOR_3M} or {@code EUR_EURIBOR_6M} to match the availability of the curve
        /// data in <seealso cref="IborCapletFloorletDataSet"/>.
        ///
        /// </para>
        /// </summary>
        /// <param name="index">  the index </param>
        /// <param name="startDate">  the start date </param>
        /// <param name="endDate">  the end date </param>
        /// <param name="strikeSchedule">  the strike </param>
        /// <param name="notionalSchedule">  the notional </param>
        /// <param name="putCall">  cap or floor </param>
        /// <param name="payRec">  pay or receive </param>
        /// <returns> the instance </returns>
        public static IborCapFloorLeg createCapFloorLegUnresolved(IborIndex index, LocalDate startDate, LocalDate endDate, ValueSchedule strikeSchedule, ValueSchedule notionalSchedule, PutCall putCall, PayReceive payRec)
        {
            Frequency           frequency       = Frequency.of(index.Tenor.Period);
            PeriodicSchedule    paySchedule     = PeriodicSchedule.of(startDate, endDate, frequency, BUSINESS_ADJ, StubConvention.NONE, RollConventions.NONE);
            IborRateCalculation rateCalculation = IborRateCalculation.of(index);

            if (putCall.Call)
            {
                return(IborCapFloorLeg.builder().calculation(rateCalculation).capSchedule(strikeSchedule).notional(notionalSchedule).paymentSchedule(paySchedule).payReceive(payRec).build());
            }
            return(IborCapFloorLeg.builder().calculation(rateCalculation).floorSchedule(strikeSchedule).notional(notionalSchedule).paymentSchedule(paySchedule).payReceive(payRec).build());
        }
 public virtual double priceVega(double expiry, double tenor, PutCall putCall, double strike, double forward, double volatility)
 {
     throw new System.NotSupportedException();
 }