Esempio n. 1
0
        public static double GetFixedSidePV(DateTime valuationDate, List <AmortisingResultItem> fixedCFs, List <AmortisingResultItem> floatCFs, IDayCounter dayCounter, RateCurve curve, double floatRateMargin, double fixedRate, DateTime bulletPaymentDate, double bulletPaymentValue)
        {
            //  solve for the fixed rate
            //
            var    objectiveFunction       = new BillSwapPricer2SwapParRateObjectiveFunction(valuationDate, fixedCFs, floatCFs, curve, dayCounter, floatRateMargin, bulletPaymentDate, bulletPaymentValue);
            double presentValueOfFixedSide = -objectiveFunction.Value(fixedRate);

            return(presentValueOfFixedSide);
        }
Esempio n. 2
0
        public static double GetFixedSideSensitivity(DateTime valuationDate, List <AmortisingResultItem> fixedCFs, List <AmortisingResultItem> floatCFs,
                                                     IDayCounter dayCounter,
                                                     RateCurve originalCurve, RateCurve perturbedCurve,
                                                     double floatRateMargin, double fixedRate, DateTime bulletPaymentDate, double bulletPaymentValue)
        {
            //  solve for the fixed rate
            //
            var    objectiveFunction = new BillSwapPricer2SwapParRateObjectiveFunction(valuationDate, fixedCFs, floatCFs, originalCurve, dayCounter, floatRateMargin, bulletPaymentDate, bulletPaymentValue);
            double originalPV        = objectiveFunction.Value(fixedRate);
            var    objectiveFunctionWithPerturbedCurve = new BillSwapPricer2SwapParRateObjectiveFunction(valuationDate, fixedCFs, floatCFs, perturbedCurve, dayCounter, floatRateMargin, bulletPaymentDate, bulletPaymentValue);
            double perturbedPV = objectiveFunctionWithPerturbedCurve.Value(fixedRate);

            return(perturbedPV - originalPV);
        }