Git Product home page Git Product logo

pybg's People

Contributors

alprionprime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pybg's Issues

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 after-tax-yield calculations

Two scenarios:

  1. taxable bond
  2. 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 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

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

Add Yield Scale Class

Take a set of single credit instruments, callable or noncall, with OAS information, and construct a discount curve.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.