Skip to content

Commit fc6bdb3

Browse files
committed
add irr to doc
1 parent 77d5810 commit fc6bdb3

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

docs/source/analytics.rst

+34-3
Original file line numberDiff line numberDiff line change
@@ -1023,10 +1023,10 @@ to view results
10231023
10241024
r['result']['report']['cash']
10251025
1026-
Pricing
1027-
^^^^^^^^^^^
1026+
Pricing & IRR
1027+
^^^^^^^^^^^^^^^^
10281028

1029-
* User can provide a pricing curve and a pricing data to argument `pricing`,which all future bond cashflow will be discounted at that date with the curve provided.
1029+
* User can provide a pricing curve and a pricing data to argument `pricing`,which all future bond cashflows will be discounted at that date with the curve provided.
10301030

10311031
.. code-block:: python
10321032
@@ -1048,6 +1048,37 @@ bond cashflow equals to ``<price>``
10481048
,"curve":[["2021-01-01",0.025]
10491049
,["2024-08-01",0.025]]})
10501050
1051+
* Calculate IRR of bonds
1052+
1053+
.. versionadded:: 0.42.4
1054+
1055+
User shall input a dict with solo key ``IRR`` and value is a dict with bond name and ``IRR calculate assumption``
1056+
1057+
.. code-block:: python
1058+
1059+
("pricing"
1060+
,{"IRR":
1061+
{"B":<IRR calculate assumption>
1062+
}
1063+
}
1064+
)
1065+
1066+
IRR calculate assumption
1067+
It has three types
1068+
1069+
* Holding a bond to maturity
1070+
``("holding",[<history of cashflow of investment>], <position size>)``
1071+
1072+
``{"B":("holding",[("2021-04-01",-500)],500)``
1073+
* Holding a bond and sell it at a future date
1074+
``("holding",[<history of cashflow of investment>],<position size>,<sell date>,<sell price>)}``
1075+
1076+
``("holding",[("2021-04-01",-500)],500,"2021-08-19",("byFactor",1.0))}``
1077+
* Buy a bond at a future date and hold it to maturity
1078+
``("buy",<buy date>,<buy price>,<cash to buy>)``
1079+
1080+
``("buy","2021-08-01",("byFactor",0.99),("byCash",200))``
1081+
10511082
Mannual Fire Trigger
10521083
^^^^^^^^^^^^^^^^^^^^^^^^
10531084

0 commit comments

Comments
 (0)