#include <DiscountCalculator.h>
Inheritance diagram for com::ftlabs::fisa::calc::DiscountCalculator:

Public Member Functions | |
| DiscountCalculator (const FISADate &settlementDate, const Redemption &maturity, const double parValue, const DayCountBasis &dayCountBasis, const bool eomAdjust, const FISADate *datedDate, const HolidaySchedule *holidaySchedule) throw ( com::ftlabs::fisa::calc::CalculationException ) | |
| DiscountCalculator (const DiscountCalculator &calculator) | |
| DiscountCalculator & | operator= (const DiscountCalculator &calculator) |
| ~DiscountCalculator (void) | |
| void | setValues (const FISADate &settlementDate, const Redemption &maturity, const double parValue, const DayCountBasis &dayCountBasis, const bool eomAdjust, const FISADate *datedDate, const HolidaySchedule *holidaySchedule) throw ( com::ftlabs::fisa::calc::CalculationException ) |
| double | calculateCurrentYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate current yield for the given price. | |
| double | calculateYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate yield for the given price. | |
| double | calculatePrice (double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate price for the given yield. | |
| double | calculateAccruedInterest () const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate the accrued interest to the settlement date. | |
| double | getInterest (int cashFlowIndex) const |
| Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex. | |
| double | getPrincipal (int cashFlowIndex) const |
| Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex. | |
| double | getTimeToFlow (int cashFlowIndex) const |
| Get the time to flow for a particular cashflow, as specified by cashFlowIndex. | |
| double | getPeriodicTimeToFlow (int cashFlowIndex) const |
| Get the periodic time to flow as calculated with an actual day count method for a particular cashflow, as specified by cashFlowIndex. This value is generally used in actual convexity and duration methods. | |
| double | calculatePriceValue1BP (double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate the average price value obtained by varying the yield up and down one basis point. | |
| double | calculateYieldValue1_32 (double pv1b) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate the average yield value obtained by varying the price up and down 1/32. | |
| double | calculateEstimatedMacaulayDuration (double pv1b, double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate an estimated Macaulay duration. | |
| double | calculateEstimatedModifiedDuration (double pv1b, double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate an estimated modified duration. | |
| double | calculateEstimatedModifiedDuration (double duration, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate the estimated modified duration. | |
| double | calculateEstimatedConvexity (double pv1b, double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate an estimated convexity. | |
| double | calculateTrueYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate a True Yield, using adjusting cashflows that fall on business days. | |
| virtual double | calculatePriceFromDiscount (double discount) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate price from discount. | |
| virtual double | calculateDiscount (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate a discount value from a given price. | |
| virtual double | calculateCEY (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate a coupon equivalent yield (CEY) from the given price. | |
| virtual double | calculateBEY (double price) const throw ( com::ftlabs::fisa::calc::CalculationException ) |
| Calculate a bond equivalent yield (BEY) from the given price. | |
| virtual Calculator * | clone (void) const |
Private Attributes | |
| double | taxAdjustedRedemptionValue |
| double | df |
| double | daysRemaining |
| double | diy |
| double | periodicTTF |
| double | ty_df |
| com::ftlabs::fisa::calc::DiscountCalculator::DiscountCalculator | ( | const FISADate & | settlementDate, | |
| const Redemption & | maturity, | |||
| const double | parValue, | |||
| const DayCountBasis & | dayCountBasis, | |||
| const bool | eomAdjust, | |||
| const FISADate * | datedDate, | |||
| const HolidaySchedule * | holidaySchedule | |||
| ) | throw ( com::ftlabs::fisa::calc::CalculationException ) |
| com::ftlabs::fisa::calc::DiscountCalculator::DiscountCalculator | ( | const DiscountCalculator & | calculator | ) |
| com::ftlabs::fisa::calc::DiscountCalculator::~DiscountCalculator | ( | void | ) |
| DiscountCalculator& com::ftlabs::fisa::calc::DiscountCalculator::operator= | ( | const DiscountCalculator & | calculator | ) |
| void com::ftlabs::fisa::calc::DiscountCalculator::setValues | ( | const FISADate & | settlementDate, | |
| const Redemption & | maturity, | |||
| const double | parValue, | |||
| const DayCountBasis & | dayCountBasis, | |||
| const bool | eomAdjust, | |||
| const FISADate * | datedDate, | |||
| const HolidaySchedule * | holidaySchedule | |||
| ) | throw ( com::ftlabs::fisa::calc::CalculationException ) |
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateCurrentYield | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate current yield for the given price.
| price | a price |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateYield | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate yield for the given price.
| price | a price |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculatePrice | ( | double | yield | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate price for the given yield.
| yield | a yield |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateAccruedInterest | ( | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate the accrued interest to the settlement date.
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::getInterest | ( | int | cashFlowIndex | ) | const [virtual] |
Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::getPrincipal | ( | int | cashFlowIndex | ) | const [virtual] |
Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::getTimeToFlow | ( | int | cashFlowIndex | ) | const [virtual] |
Get the time to flow for a particular cashflow, as specified by cashFlowIndex.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::getPeriodicTimeToFlow | ( | int | cashFlowIndex | ) | const [virtual] |
Get the periodic time to flow as calculated with an actual day count method for a particular cashflow, as specified by cashFlowIndex. This value is generally used in actual convexity and duration methods.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculatePriceValue1BP | ( | double | price, | |
| double | yield | |||
| ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate the average price value obtained by varying the yield up and down one basis point.
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateYieldValue1_32 | ( | double | pv1b | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate the average yield value obtained by varying the price up and down 1/32.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateEstimatedMacaulayDuration | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate an estimated Macaulay duration.
This is usually faster than the actual Macaulay duration method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateEstimatedModifiedDuration | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate an estimated modified duration.
This is usually faster than the actual modified duration method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateEstimatedModifiedDuration | ( | double | duration, | |
| double | yield | |||
| ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate the estimated modified duration.
| duration | an estimated Macaulay Duration as returned from calculateEstimatedMacaulayDuration. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateEstimatedConvexity | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate an estimated convexity.
This is usually faster than the actual convexity method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::DiscountCalculator::calculateTrueYield | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate a True Yield, using adjusting cashflows that fall on business days.
Cashflow dates are adjusted according to a provided HolidaySchedule and/or weekend days.
| price | the clean price. |
Reimplemented from com::ftlabs::fisa::calc::OneCashFlowCalculator.
| virtual double com::ftlabs::fisa::calc::DiscountCalculator::calculatePriceFromDiscount | ( | double | discount | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate price from discount.
| discount | The discount rate. |
| virtual double com::ftlabs::fisa::calc::DiscountCalculator::calculateDiscount | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate a discount value from a given price.
| price | The price. |
| virtual double com::ftlabs::fisa::calc::DiscountCalculator::calculateCEY | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate a coupon equivalent yield (CEY) from the given price.
If datedDate is present, then the number of days in a year is counted as a 1 year period forward from the dated date. Otherwise, it is a 1 year period backward from the maturity date.
| price | The price as a percentage of par. |
| virtual double com::ftlabs::fisa::calc::DiscountCalculator::calculateBEY | ( | double | price | ) | const throw ( com::ftlabs::fisa::calc::CalculationException ) [virtual] |
Calculate a bond equivalent yield (BEY) from the given price.
If datedDate is present, then the number of days in a year is counted as the 1 year period forward from the dated date. Otherwise, it is the 1 year period backward from the maturity date.
| price | The price as a percentage of par. |
| virtual Calculator* com::ftlabs::fisa::calc::DiscountCalculator::clone | ( | void | ) | const [virtual] |
Implements com::ftlabs::fisa::calc::Calculator.
double com::ftlabs::fisa::calc::DiscountCalculator::df [private] |
double com::ftlabs::fisa::calc::DiscountCalculator::daysRemaining [private] |
double com::ftlabs::fisa::calc::DiscountCalculator::diy [private] |
double com::ftlabs::fisa::calc::DiscountCalculator::periodicTTF [private] |
double com::ftlabs::fisa::calc::DiscountCalculator::ty_df [private] |
1.5.2