amortization
AmortizationRule: generates an amortization transaction on scheduled payment dates.
Classes:
-
AmortizationRule–Generates an AMORTIZATION transaction on each scheduled payment date.
AmortizationRule
Generates an AMORTIZATION transaction on each scheduled payment date.
Methods:
-
applies_to–Return True for LONG positions on a principal payment date.
-
generate–Generate an amortization transaction for the principal payment amount on this date.
applies_to
applies_to(
instrument: Instrument,
position: Position,
context: RuleContext,
) -> bool
Return True for LONG positions on a principal payment date.
LONG: bank receives principal (Dr Cash / Cr Loans). Skips dates on or before acquisition (pre-acquisition payments).
generate
generate(
instrument: Instrument,
position: Position,
context: RuleContext,
) -> list[Transaction]
Generate an amortization transaction for the principal payment amount on this date.