Package tech.nmfin.returns
Interface ReturnsCalculator
-
- All Known Implementing Classes:
ReturnsCalculators
public interface ReturnsCalculatorThis interface defines how return is computed from two values of a portfolio.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublecomputePrice(double px0, double r)Computes the next price after a return.doublecomputeReturn(double p0, double p1)Computes the portfolio return.
-
-
-
Method Detail
-
computeReturn
double computeReturn(double p0, double p1)Computes the portfolio return.- Parameters:
p0- the beginning value of the portfoliop1- the ending value of the portfolio- Returns:
- the return value
-
computePrice
double computePrice(double px0, double r)Computes the next price after a return.- Parameters:
px0- the original pricer- the return- Returns:
- the new price
-
-