All Projects → domokane → Financepy

domokane / Financepy

Licence: gpl-3.0
A Python Finance Library that focuses on the pricing and risk-management of Financial Derivatives, including fixed-income, equity, FX and credit derivatives.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Financepy

Machine Learning For Trading
Code for Machine Learning for Algorithmic Trading, 2nd edition.
Stars: ✭ 4,979 (+1096.88%)
Mutual labels:  jupyter-notebook, finance, investment
Pyportfolioopt
Financial portfolio optimisation in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity
Stars: ✭ 2,502 (+501.44%)
Mutual labels:  jupyter-notebook, finance, investment
tellerbot
Telegram Bot for over-the-counter trading
Stars: ✭ 17 (-95.91%)
Mutual labels:  finance, currency
GOAi
No description or website provided.
Stars: ✭ 57 (-86.3%)
Mutual labels:  finance, investment
simulatePortfolio
class for simulation of stock investing portfolios based on historical data
Stars: ✭ 18 (-95.67%)
Mutual labels:  finance, investment
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-93.75%)
Mutual labels:  finance, currency
Beibo
🤖 Predict the stock market with AI 用AI预测股票市场
Stars: ✭ 46 (-88.94%)
Mutual labels:  finance, investment
investbook
Оценка эффективности инвестиций с учетом комиссий, налогов (удержанных и ожидающихся), дивидендов и купонов.
Stars: ✭ 83 (-80.05%)
Mutual labels:  finance, investment
salaryconverter
Equivalent salary converter using PPP
Stars: ✭ 42 (-89.9%)
Mutual labels:  finance, currency
Thstrader
量化交易。同花顺免费模拟炒股软件客户端的python API。(Python3)
Stars: ✭ 311 (-25.24%)
Mutual labels:  jupyter-notebook, finance
Akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 4,334 (+941.83%)
Mutual labels:  finance, currency
py-investment
Extensible Algo-Trading Python Package.
Stars: ✭ 19 (-95.43%)
Mutual labels:  finance, investment
DCF
Basic Discounted Cash Flow library written in Python. Automatically fetches relevant financial documents for chosen company and calculates DCF based on specified parameters.
Stars: ✭ 198 (-52.4%)
Mutual labels:  finance, investment
akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 5,155 (+1139.18%)
Mutual labels:  finance, currency
currency
A currency computations package.
Stars: ✭ 52 (-87.5%)
Mutual labels:  finance, currency
FinanceKit
FinanceKit is a Framework for iOS and Mac to build apps working with financial data, like money, currencies, stocks, portfolio, transactions and other concepts.
Stars: ✭ 15 (-96.39%)
Mutual labels:  finance, currency
Financeops
Research in investment finance with Python Notebooks
Stars: ✭ 378 (-9.13%)
Mutual labels:  jupyter-notebook, finance
Academiccontent
Free tech resources for faculty, students, researchers, life-long learners, and academic community builders for use in tech based courses, workshops, and hackathons.
Stars: ✭ 2,196 (+427.88%)
Mutual labels:  jupyter-notebook, students
bankster
Money Creation Made Easy
Stars: ✭ 30 (-92.79%)
Mutual labels:  finance, currency
Riskfolio Lib
Portfolio Optimization and Quantitative Strategic Asset Allocation in Python
Stars: ✭ 305 (-26.68%)
Mutual labels:  finance, investment

Quick Start Guide

FinancePy can be installed from pip using the following command:

pip install financepy

To upgrade an existing installation type:

pip install --upgrade financepy

I have encountered problems using Anaconda3-2020.07 due to some Numba and LLVMLite problems. However Anaconda3-2020.02 works.

Using FinancePy in a Jupyter Notebook

Once financepy has been installed, it is easy to get started.

Just download the project and examine the set of Jupyter Notebooks in the notebooks folder.

A pdf manual describing all of the functions can be found in the project directory.

Overview

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 of finance and students of python
  • Academics teaching finance or conducting research into finance
  • 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 price sensitivity.
  • Portfolio managers wishing to check prices or calculate risk measures.
  • Fund managers wanting to value a portfolio or examine a trading strategy.

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. Limited inheritance unless it allows for significant code reuse. 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 [email protected].

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 can use either camel case or snail case. At some point I will try to make the code Pep8 compliant. But not yet.
  • Comments are required for every class and function and they should be a clear description.
  • At least one test case must be provided for every function.
  • Avoid very pythonic constructions. For example a loop is as good as a list comprehension. And with numba it can be faster. Readability is the priority.

License

GPL-3.0 License - See the license file in this folder for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].