Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Calculate Floating Rate cashflow
- private double CalculateFRA(int index, double notional, double fixedRate,
- double currentResetRate, double currentPeriod,
- double frequencyInYear,
- IDictionary<double, double> floatingRates)
- {
- //Two Steps
- //Step 1: Find appropriate forward rate converted into target compounding
- //except for first period
- //Step 2: Calculate Floating Rate cashflow from Notional and Calculated Rate
- //for first period: //remember for first period, we always take the reset rate
- //and calculate floating rate cashflow
- //therefore initialise with floating cashflow
- var currentRate = floatingRates[currentPeriod];
- var targetRate = currentResetRate;
- if (index > 0)
- {
- targetRate = GetForwardRate(index, frequencyInYear, floatingRates);
- }
- //step 2: // Present value Of Fixed - Float Payment
- var fraPrice = notional * (fixedRate-targetRate) * frequencyInYear;
- var discountedFraPrice = CalculatePresentValueOfPayment(fraPrice, currentPeriod,
- currentRate);
- return discountedFraPrice;
- }
Add Comment
Please, Sign In to add comment