Comments (8)
Hi @domokane is this issue still open? I am currently reading Schreve's book and am interested to actively contribute to FinancePy and strengthen my technical skills.
from financepy.
Yes. You're welcome to to do it. Let me know how it goes.
Best
D
from financepy.
Hi @domokane
Is the product.bonds.bond_portfolio.py for this issue? It's not implemented yet. So the goal of this issue is to implement the bond_portfolio.py?
from financepy.
Exactly. If you wish to have a go, be my guest. Ultimate idea would be to have a portfolio object that you can use to analyse multi-bonds for hedging and scenario analysis and curve fitting.
from financepy.
I am thinking about a method of computing the profit of a Bond given the inital ytm and final ytm.
It should look like this:
def get_profit(self, initial_date, end_date, begin_ytm, end_ytm):
It adds all the cashflow during the period and calculate the simple return and compounded return.
Where should I put this method?
from financepy.
I also would like to work on this. But before that someone with more strategic view should implement base bond class and other bonds should inherit from that base.
Base bond class should have at least the following attributes
"Currency"
"Issue Date"
"Interest Accrues" - sometimes it can be later or before than issue date
"Maturity Date"
"Floater Formula"
"Security identifier" -- at least ISIN
Then the Portfolio class should have a base currency.
If I implement, for example,
if not bondWeights:
#calculate the sum of bond dirty prices
#calculate weight of each bond
#return ndarray bondWights
if in the future there will be multicurrency portfolio, the code will need to change again.
@domokane please let me know if should ignore these challenges and work on portfolio class right away.
from financepy.
Hi @sagayev,
product.bonds.Bond is the base class you want, except for the Security Identifier attribute.
However, all types of bonds are implemented individually, not by inheritance. Domokane prefered this way for simplicity.
What's Floater Formula by the way?
from financepy.
Hi - I am not against refactoring the code to have a bond base class. I prefered to keep it separate for the specific case of a zero coupon bond. But if the benefits outweigh the cost then I am happy to reconsider.
from financepy.
Related Issues (20)
- argument type issue - FXVanillaOption with SABR model HOT 3
- Re-generate manual when master is updated HOT 5
- Date Schedule._generate issue HOT 2
- Example of SOFR curve
- Potential issues for CDS pricing HOT 4
- Major implementation change for ibor_swap? A notebook example doesn't tie out anymore. HOT 12
- Bond Curve Fitting HOT 1
- Inconsistency in Day Count in Index Curve? HOT 3
- CDSOption insensitive to vol for Receiver HOT 4
- Division with wrong day count convention causes incorrect forward rates HOT 1
- Bond OAS and accrued interest HOT 2
- barrierOpt.value issue HOT 2
- choose to apply a Black'76 in Fx Vanilla option HOT 1
- Build SOFR curve - suggestions
- Updated FINGBMPROCESS_generatePaths HOT 4
- Backtesting of Strategy HOT 4
- 'bond.print_payments' error HOT 2
- typo in "acccrued"
- Name 'swap_types' is not defined HOT 3
- How to deal with same maturity bonds for bootstrap curve? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from financepy.