A command-line utility for calculating optimal bet sizes using the Kelly Criterion.
-
First, compile the program:
gcc kelly.c -o kelly
-
Make it executable:
chmod +x kelly
-
Move it to your system's bin directory:
sudo mv kelly /usr/local/bin/
The Kelly calculator accepts the following parameters:
kelly -b <bankroll> (-pw <win probability> | -ow <win odds>) (-pb <implied probability> | -ob <implied odds> | -bb <bet back ratio> | -gb <gain ratio>)-b: Your current bankroll (optional)-pw: Probability of winning (0-1)-ow: Odds of winning (alternative to -pw)-pb: Implied probability from the bet (0-1)-ob: Implied odds from the bet (not the payoff odds)-bb: Proportion you end with on win (>1)-gb: Proportion gained on win (>0)
-
Calculate optimal bet fraction with 60% probability of winning and 3 to 2 implied bet odds:
kelly -pw 0.6 -ob 1.5
-
Calculate optimal bet amount from bankroll with 2 to 1 odds of winning and implied probability:
kelly -b 1000 -ow 2.0 -pb 0.4
-
For a bet that doubles your money on win:
kelly -pw 0.55 -bb 2.0
-
For a bet that gains 10% of your bet on win:
kelly -b 500 -pw 0.2 -gb 0.1