All Projects → VivekPa → Optimalportfolio

VivekPa / Optimalportfolio

Licence: mit
An open source library for portfolio optimisation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Optimalportfolio

Machinelearningstocks
Using python and scikit-learn to make stock predictions
Stars: ✭ 897 (+293.42%)
Mutual labels:  algorithmic-trading, quantitative-finance
Moonshot
Vectorized backtester and trading engine for QuantRocket
Stars: ✭ 88 (-61.4%)
Mutual labels:  algorithmic-trading, quantitative-finance
Quant Finance Resources
Courses, Articles and many more which can help beginners or professionals.
Stars: ✭ 36 (-84.21%)
Mutual labels:  algorithmic-trading, quantitative-finance
Mlfinlab
MlFinLab helps portfolio managers and traders who want to leverage the power of machine learning by providing reproducible, interpretable, and easy to use tools.
Stars: ✭ 2,676 (+1073.68%)
Mutual labels:  algorithmic-trading, quantitative-finance
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-42.11%)
Mutual labels:  algorithmic-trading, quantitative-finance
Moonchart
Performance tear sheets and backtest analysis for Moonshot
Stars: ✭ 19 (-91.67%)
Mutual labels:  algorithmic-trading, quantitative-finance
Qtpylib
QTPyLib, Pythonic Algorithmic Trading
Stars: ✭ 1,241 (+444.3%)
Mutual labels:  algorithmic-trading, quantitative-finance
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+96.93%)
Mutual labels:  algorithmic-trading, quantitative-finance
Elitequant
A list of online resources for quantitative modeling, trading, portfolio management
Stars: ✭ 1,823 (+699.56%)
Mutual labels:  algorithmic-trading, quantitative-finance
Zvt
modular quant framework.
Stars: ✭ 1,801 (+689.91%)
Mutual labels:  algorithmic-trading, quantitative-finance
Research
Notebooks based on financial machine learning.
Stars: ✭ 714 (+213.16%)
Mutual labels:  algorithmic-trading, quantitative-finance
Quant Trading
Python quantitative trading strategies including VIX Calculator, Pattern Recognition, Commodity Trading Advisor, Monte Carlo, Options Straddle, Shooting Star, London Breakout, Heikin-Ashi, Pair Trading, RSI, Bollinger Bands, Parabolic SAR, Dual Thrust, Awesome, MACD
Stars: ✭ 2,407 (+955.7%)
Mutual labels:  algorithmic-trading, quantitative-finance
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+3225.44%)
Mutual labels:  algorithmic-trading, quantitative-finance
Stock.indicators
Stock indicator technical analysis library package for .NET. Send in historical price quotes and get back desired technical indicators. Nothing more. It can be used in any market analysis software using standard OHLCV price quotes for equities, commodities, forex, cryptocurrencies, and others. We had private trading algorithms, machine learning, and charting systems in mind when originally creating this community library. Current indicators include: Accumulation/Distribution Line (ADL), Aroon Oscillator, Arnaud Legoux Moving Average (ALMA), Average Directional Index (ADX), Average True Range (ATR), Awesome Oscillator (AO), Balance of Power (BOP), Beta Coefficient, Bollinger Bands®, Chaikin Money Flow (CMF), Chaikin Oscillator, Chandelier Exit, Choppiness Index (CHOP), Commodity Channel Index (CCI), ConnorsRSI, Correlation Coefficient, Donchian Channels, Double Exponential Moving Average (DEMA), Elder-ray Index, Exponential Moving Average (EMA), Force Index, Fractal Chaos Bands (FCB), Gator Oscillator, Heikin-Ashi, Hull Moving Average (HMA), Ichimoku Cloud, Kaufman's Adaptive Moving Average (KAMA), KDJ Index, Keltner Channels, Momentum Oscillator, Money Flow Index (MFI), MESA Adaptive Moving Averages (MAMA), Moving Average Convergence/Divergence (MACD), Moving Average Envelopes, On-balance Volume (OBV), Parabolic SAR (stop and reverse), Percentage Volume Oscillator (PVO), Pivot Points and Rolling Pivot Points, Price Channels, Price (Comparative) Relative Strength (PRS), Price Momentum Oscillator (PMO), Rate of Change (ROC), Relative Strength Index (RSI), R-Squared (Coefficient of Determination), Simple Moving Average (SMA), Slope and Linear Regression, Smoothed Moving Average (SMMA), Standard Deviation, Stoller Average Range Channel (STARC) Bands, Stochastic Oscillator, Stochastic RSI, SuperTrend, Tillson T3 Moving Average, Triple Exponential Moving Average (TEMA), Triple EMA Oscillator (TRIX), True Strength Index (TSI), Ulcer Index, Ultimate Oscillator, Volume Simple Moving Average, Volume Weighted Average Price (VWAP), Vortex Indicator (VI), Weighted Moving Average (WMA), Williams %R, Williams Alligator, Williams Fractal, and Zig Zag.
Stars: ✭ 157 (-31.14%)
Mutual labels:  algorithmic-trading, quantitative-finance
Introneuralnetworks
Introducing neural networks to predict stock prices
Stars: ✭ 486 (+113.16%)
Mutual labels:  algorithmic-trading, quantitative-finance
Aialpha
Use unsupervised and supervised learning to predict stocks
Stars: ✭ 1,191 (+422.37%)
Mutual labels:  algorithmic-trading, quantitative-finance
51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (+24.56%)
Mutual labels:  algorithmic-trading, quantitative-finance
Quantitative Notebooks
Educational notebooks on quantitative finance, algorithmic trading, financial modelling and investment strategy
Stars: ✭ 356 (+56.14%)
Mutual labels:  algorithmic-trading, quantitative-finance
Quant
Codera Quant is a Java framework for algorithmic trading strategies development, execution and backtesting via Interactive Brokers TWS API or other brokers API
Stars: ✭ 104 (-54.39%)
Mutual labels:  algorithmic-trading, quantitative-finance
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (+852.63%)
Mutual labels:  quantitative-finance, algorithmic-trading

Optimal Portfolio

python   MIT license  

OptimalPortfolio is an open source library for portfolio optimisation. This library extends classical portfolio optimisation methods for equities, options and bonds. Unlike modern portfolio theory (MPT), OptimalPortfolio takes into account the skew and kurtosis of the distribution of market invariants. Furthermore, novel methods of finding estimators of moments of the distribution is implemented.

Regardless of whether you are a fundamental investor, or an algorithmic trader, this library can aid you in allocating your capital in the most risk efficient way, allowing to optimise your utility. For more details on the project design and similar content, please check out Engineer Quant

Disclaimer: This is not trading or investment advice. Trading involves significant risk and do so at your risk.

Contents

Overview

This library aims to make optimising portfolios accessible to every trader and investor. To install this library, download it and run

run setup.py

Market Invariants

The first step to optimising any portfolio is calculating market invariants. Market invariants are defined as aspects of market prices that have some determinable statistical behaviour over time. For stock prices, the compounded returns are the market invariants. So when we calculate these invariants, we can statistically model them and gain useful insight into their behaviour. So far, calculating market invariants of stock prices and forex prices have been implemented. I plan to calculate invariants for options and bonds but data acquisition is difficult.

Moment Estimation

Once the market invariants have been calculated, it is time to model the statistical properties of the invariants. This is an actively researched and studied field and due to the nature of the complexity involved in modelling the statistical properties of large market data, there are several limitations in estimating the moments of the distributions. I have tried implementing cutting edge research in shrinkage estimators.

Nonparametric Estimators

The simplest method of estimating the mean and covariance of invariants are the sample mean and covariance. However, this can be extended by introducing weightage for the timestamps, i.e giving more weight to recent data than older data. One interesting approach I have taken is introducing exponentially weighted mean and covariance, which I read about here. I am now working on implementing exponential weightage for skew and kurtosis.

Maximum Likelihood Estimators

Maximum likelihood estimators (MLE) are intended to maximise the probability that the data points occur within a prescribed distribution. The procedure hence involves choosing a distribution or a class of distributions and then fitting the data to the distribution such that the log probability of the data points are maximised by the parameters of the distributions. This will in turn give us the optimal estimators of the distribution for market invariants. MLE has been implemented for the following distributions:

  • Multivariate Normal
  • Multivariate Student t

The MLE estimate for Student-t distribution is computed using Expectation Maximisation (EM) algorithm.

Shrinkage Estimators

Both nonparametric and MLE estimators require a large set of data and even then they might not produce the best estimators due to their inherent bias or lack there off. Akin to the bias-variance tradeoff in machine learning, too much bias and too much variance is not good in estimators. So, as a way to combine the two estimators, shrinkage was introduced. The idea is that you combine two weak estimators, one with high variance and the other with high bias, with some coefficient called the shrinkage coefficient, to produce a much better estimator. This is one of the cutting edge estimators and is still rigorously being researched. I have implemented shrinkage of nonparametric (exponential) estimates with MLE (student-t) estimates, with manual shrinkage. Working on finding the optimal shrinkage coefficient.

Optimal Allocations

Classical asset allocation is the efficient frontier allocation. This is also known as the mean-variance optimisation as it takes into account the estimators of the mean and variance. The procedure of optimisation involves choosing an utility function and optimising it for portfolio weights. However, it struggles to capture the fat tail behaviour and skewness of the market prices.

Higher Moment Optimisation

The core principle of optimisation with higher moments is identical to any other optimisation: given some utility function and constraints, find the weights of each of the portfolio entries such that the utility function is maximised. The only difference is that the utility function in this case would contain as arguments, higher moments. Furthermore, by adding coefficients to each moment, we are able to take into account investor risk aversion and preferences. This version of the package includes higher moment optimization based on higher co-moments, which makes much more statistical sense than the column-wise higher order moments in the original package.

Compared to Sharpe Ratio

When doing backtests, higher moment optimisation works better than using Sharpe ratio to optimise allocations.

Roadmap

I have the following planned out and am working on implementing them:

  • Market Invariants

    • Calculating invariants for bonds and derivatives
  • Nonparametric Estimators

    • Exponentially weighted skew and kurtosis
  • Maximum Likelihood Estimators

    • Student-t Distribution
    • Stable Distributions
  • Shrinkage Estimators

    • Optimal choosing of shrinkage for Nonparametric+MLE shrinkage
    • Shrinkage for higher moments
  • Optimisations

    • Copula based CVaR optimisation
    • Monte Carlo simulations
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].