# FinancePy
FinancePy is a python-based library that is currently in beta version. It covers the following functionality:
* Valuation and risk models for a wide range of equity, FX, interest rate and credit derivatives.
Although it is written entirely in Python, it can achieve speeds comparable to C++ by using Numba. As a result the user has both the ability to examine the underlying code and the ability to perform pricing and risk at speeds which compare to a library written in C++.
The target audience for this library includes:
* Students wishing to learn derivative pricing and Python.
* Professors wishing to teach derivative pricing and Python.
* Traders wishing to price or risk-manage a derivative.
* Quantitative analysts seeking to price or reverse engineer a price.
* Risk managers wishing to replicate and understand a price.
* Portfolio managers wishing to check prices or calculate risk measures
* Fund managers wanting to value a portfolio or examine a trading strategy
* Structurers or financial engineers seeking to examine the pricing of a derivative structure.
Users should have a good, but not advanced, understanding of Python. In terms of Python, the style of the library has been determined subject to the following criteria:
1. To make the code as simple as possible so that those with a basic Python fluency can understand and check the code.
2. To keep all the code in Python so users can look through the code to the lowest level.
3. To offset the performance impact of (2) by leveraging Numba to make the code as fast as possible without resorting to Cython.
4. To make the design product-based rather than model-based so someone wanting to price a specific product can easily find that without having to worry too much about the model – just use the default – unless they want to. For most products, a Monte-Carlo implementation has been provided both as a reference for testing and as a way to better understand how the product functions in terms of payments, their timings and conditions.
5. To make the library as complete as possible so a user can find all their required finance-related functionality in one place. This is better for the user as they only have to learn one interface.
6. To avoid complex designs. Some code duplication is OK, at least temporarily.
7. To have good documentation and easy-to-follow examples.
8. To make it easy for interested parties to contribute.
In many cases the valuations should be close to if not identical to those produced by financial systems such as Bloomberg. However for some products, larger value differences may arise due to differences in date generation and interpolation schemes. Over time it is hoped to reduce the size of such differences.
Important Note:
* IF YOU HAVE ANY PRICING OR RISK EXAMPLES YOU WOULD LIKE REPLICATED, SEND SCREENSHOTS OF ALL THE UNDERLYING DATA, MODEL DETAILS AND VALUATION.
* IF THERE IS A PRODUCT YOU WOULD LIKE TO HAVE ADDED, SEND ME THE REQUEST.
* IF THERE IS FUNCTIONALITY YOU WOULD LIKE ADDED, SEND ME A REQUEST.
Contact me at allmypythonprojects@gmail.com.
## Quick Start Guide
FinancePy can be installed from pip using the command:
`pip install financepy`
To upgrade an existing installation type:
`pip install --upgrade financepy`
You can then access a set of Jupyter Notebooks on at Github
<https://github.com/domokane/FinancePy-Examples>
Note that the first import of the library may take over 10 seconds as Numba compiles all of the imported module functions with a Numba decorator - this makes certain python functions run at speeds comparable with the C programming language. These compiled functions are then cached locally. Thereafter FinancePy should load almost instantly.
Download a zipped version by clicking on the green button and selecting Download ZIP.
A pdf manual describing all of the functions can be found at the same repository.
## The Library Design
The underlying Python library is split into a number of major modules:
* Finutils - These are utility functions used to assist you with modelling a security. These include dates (FinDate), calendars, schedule generation, some finance-related mathematics functions and some helper functions.
* Market - These are modules that capture the market information used to value a security. These include interest rate and credit curves, volatility surfaces and prices.
* Models - These are the low-level models used to value derivative securities ranging from Black-Scholes to complex stochastic volatility models.
* Products - These are the actual securities and range from Government bonds to Bermudan swaptions.
Any product valuation is the result of the following data design:
**VALUATION** = **PRODUCT** + **MODEL** + **MARKET**
The interface to each product has a value() function that will take a model and market to produce a price.
## Author
Dominic O'Kane. I am a Professor of Finance at the EDHEC Business School in Nice, France. I have 12 years of industry experience and 10 years of academic experience.
## Dependencies
FinancePy depends on Numpy, Numba, Scipy and basic python libraries such as os, sys and datetime.
## Changelog
See the changelog for a detailed history of changes
## Contributions
Contributions are very welcome. There are a number of requirements:
* You should use CamelCase i.e. variables of the form optionPrice
* Comments are required for every class and function and they should be clear
* At least one test case must be provided for every function
* Follow the style of the code as currently written. This may change over time but please use the current style as your guide.
## Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## License
MIT
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
PyPI 官网下载 | financepy-0.180.tar.gz (133个子文件)
setup.cfg 42B
README.md 6KB
sobolcoeff.npz 118KB
PKG-INFO 8KB
PKG-INFO 8KB
FinModelRatesHW.py 49KB
FinModelRatesBK.py 37KB
FinModelRatesLMM.py 33KB
FinCDS.py 32KB
FinModelRatesBDT.py 29KB
FinEquityAsianOption.py 29KB
FinBondConvertible.py 26KB
FinBond.py 24KB
FinFXVanillaOption.py 24KB
FinLiborSwap.py 23KB
FinLiborCurve.py 21KB
FinDate.py 20KB
FinBondFRN.py 20KB
FinFXVolSurface.py 20KB
FinEquityOneTouchOption.py 19KB
FinCDSIndexPortfolio.py 19KB
FinMath.py 18KB
FinEquityBarrierOption.py 18KB
FinEquityVanillaOption.py 17KB
FinLiborLMMProducts.py 17KB
FinLiborSwaption.py 17KB
FinEquityCompoundOption.py 16KB
FinDiscountCurve.py 16KB
FinLiborCapFloor.py 15KB
FinFXBarrierOption.py 15KB
FinCalendar.py 14KB
FinProcessSimulator.py 14KB
FinHelperFunctions.py 14KB
FinCDSIndexOption.py 14KB
FinModelHeston.py 14KB
FinModelGaussianCopula1F.py 13KB
FinCDSBasket.py 13KB
FinOIS.py 11KB
FinLiborCallableSwap.py 11KB
FinEquityRainbowOption.py 11KB
FinEquityVarianceSwap.py 10KB
FinFXRainbowOption.py 10KB
FinDayCount.py 10KB
FinBondEmbeddedOption.py 10KB
FinModelRatesCIR.py 9KB
FinEquityBasketOption.py 9KB
FinEquityFixedLookbackOption.py 9KB
FinFXVarianceSwap.py 9KB
FinLiborBermudanSwaption.py 9KB
FinCDSTranche.py 9KB
FinCDSCurve.py 9KB
FinFXFixedLookbackOption.py 8KB
FinEquityBinomialTree.py 8KB
FinSchedule.py 8KB
FinEquityFloatLookbackOption.py 8KB
FinEquityChooserOption.py 8KB
FinBondAnnuity.py 8KB
FinDiscountCurveNSS.py 7KB
FinLiborCapVolCurve.py 7KB
FinEquityDigitalOption.py 7KB
FinGBMProcess.py 7KB
FinBondZeroCurve.py 7KB
FinFXBasketOption.py 7KB
FinFXFloatLookbackOption.py 7KB
FinModelCRRTree.py 7KB
FinCDSOption.py 7KB
FinBondYieldCurve.py 7KB
FinEquityCliquetOption.py 7KB
FinLiborDeposit.py 7KB
FinDiscountCurveNS.py 7KB
FinLiborFRA.py 6KB
FinBondMortgage.py 6KB
FinModelGaussianCopulaLHP.py 6KB
FinDiscountCurvePoly.py 6KB
FinInterpolate.py 6KB
FinBondOption.py 6KB
FinBondFuture.py 6KB
FinDiscountCurvePWF.py 6KB
FinLiborFuture.py 6KB
FinDiscountCurvePWL.py 6KB
FinFXForward.py 6KB
FinBondYieldCurveModel.py 6KB
FinModelSABRShifted.py 6KB
FinModelLHPlus.py 6KB
FinDiscountCurveZeros.py 5KB
FinDiscountCurveFlat.py 5KB
FinModelSABR.py 5KB
FinEquityOption.py 5KB
FinEquityAmericanOption.py 5KB
FinFXDigitalOption.py 5KB
FinSobol.py 5KB
FinFXMktConventions.py 5KB
FinFXOption.py 5KB
FinBondMarket.py 4KB
FinModelLossDbnBuilder.py 4KB
FinMertonCreditModel.py 4KB
FinModelRatesHL.py 4KB
FinModelRatesVasicek.py 3KB
FinModelBlack.py 3KB
FinModelBlackShifted.py 3KB
共 133 条
- 1
- 2
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功