Lisandro79 / BeatTheBookie

Betting Strategy to Beat the Bookies at Football Games
GNU General Public License v3.0
611 stars 150 forks source link

The problem of formula #4

Closed HarveyLau closed 6 years ago

HarveyLau commented 6 years ago

the code in beatTheBookie.m, line 33-38. % Apply formula and decide whether to bet earn_margin(1) = ((1 ./ averages(1) - marg) * maximums(1) - 1) * (counts(1) > nValidOdds) ; earn_margin(2) = ((1 ./ averages(2) - marg) * maximums(2) - 1) * (counts(2) > nValidOdds); earn_margin(3) = ((1 ./ averages(3) - marg) * maximums(3) - 1) * (counts(3) > nValidOdds); if sum(earn_margin > 0) >= 1

Hi. I have a problem which is why this code returned is negative, so that the IF condition is zero

javkrei commented 6 years ago

@HarveyLau could you please clarify the question?

What this bit of code does is decide whether any of the 3 possible bets (when betting to the maximum offered odds), home, draw or away comply with the formula in equation 7 of our paper.

If you look at line 34:

earn_margin(1) = ((1 ./ averages(1) - marg) maximums(1) - 1) (counts(1) > nValidOdds) ;

the first of the terms being multiplied is (1 ./ averages(1) - marg) * maximums(1) - 1, which is equation 7 in our paper. This is positive only when we should bet according to the formula.

The second term is (counts(1) > nValidOdds). It will be 1 if we have enough bookies (more than 3) offering odds for the result, otherwise it will be 0.

So, the earn_margin(1) will be positive if and only if the maximum odds offered for home win are above the threshold of equation 7 of the paper and there are more than 3 bookies offering odds.

I don't know if this clears your concerns, otherwise please ask away.

HarveyLau commented 6 years ago

I put the value of the paper in the terms, and I got a = ((1.0/ 1.1956 - 0.05) * 1.22 - 1) The result return is negative. I think I misunderstand the grammar.

Lisandro79 commented 6 years ago

I think you have it right. With the numbers you are using in the example, if you placed bets on many games, the formula says that you would lose ~%4 of your money in the long run. You can try changing the threshold and see how that value changes.