Bet Sizing in ML¶
“There are fascinating parallels between strategy games and investing. Some of the best portfolio managers I have worked with are excellent poker players, perhaps more so than chess players. One reason is bet sizing, for which Texas Hold’em provides a great analogue and training ground. Your ML algorithm can achieve high accuracy, but if you do not size your bets properly, your investment strategy will inevitably lose money. In this chapter we will review a few approaches to size bets from ML predictions.” Advances in Financial Machine Learning, Chapter 10: Bet Sizing, pg 141.
The code in this directory falls under 3 submodules:
Bet Sizing: We have extended the code from the book in an easy to use format for practitioners to use going forward.
EF3M: An implementation of the EF3M algorithm.
Chapter10_Snippets: Documented and adjusted snippets from the book for users to experiment with.
Note
Underlying Literature
The following sources describe this method in more detail:
Advances in Financial Machine Learning, Chapter 10 by Marcos Lopez de Prado.
Bet Sizing Methods¶
Functions for bet sizing are implemented based on the approaches described in chapter 10.
Bet Sizing From Predicted Probability¶
Assuming a machine learning algorithm has predicted a series of investment positions, one can use the probabilities of each of these predictions to derive the size of that specific bet.
Dynamic Bet Sizes¶
Assuming one has a series of forecasted prices for a given investment product, that forecast and the current market price and position can be used to dynamically calculate the bet size.
Strategy-Independent Bet Sizing Approaches¶
These approaches consider the number of concurrent active bets and their sides, and sets the bet size is such a way that reserves some cash for the possibility that the trading signal strengthens before it weakens.
Chapter 10 Code Snippets¶
Chapter 10 of Advances in Financial Machine Learning
contains a number of Python code snippets, many of which are used
to create the top level bet sizing functions. These functions can be found in mlfinlab.bet_sizing.ch10_snippets.py
.