Hello everyoneI hope you are fine, i would like to add to my risk management metrics the Kelly Criterion usded for trade per position size, is there any already code example of how to implement it? I think would be great to see a framework example to base myself from there.
Thanks
Louis Szeto
Hi Ro
There are 2 types of implementations, as a portfolio or as multiple bets, which one are you referring to? It is hard for the community to help out and cooperate together if you don't attach your trial.
I can give you some direction to start with though. As bets, you're trading each trade as an independent bet, so it would be better if you implement the classic algorithm. Calculate each trade's winning odd and expected return for a period, then order positional size by SetHoldings(symbol, p-(1-p)/b). Note that here you're assuming each trade are independent event and losing all capital if you guess wrongly. There is also multiple bets version formula, but the assumptions are the same with additional shortcomings of being a discrete-time system and assuming mutual exclusive event. I personally won't recommend this due to a high number of unrealistic assumptions.
Another implementation would be Portfolio Construction. It also has some less unrealistic assumptions of using a continuous time system and assuming Brownian Motion of stock movement. This case could be easily handled by optimizing the historical data's dataframe to get a weight vector. Then use that to generate Insights with weights for an AlphaModel with InsightWeightingPortfolioConstructionModel.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ro García G
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!