Bettors should always look for a mathematical edge rather than rely on their impulses. Learning how to use the Kelly Criterion, for example, is a great way for bettors to determine how much they should stake. Read on to find out.
- Kelly Staking Plan Formula Calculator
- Kelly Staking Plan Formula Example
- Kelly Staking Plan Formula Sheet
To see the Kelly formula in action, let's take an example of a football match where the odds available on the draw are 3.50 (or 5/2 with an implied probability of 28.6%) but your estimate of the ‘true' probability of the draw is 30%. The formula for calculating the Kelly stake is: (Probability multiplied by odds) – 1 divided by (odds-1). The expected value of this wager is approximately $11.76. (0.68) (0.60) + (-1) (0.4) = $0.09, which equates to a 0.80% return on the funds wagered. The Kelly criterion returned a value of -0.0061. After applying the fractional Kelly value of 0.0, this adjusts to -0.0061 of your account balance. The recommended Kelly criterion stake will be multiplied by this value. For standard Kelly betting, set the fractional Kelly betting value to 1.00. If you want to be more conservative than the Kelly criterion, enter a value less than 1 (e.g. Input 0.5 if you want to wager 50%.
Prior to placing a bet bettors should consider six important questions: who, what, when, where, why and how? But for this article, it is the how, as in how much to bet, we are interested in.
Popular staking method which suggests that stake should be proportional to the perceived edge.
Consider placing a bet on the English Premier League. We can adapt these questions accordingly:
- Who to bet on? Manchester United
- What to bet on? Top 4 finish
- When to bet on? Now
- Where to bet on? Pinnacle tend to offer the best odds
- Why to bet on? They seem to be under-priced
- How much? How much to bet on this outcome?
Kelly Staking Plan Formula Calculator
Most articles focus on the first five questions, typically using mathematical or statistical justifications on answering ‘why' - such as the article on how to use Monte Carlo methods.
In making financial decisions, the key issue is not only finding the adequate financial products to invest in but also deciding how to subdivide one's portfolio. Similarly, an important question for a bettor, is how much to wager?
Many papers recommend using the Kelly Criterion or a derivative of it - such as my 2013 paper appearing in the The Journal of Gambling Business and Economics. In essence, the Kelly Criterion calculates the proportion of your own funds to bet on an outcome whose odds are higher than expected, so that your own funds grow exponentially.
B = the Decimal odds -1
P = the probability of success
Q = the probability of failure (i.e. 1-p)
Using a coin as an example of Kelly Criterion staking
For example, consider you are betting on a coin to land on heads at 2.00. However, the coin is biased and has a 52% chance of ending up on heads.
In this case:
P= 0.52
Q = 1-0.52 = 0.48
B = 2-1 = 1.
This works out at: (0.52x1 – 0.48) / 1 = 0.04
Therefore the Kelly Criterion would recommend you bet 4%. A positive percentage implies an edge in favour of your bankroll, so your funds grow exponentially. You can also test the criterion for different values in this online sheet by using the code below.
Kelly Staking Plan Formula Example
Ultimately the Kelly Criterion offers a distinct advantage over other staking methods such as Fibonacci and Arbitrage methods as there is a lower risk. However, it does require precise calculation of the likelihood of an event outcome, and discipline of this method will not provide explosive growth of your bankroll.
Keep up-to-date with more top-notch betting articles by following us on Twitter @PinnacleSports.
Automating with Kelly staking method and Bet Angel Pro¶
In other tutorials on the Betfair Automation Hub, we've gone through how to automate betting strategies based on ratings, market favourites and tips. For this tutorial, we're going to implement a staking strategy which can be used in conjunction with most other betting strategies. Determining how much you stake on a wager is a crucial consideration for successful punters. The Kelly Criterion is a staking method well known across wagering and investment professionals which should be known and considered by all Betfair punters.
Bet Angel Pro has a spreadsheet functionality that lets you place bets using your own variables and information from the live market, which is what we've used here to not only automate thoroughbred ratings from the Hub, but to also add the Kelly staking method. There are so many different ways to use this part of Bet Angel and we're very open to any thoughts about more effective ways of implementing this sort of strategy. You're welcome to reach out to us on automation@betfair.com.au with your feedback and opinions.
- The plan¶
We'll be building on the Bet Angel Ratings tutorial which utilizes the the Betfair's Data Scientists' thoroughbred ratings model. For this tutorial, we'll be assuming that you have already gone through the ratings tutorial, but if you havn't, you can check it out here, as the concepts and underlying trigger based strategy here do build on what we covered previously.
Staking strategies such as Kelly Criterion can be adventagous for automation when used in conjunction with a successful selection strategy. Rather than sending your bot to place static stake values for every bet, methods such as this let you place bet stakes which take into consideration your ratings and betting bank.
If you're not familiar with the Kelly Criterion staking strategy, we recommend having a quick read of the Kelly staking page on the Betfair Hub. There are plenty more resources on the internet relating to the strategy which may provide a more in depth understanding.
Resources
- Ratings: Betfair's Data Scientists' thoroughbred ratings model
- Before you start: check out the Bet Angel Ratings tutorial
- Rules: here's the spreadsheet we set up with our macros and rules included, but you'll obviously need to tweak it to suit your strategy
- Understanding how the Kelly Criterion staking strategy works
- Tool: Bet Angel Pro
- Recapping the strategy covered in the Bet Angel ratings automation tutorial¶
Kelly Staking Plan Formula Sheet
We'll be using the same trigger strategy that's outlined in the Bet Angel Ratings tutorial which uses the thoroughbred ratings shared by our Data Scientists on the Hub. The trigger has been simplified in this tutorial and we'll need to make small tweaks to the stake column of the 'BET ANGEL' worksheet (column N). We've also added an additional option to the 'SETTINGS' worksheet which will allow you to choose either a half Kelly or full Kelly stake. If you havn't yet read our Bet Angel ratings tutorial, we highly recommend that you do so as to understand how the concept of the bet placement trigger works. The tutorial can be found here.
- Set up¶
Make sure you've downloaded and installed Bet Angel Pro, and signed in.Once you open the program up click on the 'G' Guardian icon and open the Guardian functionality up.
- Writing your rules¶
We're using a customised version of the Bet Angel Ratings tutorial template to implement our staking strategy, so it can not only make betting decisions based on our ratings, but also calculate the stakes based on the Kelly Criterion staking strategy. Excel is an excellent tool, but it can take an investment of time to be able to use it effectively.
This is how we used Excel to implement our set of rules.
- Using cell references to simplify formulas¶
Throughout this tutorial, we'll be referencing certain cells with custom names that will make it easier to understand and follow the formulas as we progress. This is an especially effective method tokeep on top of more complex strategies that require long formaulas to implement.
Cell names used in this tutorial
- Account Balance refers to cell C6 of the 'BET ANGEL' worksheet
- StakeType refers to cell I5 of the 'SETTINGS' worksheet where you can change between half Kelly or Full Kelly stake
- Full_Kelly refers to the entire Q Column of the 'KELLY' worksheet
- HALF_Kelly refers to the entire R Column of the 'KELLY' worksheet
Calculating the Kelly stake
As explained in the Kelly Criterion staking strategy Betfair page, the formula to claculate the Kelly stake is:
(BP-Q)/B
Where B is the odds you are getting -1 (because we're using decimal odds), P is the likelihood of the bet winning and Q is the probability of losing (or 1 – P).
To show the steps of the calculation and to ensure that it's doing what we're expecting it to, we've created a 8 column table in the 'KELLY' worksheet.
Stepping through each step:¶
- Column K - best available Back odds Check the runner's name in our ratings and match it with the runners listed in the market ('BET ANGEL' worksheet) and return the best available back odds from the G column
- Column L - Exchange odds -1 Take the value returned in column K and minus 1 (because we're using decimal odds)
- Column M - Probability of win % 1 divided by the rated price from column I which converts the decimal odds to a percentage probability
- Column N - Probability of loss % 1 divided by the probability of a win from column M
- Column O - % of bankroll to use - Full Kelly Take the best available back odds (minus 1) from the L column, times it by the probability to win in the M column, then minus the probability to lose from the N column. Finally, divide that by the best available back odds (minus 1)
- Column P - % of bankroll to use - Half Kelly Take the calculation from column O and simply divide it by 2
- Column Q - Amount to bet - Full Kelly If the account balance times the percentage of the bankroll to use for half kelly stake is greater than 0, retrieve the account balance which Bet Angel populates in cell C6 of the 'BET ANGEL' worksheet and times it by the percentage of the bankroll (Column O) to use for the Full Kelly. If it's not greater than 0, then simply print 0.
- Column R - Amount to bet - half Kelly If the account balance times the percentage of the bankroll to use for half Kelly stake is greater than 0, then calculate the account balance times the percentage of the bankroll. If it's not greater than 0, then simply print 0.
- Result: Once the calculations are complete, we're left with two stake values that we will be able to use with our trigger. Column Q for a full Kelly stake and column R for a half Kelly stake. In the below image examples, we have a market for Geelong with the half and full Kelly.
Excel functions
- IF statement: IF(if this is true, do this, else do this)
- IFERROR: If there is an error that occurs in the cell, display nothing
- AND statement: AND(this is true, and so is this, and so is this) - returns true or false
- Absolute references: if you're copy/pasting formulas it's important that you make links absolute when you don't want the cell being referenced to change relative to the new cell the formula is being pasted into. You do this by putting a $ in front of the parts of the reference you don't want to 'move'.
- Preparing the spreadsheet¶
You need to copy/paste these eight formulas into the relevant column cells which is highlighted as blue - We copied ours into 1500 rows in the sheet, just in case you have a large number of ratings. Excel is clever enough to automatically update the relative links in the formulas, so you should be able to copy/paste the same formula into each cell as long as you've got your relative and absolute references straight.
- Stake: Here we're telling excel to take a look into B column, if a runner name is present, then match that name to either the value which has been calculated for the full or half Kelly, depending on what has been selected by the drop down box in the 'SETTINGS' worksheet.
P= 0.52
Q = 1-0.52 = 0.48
B = 2-1 = 1.
This works out at: (0.52x1 – 0.48) / 1 = 0.04
Therefore the Kelly Criterion would recommend you bet 4%. A positive percentage implies an edge in favour of your bankroll, so your funds grow exponentially. You can also test the criterion for different values in this online sheet by using the code below.
Kelly Staking Plan Formula Example
Ultimately the Kelly Criterion offers a distinct advantage over other staking methods such as Fibonacci and Arbitrage methods as there is a lower risk. However, it does require precise calculation of the likelihood of an event outcome, and discipline of this method will not provide explosive growth of your bankroll.
Keep up-to-date with more top-notch betting articles by following us on Twitter @PinnacleSports.
Automating with Kelly staking method and Bet Angel Pro¶
In other tutorials on the Betfair Automation Hub, we've gone through how to automate betting strategies based on ratings, market favourites and tips. For this tutorial, we're going to implement a staking strategy which can be used in conjunction with most other betting strategies. Determining how much you stake on a wager is a crucial consideration for successful punters. The Kelly Criterion is a staking method well known across wagering and investment professionals which should be known and considered by all Betfair punters.
Bet Angel Pro has a spreadsheet functionality that lets you place bets using your own variables and information from the live market, which is what we've used here to not only automate thoroughbred ratings from the Hub, but to also add the Kelly staking method. There are so many different ways to use this part of Bet Angel and we're very open to any thoughts about more effective ways of implementing this sort of strategy. You're welcome to reach out to us on automation@betfair.com.au with your feedback and opinions.
- The plan¶
We'll be building on the Bet Angel Ratings tutorial which utilizes the the Betfair's Data Scientists' thoroughbred ratings model. For this tutorial, we'll be assuming that you have already gone through the ratings tutorial, but if you havn't, you can check it out here, as the concepts and underlying trigger based strategy here do build on what we covered previously.
Staking strategies such as Kelly Criterion can be adventagous for automation when used in conjunction with a successful selection strategy. Rather than sending your bot to place static stake values for every bet, methods such as this let you place bet stakes which take into consideration your ratings and betting bank.
If you're not familiar with the Kelly Criterion staking strategy, we recommend having a quick read of the Kelly staking page on the Betfair Hub. There are plenty more resources on the internet relating to the strategy which may provide a more in depth understanding.
Resources
- Ratings: Betfair's Data Scientists' thoroughbred ratings model
- Before you start: check out the Bet Angel Ratings tutorial
- Rules: here's the spreadsheet we set up with our macros and rules included, but you'll obviously need to tweak it to suit your strategy
- Understanding how the Kelly Criterion staking strategy works
- Tool: Bet Angel Pro
- Recapping the strategy covered in the Bet Angel ratings automation tutorial¶
Kelly Staking Plan Formula Sheet
We'll be using the same trigger strategy that's outlined in the Bet Angel Ratings tutorial which uses the thoroughbred ratings shared by our Data Scientists on the Hub. The trigger has been simplified in this tutorial and we'll need to make small tweaks to the stake column of the 'BET ANGEL' worksheet (column N). We've also added an additional option to the 'SETTINGS' worksheet which will allow you to choose either a half Kelly or full Kelly stake. If you havn't yet read our Bet Angel ratings tutorial, we highly recommend that you do so as to understand how the concept of the bet placement trigger works. The tutorial can be found here.
- Set up¶
Make sure you've downloaded and installed Bet Angel Pro, and signed in.Once you open the program up click on the 'G' Guardian icon and open the Guardian functionality up.
- Writing your rules¶
We're using a customised version of the Bet Angel Ratings tutorial template to implement our staking strategy, so it can not only make betting decisions based on our ratings, but also calculate the stakes based on the Kelly Criterion staking strategy. Excel is an excellent tool, but it can take an investment of time to be able to use it effectively.
This is how we used Excel to implement our set of rules.
- Using cell references to simplify formulas¶
Throughout this tutorial, we'll be referencing certain cells with custom names that will make it easier to understand and follow the formulas as we progress. This is an especially effective method tokeep on top of more complex strategies that require long formaulas to implement.
Cell names used in this tutorial
- Account Balance refers to cell C6 of the 'BET ANGEL' worksheet
- StakeType refers to cell I5 of the 'SETTINGS' worksheet where you can change between half Kelly or Full Kelly stake
- Full_Kelly refers to the entire Q Column of the 'KELLY' worksheet
- HALF_Kelly refers to the entire R Column of the 'KELLY' worksheet
Calculating the Kelly stake
As explained in the Kelly Criterion staking strategy Betfair page, the formula to claculate the Kelly stake is:
(BP-Q)/B
Where B is the odds you are getting -1 (because we're using decimal odds), P is the likelihood of the bet winning and Q is the probability of losing (or 1 – P).
To show the steps of the calculation and to ensure that it's doing what we're expecting it to, we've created a 8 column table in the 'KELLY' worksheet.
Stepping through each step:¶
- Column K - best available Back odds Check the runner's name in our ratings and match it with the runners listed in the market ('BET ANGEL' worksheet) and return the best available back odds from the G column
- Column L - Exchange odds -1 Take the value returned in column K and minus 1 (because we're using decimal odds)
- Column M - Probability of win % 1 divided by the rated price from column I which converts the decimal odds to a percentage probability
- Column N - Probability of loss % 1 divided by the probability of a win from column M
- Column O - % of bankroll to use - Full Kelly Take the best available back odds (minus 1) from the L column, times it by the probability to win in the M column, then minus the probability to lose from the N column. Finally, divide that by the best available back odds (minus 1)
- Column P - % of bankroll to use - Half Kelly Take the calculation from column O and simply divide it by 2
- Column Q - Amount to bet - Full Kelly If the account balance times the percentage of the bankroll to use for half kelly stake is greater than 0, retrieve the account balance which Bet Angel populates in cell C6 of the 'BET ANGEL' worksheet and times it by the percentage of the bankroll (Column O) to use for the Full Kelly. If it's not greater than 0, then simply print 0.
- Column R - Amount to bet - half Kelly If the account balance times the percentage of the bankroll to use for half Kelly stake is greater than 0, then calculate the account balance times the percentage of the bankroll. If it's not greater than 0, then simply print 0.
- Result: Once the calculations are complete, we're left with two stake values that we will be able to use with our trigger. Column Q for a full Kelly stake and column R for a half Kelly stake. In the below image examples, we have a market for Geelong with the half and full Kelly.
Excel functions
- IF statement: IF(if this is true, do this, else do this)
- IFERROR: If there is an error that occurs in the cell, display nothing
- AND statement: AND(this is true, and so is this, and so is this) - returns true or false
- Absolute references: if you're copy/pasting formulas it's important that you make links absolute when you don't want the cell being referenced to change relative to the new cell the formula is being pasted into. You do this by putting a $ in front of the parts of the reference you don't want to 'move'.
- Preparing the spreadsheet¶
You need to copy/paste these eight formulas into the relevant column cells which is highlighted as blue - We copied ours into 1500 rows in the sheet, just in case you have a large number of ratings. Excel is clever enough to automatically update the relative links in the formulas, so you should be able to copy/paste the same formula into each cell as long as you've got your relative and absolute references straight.
- Stake: Here we're telling excel to take a look into B column, if a runner name is present, then match that name to either the value which has been calculated for the full or half Kelly, depending on what has been selected by the drop down box in the 'SETTINGS' worksheet.
=IF(B9=',',INDEX(KELLY!Q:R,MATCH(B9,RunnerName,0),StakeType))
And you're set!¶
Once you've set your Kelly strategy set up with your strategy, it should only take a number of seconds to load your markets for the day. Just make sure you have all of the Bet Angel settings correctly selected before you leave your to run, as some of them reset by default when you turn Bet Angel off.
Areas for improvement¶
There are parts of this approach that we're still trying to get to work to our liking, and we'll update this article as we find better solutions. If you have any suggestions for improvements please reach out to automation@betfair.com.au - we'd love to hear your thoughts.
For example, the spreadsheet only binds with one market at a time, so if one market gets delayed and runs overtime the program won't be able to move on to the next market - We missed some races because of this.
What next?¶
We're working through some of the popular automation tools and creating articles like this one to help you learn how to use them to implement different styles of strategies. If you have any thoughts or feedback on this article or other programs you'd like to see us explore please reach out to automation@betfair.com.au - this article has already been updated with extra learnings including variable percentages and new macros.
Disclaimer¶
Note that whilst automated strategies are fun and rewarding to create, we can't promise that your betting strategy will be profitable, and we make no representations in relation to the information on this page. If you're implementing your own strategies, you do so entirely at your own risk and you are responsible for any winnings/losses incurred. Under no circumstances will Betfair be liable for any loss or damage you suffer.