Skip to content

Commit d18121b

Browse files
committed
expose bondPrinLoss/bondIntLoss in stop
1 parent 2c70aef commit d18121b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

absbox/rootFinder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def mkStop(x):
1818
match x:
1919
case ("bondIncurLoss", bn):
2020
return mkTag(("BondIncurLoss", vStr(bn)))
21+
case ("bondIncurPrinLoss", bn, amt):
22+
return mkTag(("BondIncurPrinLoss", [vStr(bn), amt]))
23+
case ("bondIncurIntLoss", bn, amt):
24+
return mkTag(("BondIncurIntLoss", [vStr(bn), amt]))
2125
case ("bondPricingEqOriginBal", bn, f1, f2):
2226
return mkTag(("BondPricingEqOriginBal", [vStr(bn), f1, f2] ))
2327
case ("bondMetTargetIrr", bn, irr):

docs/source/analytics.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2251,11 +2251,24 @@ Stop Condition
22512251
"""""""""""""""""""""
22522252
22532253
Bond Incur Loss
2254-
The search stop when a bond incur a loss of 0.01
2254+
The search stop when a bond incur a loss of 0.01 (outstanding bond principal or interest due amount)
22552255
22562256
syntax
22572257
``("bondIncurLoss", <bondName>)``
22582258
2259+
Bond Principal Incur Loss
2260+
The search stop when a bond incur a loss of ``threshold`` on principal amount.
2261+
2262+
syntax
2263+
``("bondIncurPrinLoss", <bondName>, <threshold>)``
2264+
2265+
Bond Interest Incur Loss
2266+
The search stop when a bond incur a loss of ``threshold`` on interest due amount.
2267+
2268+
syntax
2269+
``("bondIncurIntLoss", <bondName>, <threshold>)``
2270+
2271+
22592272
Bond Pricing Equals to Face
22602273
The search stop when a bond pricing equals to face value.
22612274

0 commit comments

Comments
 (0)