David,
Two things:
-
How can you be doing Kelly Criterion if you do not look at correlations?
-
Do you have to use P123 for everything? You are pretty adept at Python, I think.
If you are willing to use Python, let me start from scratch with what I do.
So with Kelly Criterion the weight of a position for optimal Kelly = μ/(σ^2) if the risk free rate is 0
The expected long-term compounded growth rate g = ((μ/σ)^2)/2. Again ignoring the risk free rate.
So this simplifies to maximizing μ/σ. Maximizing μ/σ will maximize your growth (if μ/σ is positive)
Fortunately the weights that will optimize μ/σ can be found using this code in Python:
pip install PyPortfolioOpt
import pandas as pd
df=pd.read_csv(‘/Users/JamesRinne/opt/ReadFile/poptindex.csv’)
f1=df[1257:]
f1_slice=pd.DataFrame(f1[[‘QQQ’,‘XLE’,‘XLU’,‘XLK’,‘XLB’,‘XLK’,‘XLB’,‘XLP’,‘XLY’,‘XLI’,‘XLV’,’XLF’,TLT’,’AGG’]])
f1_slice
from pypfopt.expected_returns import mean_historical_return
from pypfopt.risk_models import CovarianceShrinkage
mu=[m1,m2,……,m14]
S = CovarianceShrinkage(f1_slice).ledoit_wolf()
from pypfopt.efficient_frontier import EfficientFrontier
ef = EfficientFrontier(mu, S)
weights = ef.max_sharpe()
cleaned_weights = ef.clean_weights()
print(cleaned_weights)
ef.portfolio_performance(verbose=True)
Where QQQ,……AGG are the column headings for ETFs’ price history in this example. But you can use the price history of any equity, port or ETF, obviously.
You can set your own expected returns for each equity or ETF with mu = [your expected returns for each equity]
Furthermore the program does allow you to use leverage and short positions so you should be able to find the true optimal Kelly within your leverage and short constraints.
You add (or change) this line of code to leverage 2X and allow shorts: ef = EfficientFrontier(mu, S, weight_bounds=(-2,2)).
You can set your expected return and the program uses the historical volatility and correlations.
FWIW. Probably not ultimately useful but I thought it could be useful as it gives you more (correlations) and ultimately seems easier even if you cannot calculate everything within P123.
Hope you get some use out this. Sorry to distract from the purpose of this thread if this is off topic
Best,
Jim