Okama Documentation
okama is a library with investment portfolio analyzing & optimization tools. CFA recommendations are used in quantitative finance.
okama goes with free «end of day» historical stock markets data and macroeconomic indicators through API.
…entities should not be multiplied without necessity
– William of Ockham (c. 1287–1347)
Okama main features
Investment portfolio constrained Markowitz Mean-Variance Analysis (MVA) and optimization
Rebalanced portfolio optimization with constraints (multi-period Efficient Frontier)
Investment portfolios with contributions / withdrawals cash flows (DCF)
Monte Carlo Simulations for financial assets and investment portfolios
Popular risk metrics: VAR, CVaR, semi-deviation, variance and drawdowns
Forecasting models according to normal and lognormal distribution
Testing distribution on historical data
Dividend yield and other dividend indicators for stocks
Backtesting and comparing historical performance of broad range of assets and indexes in multiple currencies
Methods to track the performance of index funds (ETF) and compare them with benchmarks
Main macroeconomic indicators: inflation, central banks rates, financial ratios
Matplotlib visualization scripts for the Efficient Frontier, Transition map and assets risk / return performance
Financial data and macroeconomic indicators
okama can be used with free financial data available through API.
End of day historical data
Stocks and ETF for main world markets
Mutual funds
Commodities
Currencies
Stock indexes
Macroeconomic indicators
For several countries (USA, United Kingdom, European Union, Russia, Israel etc.):
Inflation
Central bank rates
CAPE10 (Shiller P/E) Cyclically adjusted price-to-earnings ratios
Other historical data
Real estate prices
Top bank rates
Installation
Okama can be installed from PyPI:
pip install okama
The latest development version can be installed directly from GitHub:
git clone https://github.com/mbk-dev/okama@dev
poetry install
Warning
The development version of okama can have technical and financial issues. Please use carefully at your own risk.
Main classes
Assets & Portfolio
|
A financial asset, that could be used in a list of assets or in portfolio. |
|
The list of financial assets implementation. |
|
Implementation of investment portfolio. |
|
Class to access discounted cash flow (DCF) methods of Portfolio. |
|
Monte Carlo simulation parameters for investment portfolio. |
|
Cash flow strategy with regualr indexed withdrawals or contributions. |
|
Cash flow strategy with regular fixed percentage withdrawals or contributions. |
|
Cash flow strategy with user-defined withdrawals and contributions. |
Efficient Frontier
|
Efficient Frontier with classic Mean-Variance optimization. |
|
Efficient Frontier with multi-period optimization. |
Macroeconomics
|
Inflation related data and methods. |
|
Rates of central banks and banks. |
|
Macroeconomic indicators and ratios. |