Example #1
0
        public void SetCalibrationDate(Date calibrationDate)
        {
            _floatLeg = SwapFactory.CreateFloatLeg(calibrationDate, _tenor, _index, _spread);
            _fixedLeg = SwapFactory.CreateFixedLeg(calibrationDate, _tenor, _index, _fixedRate);
            _floatLeg.SetValueDate(calibrationDate);
            _fixedLeg.SetValueDate(calibrationDate);
            _endDate = _floatLeg.GetCashflowDates(_index.Currency).Max();
            var otherEndDate = _fixedLeg.GetCashflowDates(_index.Currency).Max();

            if (_endDate < otherEndDate)
            {
                _endDate = otherEndDate;
            }
        }
Example #2
0
        public void SetCalibrationDate(Date calibrationDate)
        {
            _leg1 = SwapFactory.CreateFloatLeg(calibrationDate, _tenor, _leg1Index, _leg1Spread);
            _leg2 = SwapFactory.CreateFloatLeg(calibrationDate, _tenor, _leg2Index, _leg2Spread);
            _leg1.SetValueDate(calibrationDate);
            _leg2.SetValueDate(calibrationDate);
            _endDate = _leg1.GetCashflowDates(_leg1Index.Currency).Max();
            var otherEndDate = _leg2.GetCashflowDates(_leg2Index.Currency).Max();

            if (_endDate < otherEndDate)
            {
                _endDate = otherEndDate;
            }
        }