Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion financepy/models/bs_american_analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _value_american(
)

if algo_type is BlackScholesAlgorithmTypes.LEISEN_REIMER:
return _value_leisen_reimer_tree(
return _value_leisen_reimer(
spot_price,
time_to_expiry,
strike_price,
Expand Down
27 changes: 27 additions & 0 deletions tests/unit/test_equity_american_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,30 @@ def test_american_call():
)

assert round(value, 3) == 8.056


########################################################################################


@pytest.mark.parametrize(
"opt_type, expected",
[
(OptionTypes.AMERICAN_CALL, 8.056),
(OptionTypes.AMERICAN_PUT, 7.254),
],
)
def test_american_leisen_reimer(opt_type, expected):
"""The Leisen-Reimer tree can be selected for American exercise."""

option = EquityAmericanOption(expiry_dt, strike_price, opt_type)

value = option.value(
value_dt,
stock_price,
discount_curve,
dividend_curve,
model,
algo_type=BlackScholesAlgorithmTypes.LEISEN_REIMER,
)

assert round(value, 3) == expected
Loading