curo library

Classes

Act360
The Actual/360 day count convention which specifies that the number of days in the Calculation Period or Compounding Period in respect of which payment is being made is divided by 360.
Act365
The Actual/365 day count convention which specifies that the number of days in the Calculation Period or Compounding Period in respect of which payment is being made is divided by 365.
ActISDA
The Actual/ISDA day count convention which follows the ISDA understanding of the actual/actual convention included in the 1991 ISDA Definitions.
Calculator
The calculator class provides the entry point for solving unknown values and/or unknown interest rates implicit in a cash flow series.
CashFlow
Represents the movement of money, inbound or outbound.
CashFlowAdvance
Represents the movement of money, specifically the cash out flows of a lender, for example the amounts advanced under a loan or leasing arrangement.
CashFlowCharge
Represents the movement of money, specifically non-interest bearing cash in-flows to the lender, for example cash-based charges or fees. The value of these cash flows must be specified i.e. they cannot be null or unknown.
CashFlowPayment
Represents the movement of money, specifically interest bearing cash in-flows to the lender, for example loan repayments or lease rentals.
Convention
Defines the contract for day count convention concrete implementations.
DayCountFactor
The day count factor applied to the associated cash flow.
EU200848EC
The European Union Directive 2008/48/EC (Consumer Credit Directive) day count convention, used exclusively within EU member states in the computation of the Annual Percentage Rate of Charge (APRC) for consumer credit agreements.
EU30360
The 30/360 (EU) day count convention which specifies that the number of days in the Calculation or Compounding Period in respect of which payment is being made is divided by 360, calculated on a formula basis as follows:
Profile
A container for a series of cash in-flows and out-flows.
SeriesAdvance
A series of one or more advances paid out by a lender. This could comprise a series of amounts loaned to a borrower, the lessor's net investment in a lease agreement, etc.
SeriesCharge
A series of one or more charges or fees received by a lender. These are non-financing cash flows which are excluded from the computation of unknown advance or payment cash flow values, but are included under certain circumstances in other calculations for instance the computation of implicit interest rates such as Annual Percantage Rates (APRs), as documented elsewhere.
SeriesPayment
A series of one or more loan payments, lease rentals, etc., received by a lender.
US30360
The 30/360 (US) day count convention which specifies that the number of days in the Calculation Period or Compounding Period in respect of which payment is being made is divided by 360, calculated on a formula basis as follows:
US30U360
The 30U/360 day count convention is similar to the US30360 day count convention and differs only in how days in February are treated.

Enums

DayCountOrigin
The day count origin demarcates the start date used in determining the number of days in a time period. Time periods are computed with reference to:
EUTimePeriod
Frequency
Frequency demarcates the compounding period between two cash flows. Options are:
Mode
Mode determines whether a cash flow occurs at the start or end of the compounding period demarcated by cash flow frequency. The options are:

Constants

daysInMonth → const List<int>
Number of days in each month starting January (non leap year)

Functions

actualDays(DateTime date1, DateTime date2) int
Compute the actual number of days between two dates.
gaussRound(double num, [int precision = 0]) double
Perform gaussian rounding, also known as “bankers” rounding, convergent rounding, Dutch rounding, or odd–even rounding. This is a method of rounding without statistical bias; regular rounding has a native upwards bias. Gaussian rounding avoids this by rounding to the nearest even number.
hasLeapYear(int yearFrom, int yearTo) bool
Check if a particular range of years contains a leap-year.
hasMonthEndDay(DateTime date) bool
Check if a date contains a month end day.
isLeapYear(int year) bool
Check if a year is a leap year.
rollDate(DateTime dateToRoll, Frequency frequency, [int? dayPref]) DateTime
Roll a date forward by the period implicit in the provided frequency.
rollDay(DateTime dateToRoll, int numDays) DateTime
Roll a date by the number of days specified.
rollMonth(DateTime dateToRoll, int numMonths, [int? dayPref]) DateTime
Roll a date by the number of months specified.
utcDate(DateTime dateTime) DateTime
Provides an Utc DateTime instance with only the date fields initialised.

Exceptions / Errors

UnsolvableException
Exception thrown when the unknown cash flow values or interest rate implicit in a cash flow series cannot be solved within a finite number of iterations.