Moving from race to race

Please post any questions regarding the program here.

Moderator: 2020vision

Moving from race to race

Postby Drunkenight » Tue Sep 25, 2018 2:23 pm

I am trying to move on from a race if it has been delayed by more that 5 minutes. I am presuming that the only way to do this is to use the Q2 trigger. Does anyone have some good VBA code that will do this?

Secondly, I already have code in the Q2 cell with the required refresh rate. So in cell Q2 I already have =IF(Betfair!$B$3>100000,0.2,5). Whenever I try and use VBA code to place a trigger in the Q2 cell it deletes the code I already have in Q2. Is there any way around this?

Any help would be gratefully received.

Many thanks.
Drunkenight
 
Posts: 243
Joined: Thu Apr 02, 2009 1:38 pm

Re: Moving from race to race

Postby StuT » Tue Sep 25, 2018 3:41 pm

Do you have all the meeting/races in one pick list and you're concerned about missing the next race if the delay is more than 5 mins or so ?

If so, i'd be inclined to have separate tabs for each meeting, that way the delay won't affect the next race as it's at the same meeting.
StuT
 
Posts: 87
Joined: Sun Dec 06, 2015 9:58 pm

Re: Moving from race to race

Postby Drunkenight » Tue Sep 25, 2018 5:27 pm

Thanks for the reply.

'Do you have all the meeting/races in one pick list and you're concerned about missing the next race if the delay is more than 5 mins or so ?' - Yes this is exactly what I am trying to do.


'If so, i'd be inclined to have separate tabs for each meeting, that way the delay won't affect the next race as it's at the same meeting.' - This is how I have it currently, separate tabs for each meeting, but I want to put all the races into one tab.

Thanks
Drunkenight
 
Posts: 243
Joined: Thu Apr 02, 2009 1:38 pm

Re: Moving from race to race

Postby Captain Sensible » Tue Sep 25, 2018 7:02 pm

Drunkenight wrote:I am trying to move on from a race if it has been delayed by more that 5 minutes. I am presuming that the only way to do this is to use the Q2 trigger. Does anyone have some good VBA code that will do this?

Secondly, I already have code in the Q2 cell with the required refresh rate. So in cell Q2 I already have =IF(Betfair!$B$3>100000,0.2,5). Whenever I try and use VBA code to place a trigger in the Q2 cell it deletes the code I already have in Q2. Is there any way around this?

Any help would be gratefully received.

Many thanks.


You could always have your VBA re-write the IF formula into Q2 once it enters a new market but realistically if you're using VBA to monitor B3 it can just as easily cope with adding 0.2 or 5 into the Q2 cell at the same time as checking for delayed markets. Dunno if you're aware but BA also sends the start time of the next race into D1 (I think , been a while) so I usually use that also to decide if I want to move on from a market early.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Moving from race to race

Postby Drunkenight » Wed Sep 26, 2018 1:10 am

Hi Captain,

Yes I think you are right! I think it is best to right some VBA to set the refresh rate in Q2 and also check for delayed markets. I didn't realise that D1 had the time of the next race; this will help me to decide when to move on.

Do you have any VBA code that checks for delayed markets and then moves on to the next market? I presume something like checking if the market is 5 minutes past the scheduled off and then puts a -1 in Q2.

Many thanks for all your help.
Drunkenight
 
Posts: 243
Joined: Thu Apr 02, 2009 1:38 pm

Re: Moving from race to race

Postby Captain Sensible » Wed Sep 26, 2018 2:03 pm

Not off hand all my market moves routines rely on other coding, I've no idea if you already have vba so need to squeeze it in or check for inplay etc but the parts you need are easily available to make an IF routine in vba

Basically D2 contains the time to the off but converts to text format after the off because of the minus sign, this means you can simply check if it's text and if so it's gone past the off time , once you know it's past the off time you'd just check the start time against the current time to see if it's over 5 minutes
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Moving from race to race

Postby Captain Sensible » Thu Sep 27, 2018 9:59 pm

Here's something that should work on the dogs or horses for you , looks more complicated than it is, you just need to put the middle bits in your own code if you already have vba on your sheet

Code: Select all
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Static switchedMarket As String
Dim raceTime() As String, delay As String

If Target.Columns.Count <> 16 Then Exit Sub
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual

On Error GoTo Xit:

With Target.Parent

raceTime = Split(.Range("A1").Value, "-")
delay = Format(Time() - TimeValue(Left(Trim(raceTime(1)), 5)), "hh:mm:ss")

If WorksheetFunction.IsText(.Range("D2").Value) And delay > TimeValue("00:05:00") And switchedMarket <> .Range("A1").Value Then
.Range("Q2").Value = -1
switchedMarket = .Range("A1").Value
ElseIf Worksheets("Betfair").Range("B3").Value > 100000 And .Range("Q2").Value <> 0.2 Then
.Range("Q2").Value = 0.2
ElseIf Worksheets("Betfair").Range("B3").Value <= 100000 And .Range("Q2").Value <> 5 Then
.Range("Q2").Value = 5
End If

End With


Xit:
    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic
   
End Sub
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Moving from race to race

Postby Drunkenight » Sun Sep 30, 2018 11:34 am

Hi Captain,

Great thanks for that. I will try the code out and let you know,

Thanks.
Drunkenight
 
Posts: 243
Joined: Thu Apr 02, 2009 1:38 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 24 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.

cron