News
Current BetFair Sports API status: online. Current BetFair Games API status: online.

WellDone Betting Bots -- May 21, 2012, 23:35
Pages: 1
Print
Author Topic: Formulas  (Read 5253 times)
Maddox
Élite
Full Member
*****

Reputation: +1/-0
Thanks!
Gender: Male
Posts: 122


« on: September 03, 2009, 12:13 »

Thought I’d post up some formulas I found, some of these aren’t compatible with MFP but could come in handy if you’re using excel. There doesn’t seem to be anywhere on the net that lists useful formulas, so I’m going to start one. Feel free to post any others you may know of. Share the wealth and all that  Smiley

So I’ll keep things simple to start with.

To convert decimal odds into probability(also known as binary):
(100/back_price)    = Value%
(100/5)       = 20%
Or
(1/back_price)   =0.value%
(1/back_price)*100    = value%

To convert binary to decimal odds:
e.g. binary               = 55.55
(100/binary)    = decimal odds
(100/55.55)   = 1.80

To green up a back bet for even profit:
e.g. backed £10 @ 2.00, lay_price is now = 1.5
               Lay stake
(bm_backp*bm_backa)/lay_price                    = 13.33
(10*2)/1.5            = 13.33

Or
(Profit+liability)/lay_price                      =13.33
(10+10)/1.5            =13.33

Or
(back odds/lay odds)* back stake                    = lay stake
(2/1.5)*10            = 13.33
(bm_backp/lay_price)*bm_backa                   =13.33

To green up a lay bet for even profit:
e.g. layed £10 @ 2.00, back_price is now 3.0

(lay stake*lay odds)/ new back odds   = back stake
(10*2)/3            = 6.66
(bm_laya*bm_layp)/back_price   =6.66

Or
(liability + lay stake)/ new back odds   = back stake
(10+10)/3         = 6.66

Or
(lay odds/back odds)* lay stake   = back stake
(bm_layp/back_price)*bm_laya   = 6.66

I’ll post some more later

Enjoy
Logged
1x Thanks!


Oxa (WellDoneSoft)
Administrator
Hero Member
*****

Reputation: +24/-1
Useful
Gender: Female
Posts: 1059



WWW
« Reply #1 on: September 03, 2009, 16:22 »

Thank you for the formulae, I'm sure the topic will be popular!

But which of them do you think are not compatible with MF Pro?
Logged



I know I'm gonna die so my revenge is living well.
Maddox
Élite
Full Member
*****

Reputation: +1/-0
Thanks!
Gender: Male
Posts: 122


« Reply #2 on: September 03, 2009, 16:45 »

Thank you for the formulae, I'm sure the topic will be popular!

But which of them do you think are not compatible with MF Pro?

Haven't got round to posting them yet, was referring to certain excel functions.
Logged


Maddox
Élite
Full Member
*****

Reputation: +1/-0
Thanks!
Gender: Male
Posts: 122


« Reply #3 on: September 04, 2009, 15:49 »

To find the percentage increase or decrease of two values
e.g. Old price: 9 new price: 11
((new price  - old price) / old price) * 100 = % (returns a positive number if increased and negative if decreased)
e.g. back matched bet: 5 current lay price: 3
((lay_price-bm_backp)/bm_backp)*100 = -40.00%
((3-5)/5)*100 = -40.00%
Or using pdif_1
Back price 1 minute ago: 4
Back price now: 4.5
pdif_1 will return: 0.5
(((back_price-(back_price-(pdif_1)))/(back_price-(pdif_1)))*100) = 12.50% (price risen by 12.5% in last minute)
(((4.5-(4.5-(0.5)))/(4.5-(0.5)))*100) = 12.50%

e.g. back price 1 minute ago: 10
back price now: 7
pdif_1: -3.00
(((back_price-(back_price-(pdif_1)))/(back_price-(pdif_1)))*100) = -30% (price dropped 30% in last minute)
(((7-(7-(-3.00)))/(7-(-3.00)))*100) = -30%

To covert a negative number to a positive number
e.g.
Current profit_loss: -100
((((profit_loss)-1)*-1)-1) = 100
((((-100)-1)*-1)-1) = 100

To work out how much a number would increase by over a number of days
e.g.
Current bank: £100
Percent increase per day 1%
Number of days: 365

bank*((percent/100)+1)^days = what bank would be if increased by 1% everyday for a year
100*((1/100)+1)^365 = £3778.34

To increase a value by a percent
e.g. bank: £500
increase by: 2%
bank*(1+(percent increase/100)) = new value with added percent
500*(1+(2/100)) = £510

To decrease a value by a percent
e.g. bank: 222
decrease by: 10%
bank/(1+(percent decrease/100) = new value minus percent
222/(1+(10/100) = £199.80
Logged
1x Thanks!


MartinSteiner
Élite
Full Member
*****

Reputation: +1/-0
Posts: 136


« Reply #4 on: September 10, 2009, 21:41 »

maddox, thanks for sharing your formulas. I found some problem with this formula:

To covert a negative number to a positive number
e.g.
Current profit_loss: -100
((((profit_loss)-1)*-1)-1) = 100
((((-100)-1)*-1)-1) = 100


Why not use: -profit_loss  ?

Or if you want to do a abs() funktion, this can be done by

IF( profit_loss<0, -profit_loss, profit_loss )
Logged


MartinSteiner
Élite
Full Member
*****

Reputation: +1/-0
Posts: 136


« Reply #5 on: September 10, 2009, 22:07 »

Formula for equal Profit_loss on all selections when there are matched bets on all selections in the market:

For every selection with positive profit_loss:
enter a lay bet at lay_price with stake: profit_loss/lay_price

For every selection with negative profit_loss:
enter a back bet at back_price with stake: -profit_loss/back_price


Formula for equal Profit_loss on all selections when there are matched bets some selections in the market: (i.e. you did only enter bets on selections with low odds)

First find a selection with no matched bets. This selection has a profit_loss named profit_loss_no_bets

For every selection with positive (profit_loss-profit_loss_no_bets):
enter a lay bet at lay_price with stake: (profit_loss-profit_loss_no_bets)/lay_price

For every selection with negative (profit_loss-profit_loss_no_bets):
enter a back bet at back_price with stake:
-(profit_loss-profit_loss_no_bets)/back_price


Logged


Maddox
Élite
Full Member
*****

Reputation: +1/-0
Thanks!
Gender: Male
Posts: 122


« Reply #6 on: September 11, 2009, 13:55 »

Quote
Why not use: -profit_loss  ?

Or if you want to do a abs() funktion, this can be done by

IF( profit_loss<0, -profit_loss, profit_loss )

Thanks for that, that's much easier. I'll use that from now on.

Thats's the main reason for posting formulas, there's always another way.
Logged
1x Agree


londolozi
Élite
Jr. Member
*****

Reputation: +1/-0
Gender: Male
Posts: 82


« Reply #7 on: October 25, 2011, 00:25 »

I’m not sure the ‘distribute loss’ always works how I like. I get some funny outcomes. So I decided to create a manual formula which I am happy to share with you.

My dilemma was getting left in a losing situation due to unmatched bets, or just distributing a profit between runners

Here is an example:
backa = $100 backp = 3.1
layp = 3.0 laya = $35 (only a partial amount of my lay bet is matched)
The last_traded has now turned against me and is 3.35
Lay wager is worked out as $61.20. Net loss is -$3.8
I’ve used r_ticks(last_traded,1) as a safe guard.

(backa*(backp-1)-(laya*(layp-1))+backa-laya)/r_ticks(last_traded,1)

In this scenario I have opted to distribute the loss between outcomes, you can opt for zero outcome if Horse wins and say -$5.15 if it loses.
I think that is what 'distribute loss' does on occasions.

The same formula will distribute profits if the layp is now in your favour.
Nows let's assume the unmatched lay bet was cancelled and the market is now in your favour.
layp is 2.7 laya is formulated to be $75.92
Net outcome of $10.93 regardless of result.
Enjoy.
Logged



Improvise Adapt Overcome
Pages: 1
Print
 
Jump to:  

Anone designed by pixelslot.
Powered by SMF 1.1.16 | SMF © 2011, Simple Machines