pybg's People
pybg's Issues
Add after-tax-yield calculations
Two scenarios:
- taxable bond
- tax-exempt bond subject to Accrued Market Discount taxation
- any market discount, i.e. the discount in excess of the OID, is subject taxation as ordinary income at maturity. The accrued portion is taxed if the bond is sold prior to maturity. If the market discount is "de minimus" defined as less than 1/4 point per integer number of years to maturity, the accrued discount is treated as a capital gain.
BondBase class variables:
- bond interest tax-exempt flag
Settings variables:
- capital gains tax rate
- income tax rate
- deminimus points per year
Windows build
Visual Studio 2008 test build
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /O2 /Oi /GL /I "c:\QuantLib\QuantLib-1.2" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_SCL_SECURE_NO_DEPRECATE"
/D "_CRT_SECURE_NO_DEPRECATE" /D "_UNICODE" /D "UNICODE"
/FD /EHsc /MD /Gy /Yc"stdafx.h" /Fp"Release\TestingQuantLib.pch" /Fo"Release"
/Fd"Release\vc90.pdb" /W3 /c /Zi /TP ".\stdafx.cpp"
stdafx.cpp
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /O2 /Oi /GL /I "c:\QuantLib\QuantLib-1.2" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_SCL_SECURE_NO_DEPRECATE"
/D "_CRT_SECURE_NO_DEPRECATE" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp"Release\TestingQuantLib.pch"
/Fo"Release" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP ".\TestingQuantLib.cpp"
TestingQuantLib.cpp
Linking...
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
"/OUT:C:\Users\Bart\Documents\Visual Studio 2008\Projects\TestingQuantLib\Release\TestingQuantLib.exe"
/INCREMENTAL:NO "/LIBPATH:C:\QuantLib\QuantLib-1.2\lib"
/MANIFEST "/MANIFESTFILE:Release\TestingQuantLib.exe.intermediate.manifest"
"/MANIFESTUAC:level='asInvoker' uiAccess='false'"
/DEBUG "/PDB:C:\Users\Bart\Documents\Visual Studio 2008\Projects\TestingQuantLib\Release\TestingQuantLib.pdb"
/SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG
/DYNAMICBASE /NXCOMPAT /MACHINE:X86 kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib
".\Release\stdafx.obj"
".\Release\TestingQuantLib.obj"
Generating code
Finished generating code
Cython Build
building 'pybg.quantlib.quotes' extension
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -DHAVE_CONFIG_H -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -D
NOMINMAX -DWINNT -D_WINDLL -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_WARNINGS "-IC:\Program Files (x86)\boost\boost_1_47" -IC:\Quan
tLib\QuantLib-1.2 -I. -IC:\Python27\include -IC:\Python27\PC /Tppybg/quantlib/qu
otes.cpp /Fobuild\temp.win32-2.7\Release\pybg/quantlib/quotes.obj /GR /FD /Zm250
/EHsc
quotes.cpp
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:C:\QuantLib\QuantLib-1.2\lib "/LIBPATH:C:\Program Files
(x86)\boost\boost_1_47\lib" /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbu
ild /EXPORT:initquotes build\temp.win32-2.7\Release\pybg/quantlib/quotes.obj /OU
T:C:\Users\Bart\Documents\GitHub\pybg\pybg\quantlib\quotes.pyd /IMPLIB:build\tem
p.win32-2.7\Release\pybg/quantlib\quotes.lib /MANIFESTFILE:build\temp.win32-2.7
Release\pybg/quantlib\quotes.pyd.manifest /subsystem:windows /machine:x86
Creating library build\temp.win32-2.7\Release\pybg/quantlib\quotes.lib and ob
ject build\temp.win32-2.7\Release\pybg/quantlib\quotes.exp
Refactor BGInstruments to InstrumentBase & Add BondBase
Bond Base will house basic bond functions (toPrice/toYield), after-tax-yield calculations
create unit tests for bond calculations
CallBond: Add yield to worst calculations
bg/instruments/callbond.hpp &.cpp
Add support for Yield to Worst calculations.
- given yield, calculate price based on yield to call for the call that gives the worst price
- given price, calculate yield to call for the call the gives the worst yield.
- iterate through call schedule for all declining calls (yield to worst date will be shortest date with the same price)
CallBond: Add option-free price.
Add Yield Scale Class
Take a set of single credit instruments, callable or noncall, with OAS information, and construct a discount curve.
Add original issue discount support to bond classes
Windows build fails
```Error compiling Cython file:
raise ValueError(
'Interpolator must be one of {}'.format(VALID_INTERPOLATORS)
)
# convert rate_helpers list to std::vetor
cdef vector[shared_ptr[RateHelper]]* curve_inputs = new vector[shared_ptr[RateHelper]]()```
pybg\quantlib\termstructures\yields\piecewise_yield_curve.pyx:38:78: Python object type 'RateHelper' cannot be used as a template argument Traceback (most recent call last): File "setup_win.py", line 90, in <module> for extname, extsources in extension_paths_lib File "c:\Anaconda64\lib\site-packages\Cython\Build\Dependencies.py", line 778, in cythonize cythonize_one(*args[1:]) File "c:\Anaconda64\lib\site-packages\Cython\Build\Dependencies.py", line 895, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: pybg/quantlib/termstructures/yields/piecewise_yield_curve.pyx make: *** [build_win] Error 1
Add BondHelper Curve
Add to RateHelperCurve...should be able to handle a curve consisting of TBills, Notes & Bonds, or a curve consisting of municipal bonds or corporate bonds for a single credit.
Assume all input instruments are not callable
Add tests
Add sinking fund, amortizing premium to CallBond
Add DiscountCurve
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.