Actual/360
Bases: Convention
Implements the Actual/360 day count convention.
Counts the actual number of days between two dates, excluding the end date, and
divides by 360 to compute the year fraction. Suitable for compound interest
calculations and XIRR when use_xirr_method is True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_post_dates
|
bool
|
If True, uses cash flow post dates for day counts; if False, uses value dates. Defaults to True. |
True
|
include_non_financing_flows
|
bool
|
If True, includes non-financing cash flows (e.g., fees) in factor computations; if False, excludes them. Defaults to False. |
False
|
use_xirr_method
|
bool
|
If True, uses the XIRR method, setting day count origin to DRAWDOWN; if False, uses NEIGHBOUR. Defaults to False. |
False
|
Examples:
>>> dc = Actual360()
>>> factor = dc.compute_factor(
... pd.Timestamp('2020-01-28', tz='UTC'),
... pd.Timestamp('2020-02-28', tz='UTC')
... )
>>> print(factor)
f = 31/360 = 0.08611111
Source code in curo/daycount/actual_360.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
compute_factor(start, end)
Computes the year fraction between two dates using Actual/360.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
Timestamp
|
The earlier date (pd.Timestamp). |
required |
end
|
Timestamp
|
The later date (pd.Timestamp). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DayCountFactor |
DayCountFactor
|
The year fraction (days / 360) with operand log. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
>>> dc = Actual360()
>>> factor = dc.compute_factor(
... pd.Timestamp('2020-01-28', tz='UTC'),
... pd.Timestamp('2020-02-28', tz='UTC')
... )
>>> factor.primary_period_fraction
0.08611111111111111
>>> factor.discount_factor_log
['31/360']
Source code in curo/daycount/actual_360.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |