interest
InterestPaymentRule: generates interest payment transactions on scheduled payment dates.
Classes:
-
InterestPaymentRule–Generates a COUPON_PAYMENT transaction on each scheduled coupon date using instrument terms.
InterestPaymentRule
Generates a COUPON_PAYMENT transaction on each scheduled coupon date using instrument terms.
Methods:
-
applies_to–Return True if a payment date falls in the (previous_date, date] window.
-
generate–Generate an interest payment transaction (face_value * coupon_rate / 2).
applies_to
applies_to(
instrument: Instrument,
_position: Position,
context: RuleContext,
) -> bool
Return True if a payment date falls in the (previous_date, date] window.
Supports instruments with a payment_schedule() method returning
(date, amount) tuples or a tuple of 3 lists, as well as instruments
with a plain coupon_dates attribute.
generate
generate(
instrument: Instrument,
position: Position,
context: RuleContext,
) -> list[Transaction]
Generate an interest payment transaction (face_value * coupon_rate / 2).