Exemple #1
0
 public IFundingInstrument Clone() => new IrSwap
 {
     BasisFixed        = BasisFixed,
     BasisFloat        = BasisFloat,
     Currency          = Currency,
     Counterparty      = Counterparty,
     DiscountCurve     = DiscountCurve,
     EndDate           = EndDate,
     FixedLeg          = FixedLeg.Clone(),
     FloatLeg          = FloatLeg.Clone(),
     FlowScheduleFixed = FlowScheduleFixed.Clone(),
     FlowScheduleFloat = FlowScheduleFloat.Clone(),
     ForecastCurve     = ForecastCurve,
     NDates            = NDates,
     Notional          = Notional,
     ParRate           = ParRate,
     PillarDate        = PillarDate,
     ResetDates        = ResetDates,
     ResetFrequency    = ResetFrequency,
     SolveCurve        = SolveCurve,
     StartDate         = StartDate,
     SwapTenor         = SwapTenor,
     SwapType          = SwapType,
     TradeId           = TradeId,
     RateIndex         = RateIndex,
     PortfolioName     = PortfolioName,
     HedgingSet        = HedgingSet
 };
Exemple #2
0
        public double Pv(IFundingModel model, bool updateState)
        {
            var updateDf  = updateState || (model.CurrentSolveCurve == DiscountCurve);
            var updateEst = updateState || (model.CurrentSolveCurve == ForecastCurve);

            var discountCurve = model.Curves[DiscountCurve];
            var forecastCurve = model.Curves[ForecastCurve];
            var fixedPv       = FlowScheduleFixed.PV(discountCurve, forecastCurve, updateState, updateDf, updateEst, BasisFloat, null);
            var floatPv       = FlowScheduleFloat.PV(discountCurve, forecastCurve, updateState, updateDf, updateEst, BasisFloat, null);

            return(fixedPv + floatPv);
        }