Skip to content

Commit

Permalink
ENH: add non-deliverable forward
Browse files Browse the repository at this point in the history
  • Loading branch information
attack68 committed Jan 25, 2025
1 parent e60c533 commit da63d94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/rateslib/periods/cashflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def __init__(
fixing_date: datetime,
fx_rate: DualTypes_ = NoInput(0),
fx_fixing: DualTypes_ = NoInput(0),
reversed: bool = False,
reversed: bool = False, # noqa: A002
):
self.notional = notional
self.settlement = settlement
Expand Down
6 changes: 3 additions & 3 deletions python/tests/test_periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2845,13 +2845,13 @@ def test_npv(self, fxf_ndf):

def test_npv_reversed(self, fxf_ndf):
ndf = NonDeliverableCashflow(
notional=1e6*0.18,
notional=1e6 * 0.18,
reference_currency="brl",
settlement_currency="usd",
settlement=dt(2025, 6, 1),
fixing_date=dt(2025, 5, 29),
fx_rate=1/0.18,
reversed=True
fx_rate=1 / 0.18,
reversed=True,
)
result = ndf.npv(disc_curve=fxf_ndf.curve("usd", "usd"), fx=fxf_ndf)
expected = -1e6 * (0.20131018767289705 - 0.18) * 0.9855343095437953
Expand Down

0 comments on commit da63d94

Please sign in to comment.