This is the accompanying article to my previous post covering a python implementation of The Real Kelly Criterion for independent concurrent outcomes.
In detail the algorithm will find optimal bet sizes for a set of concurrent singles and/or ’round robin’ combinations of parlays or teasers.
I recommend reading carefully through @Pinnacle ‘s article covering the basic concept of the generalised Kelly The Real Kelly
The code is available for download on my github repository real_kelly-independent_concurrent_outcomes-
(1) Selections need to be passed in as a list of dictionaries called ‘selections’. The template near the bottom is there to be modified.
(2) Pass in the bankroll as a parameter of the function call at the very bottom.
(3) Pass in the maximum number of teams you wish to have in the multiples as ‘max_multiple’.
Say you have 5 selections, but don’t want to include any trebles, 4-folds, 5-folds. ‘max_multiple=2’ will then calculate optimal bet sizes only for singles & doubles.
If you only want to have singles pass in ‘max_multiple=1’.
If you pass in ‘max_multiple=5’ the algorithm will find all possible combinations (singles, doubles, trebles, 4-folds and the 5-fold) and the according optimal stakes sizes.
Obviously ‘max_multiple’ must not be greater than the number of selections.
The code works out of the box, but runtime is an issue! Since the number of combinations grow quadratically, the runtime explodes with an additional ‘max_multiple’ as variable.
Update: Thanx to @SmoLurks the python code now runs 30x faster!!!