Author Topic: Formulas  (Read 33955 times)

  • Élite
  • Posts: 103
  • Karma: +3/-0
  • Gender: Male
*
Formulas
« on: Thu, 03 September, 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  :)

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

  • Administrator
  • Posts: 6349
  • Karma: +211/-2
  • Gender: Female
*
Re: Formulas
« Reply #1 on: Thu, 03 September, 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?
Always try your triggers in Test Mode before switching to real money!

You can get a faster response from us if you contact us via FaceBook Messenger.

Присоединяйтесь к нашей официальной группе ВКонтакте!

  • Élite
  • Posts: 103
  • Karma: +3/-0
  • Gender: Male
*
Re: Formulas
« Reply #2 on: Thu, 03 September, 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.

  • Élite
  • Posts: 103
  • Karma: +3/-0
  • Gender: Male
*
Re: Formulas
« Reply #3 on: Fri, 04 September, 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

  • Élite
  • Posts: 215
  • Karma: +4/-0
*
Re: Formulas
« Reply #4 on: Thu, 10 September, 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 )

  • Élite
  • Posts: 215
  • Karma: +4/-0
*
Re: Formulas
« Reply #5 on: Thu, 10 September, 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



  • Élite
  • Posts: 103
  • Karma: +3/-0
  • Gender: Male
*
Re: Formulas
« Reply #6 on: Fri, 11 September, 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.

  • All members
  • Posts: 525
  • Karma: +17/-5
  • Gender: Male
Distributing Profit/loss manually
« Reply #7 on: Tue, 25 October, 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.
Improvise Adapt Overcome

  • Moderator
  • Posts: 2797
  • Karma: +230/-0
*
Re: Formulas
« Reply #8 on: Fri, 07 December, 2012, 21:18 »
To calculate the opposite lay price to a back price:
1 / (back_price -1) +1
To calculate the opposite back price to a lay price:
1 / (lay_price -1) +1
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 4
  • Karma: +0/-0
Re: Formulas
« Reply #9 on: Thu, 15 August, 2013, 18:31 »
hi, does anyone know if we are able to code to place trades according to certain scores in soccer? ie if a team is leading by w goals between time x & y then back z amount of gbp?

  • Moderator
  • Posts: 4015
  • Karma: +235/-9
  • Gender: Male
*
Re: Formulas
« Reply #10 on: Sun, 18 August, 2013, 05:12 »
hi badboybav
yes, you would do this with conditions using
market_score1
market_score2
markets minutes since the off


mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 607
  • Karma: +32/-5
  • Gender: Male
Re: Formulas
« Reply #11 on: Mon, 23 March, 2015, 20:32 »
Yet again this topic saves me time and effort. Thank you

  • All members
  • Posts: 118
  • Karma: +2/-0
Re: Formulas
« Reply #12 on: Thu, 25 February, 2016, 12:11 »
Hi
Interesting topic I have tried this formula but it does not fire

((my_back*(bm_backp-1))*(1-cm_s))+ (my_back*.34)

(amount of my back bet) multiplied by (price of last matched non sp back bet -1)
multiplied by 1 -cm_s which is a set constant entered by user so could be 4 or 5 whatever
rate their commission is, to give the profit return for the back bet

plus
(amount of my back bet) multiplied by .34 to give approximately a third of my
back amount

So the bet amount should be the profit from the last back bet plus approximately one third of my set back stake
Help would be gratefully received
Mike

  • Moderator
  • Posts: 4015
  • Karma: +235/-9
  • Gender: Male
*
Re: Formulas
« Reply #13 on: Thu, 25 February, 2016, 15:26 »
hi
try         ((bm_backa*(bm_backp-1))*(1-commission))+ (bm_backa*.34)

mcbee
Please read the following  disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 118
  • Karma: +2/-0
Re: Formulas
« Reply #14 on: Fri, 26 February, 2016, 08:04 »
Hi
Thanks I have tried that and it does not fire either,
I want to use the potential profit
from my back bet to this add 0.34 of my set back stake and use that total
as the stake for a saver bet.
I have tried many equations but cannot get any to work as I wish
Mike