An example of using a Kelly / Thorp betting system. A write-up of the derivation of the method can be found here:
https://github.com/WinVector/Examples... , and the blog announcement here: https://win-vector.com/2021/02/25/kel...
I also have a note on why these methods don't apply to fair coin games (or sampling with replacement):
https://github.com/WinVector/Examples...