PainStaking v0.0.9 PainStaking
Calculate stakes in advantage betting situations
Summary
Types
A tuple which represents a supposed advantage wagering situation
A number tagged with a description to make collating results easier
A keyword list with a single pair. The key should be one of the atoms for a supported odds format from Exoddic. The value should be a supported way for expressing the odds for that key
Functions
Determine how much to bet on each of a set of mutually exclusive outcomes in an arbitrage situation
The mathematical expectations for a list of supposed edges
Determine the amount to stake on advantage situations based on the estimated edge and the Kelly Criterion
Simulate a repeated edge situation and see the average amount won
Types
edge :: {String.t, wager_price, wager_price}
A tuple which represents a supposed advantage wagering situation.
The first element is an edge description The second element is the estimate of the fair (or actual) odds of winning. The third element is the odds offered by the counter-party to the wager.
tagged_number :: {String.t, number}
A number tagged with a description to make collating results easier.
wager_price :: [{:atom, number | String.t}]
A keyword list with a single pair. The key should be one of the atoms for a supported odds format from Exoddic. The value should be a supported way for expressing the odds for that key.
Examples:
- Probability:
[prob: 0.50]
- Moneyline:
[us: "+120"]
- Decimal:
[eu: 2.25]
- Traditional:
[uk: "4/1"]
Functions
Specs
arb_size(number, [wager_price]) ::
{:ok, [float], float} |
{:error, String.t}
Determine how much to bet on each of a set of mutually exclusive outcomes in an arbitrage situation.
max_outlay
is the maximum available to stake on this set of outcomes.
The smaller the arbitrage, the closer your outlay will be to this number.
mutually_exclusives
is a list of mutually exclusive outcomes and the odds
offered on each.
Successful return: {:ok, [stake on each outcome], expected profit}
The payouts may not all be exactly max_outlay
because of rounding to the
nearest cent. This may cause a slight variation in the expected profit.
Specs
ev_per_unit([edge]) :: {:ok, [tagged_number]}
The mathematical expectations for a list of supposed edges
An edge
which turns out to be a losing proposition will have an EV below 1.
The return values will be tagged with the provided edge descriptions
Specs
kelly_size(number, [edge], boolean) :: {:ok, [tagged_number]}
Determine the amount to stake on advantage situations based on the estimated edge and the Kelly Criterion
bankroll
is the total amount available for wagering
advantages
is a description of the situations as edge
s.
independent
determines whether the edges are treated as independent
(multiple simultaneous events) or dependent (“many horses”)
Returns {:ok, list of amounts to wager on each}. The list will be sorted in expectation order.
Specs
sim_win_for(number, [edge], non_neg_integer) :: float
Simulate a repeated edge situation and see the average amount won.
bankroll
is the starting bankroll when the bets are placed
edges
is a list of simultaneous events
iter
is the number of simulation iterations to run
Returns the average win, assuming wagers are staked according
to the kelly_size