okama  by mbk-dev

Analyze and optimize investment portfolios with Python

Created 6 years ago
261 stars

Top 97.4% on SourcePulse

GitHubView on GitHub
Project Summary

Okama is a Python library for investment portfolio analysis and optimization, applying quantitative finance principles. It targets analysts and developers needing robust tools for portfolio construction, risk assessment, and forecasting, benefiting from free historical market data and macroeconomic indicators.

How It Works

The library implements core quantitative finance concepts, including constrained Markowitz Mean-Variance Analysis (MVA) and multi-period Efficient Frontier optimization. It supports advanced rebalancing strategies (threshold-based, calendar-based) and handles complex cash flows with Money-weighted internal rate of return (IRR/MWRR). Monte Carlo simulations enable forecasting with various theoretical distributions (normal, lognormal, Student's t), allowing parameter optimization.

Quick Start & Requirements

Installation: pip install okama. Development versions use poetry. Requires Python 3.11+ and core dependencies: pandas, numpy, scipy, matplotlib, pyarrow, statsmodels, arch. Examples are Jupyter Notebooks; try on Google Colab without installation. Documentation: https://okama.readthedocs.io/.

Highlighted Details

  • Multi-period Efficient Frontier optimization with custom rebalancing frequencies.
  • Advanced rebalancing strategies: Rebalancing-bands, Calendar-based, and hybrid approaches.
  • Comprehensive risk metrics (VaR, CVaR, semi-deviation, drawdowns) and financial ratios (CAPE10, Sharpe, Sortino, Dividend Yield).
  • Free end-of-day historical data for global stocks, ETFs, commodities, currencies, and key macroeconomic indicators.
  • Related projects: okama-dash (interactive widgets), okama-mcp (AI integration).

Maintenance & Community

Contributions are encouraged via the Contribution Guide. GitHub Discussions serves for user questions and ideas. A Russian-language community is available on okama.io forums.

Licensing & Compatibility

The README does not specify a software license. This lack of explicit licensing information requires clarification for commercial use, derivative works, and compatibility with closed-source projects.

Limitations & Caveats

The project roadmap indicates ongoing development, with features like multidimensional Monte Carlo simulations and Black-Litterman asset allocation planned. The absence of a stated license is a significant caveat for potential adopters.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
8
Star History
4 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.