Simple trigger formula

Please post any questions regarding the program here.

Moderator: 2020vision

Simple trigger formula

Postby Torino33 » Tue May 26, 2015 4:15 am

Hi all,

I'm requesting your help to create a simple formula to do this action:

My first bet is alway a back bet, so I need the VBA to level profit by laying 1 min before the off @ back price.

Your help would be greatly appreciated.

Thanks
Torino33
 
Posts: 13
Joined: Thu Feb 12, 2009 8:35 am

Re: Simple trigger formula

Postby rourkem » Sun May 31, 2015 12:52 am

Looks like no one has ever done this yet. Would be nice to see if this can be done.
Windows 8 | Framework 2.0 Image
User avatar
rourkem
 
Posts: 166
Joined: Tue Oct 28, 2014 3:20 pm

Re: Simple trigger formula

Postby Torino33 » Sun May 31, 2015 7:56 am

rourkem wrote:Looks like no one has ever done this yet. Would be nice to see if this can be done.


It can be done. It's just that i'm thick when it come to code even simple excel formula. :|

This spreadsheet from Gary http://www.gruss-software.co.uk/Excel/GreenUp_Auto.xls would have done the job if i knew how to add this into the spreadsheet:

In column R you can use the plusTicks or minusTicks function.
eg. =minusTicks(H5,1) to subtract 1 tick to the lay odds which is the same as laying at the back odd

Function getPrevOdds(ByVal odds As Currency) As Currency
Dim oddsInc As Currency
Select Case odds
Case 1.01 To 2
oddsInc = 0.01
Case 2.02 To 3
oddsInc = 0.02
Case 3.05 To 4
oddsInc = 0.05
Case 4.1 To 6
oddsInc = 0.1
Case 6.2 To 10
oddsInc = 0.2
Case 10.5 To 20
oddsInc = 0.5
Case 21 To 30
oddsInc = 1
Case 32 To 50
oddsInc = 2
Case 55 To 100
oddsInc = 5
Case 110 To 1000
oddsInc = 10
End Select
If Math.Round(odds - oddsInc, 2) >= 1.01 Then
getPrevOdds = Math.Round(odds - oddsInc, 2)
Else
getPrevOdds = 1.01
End If
End Function

Function getNextOdds(ByVal odds As Currency) As Currency
Dim oddsInc As Currency
Select Case odds
Case 1 To 1.99
oddsInc = 0.01
Case 2 To 2.98
oddsInc = 0.02
Case 3 To 3.95
oddsInc = 0.05
Case 4 To 5.9
oddsInc = 0.1
Case 6 To 9.8
oddsInc = 0.2
Case 10 To 19.5
oddsInc = 0.5
Case 20 To 29
oddsInc = 1
Case 30 To 48
oddsInc = 2
Case 50 To 95
oddsInc = 5
Case 100 To 1000
oddsInc = 10
End Select
If Math.Round(odds + oddsInc, 2) <= 1000 Then
getNextOdds = Math.Round(odds + oddsInc, 2)
Else
getNextOdds = 1000
End If
End Function

Function plusTicks(odds As Currency, ticks As Byte) As Currency
Dim i As Byte
For i = 1 To ticks
odds = getNextOdds(odds)
Next
plusTicks = odds
End Function

Function minusTicks(odds As Currency, ticks As Byte) As Currency
Dim i As Byte
For i = 1 To ticks
odds = getPrevOdds(odds)
Next
minusTicks = odds
End Function

Unfortunately i have no idea how and where to put this code into GreenUp_Auto.xls spreadsheet.
Torino33
 
Posts: 13
Joined: Thu Feb 12, 2009 8:35 am


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 36 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.