CANCEL-ALL-LAY

Please post any questions regarding the program here.

Moderator: 2020vision

CANCEL-ALL-LAY

Postby andrej » Thu Dec 15, 2011 2:13 pm

Hello, I have a question regarding this trigger from excel. At a certain moment I want to cancel all Lay bets in the market. The way I do this is that I have a macro to input "CANCEL-ALL-LAY" into trigger cell for each horse.

The problem with this is that the bets are not cancelled imediately but it seems like one bet is cancelled on each refresh going from the first horse down. Is it the way it should be or am I doing something wrong?

is there any simple way of canceling all lay bets at the same time?

thank you

best regards
Andrej
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby GaryRussell » Thu Dec 15, 2011 6:04 pm

They are all cancelled on the same refresh. I take it your spreadsheet is giving you the impression that this isn't the case, can you provide an example spreadsheet that demonstrates this?
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby andrej » Thu Dec 15, 2011 6:17 pm

Hi Gary, I have noticed this in the betting assistant. I was watching the odds move and then I saw the bets disapearing one by one for about 5 seconds.
I am not sure how to upload the sheet here so here is part of the code responsible for triggering the cancel

Do Until mybets = ""
If mybets = "B" Then
Do Until horse = ""
trigger = "CANCEL-ALL-LAY"
Set horse = horse.Offset(1, 0)
Set trigger = trigger.Offset(1, 0)
Loop
End If
Set mybets = mybets.Offset(1, 0)
Loop

I believe this is putting in CANCEL-ALL-LAY in one refresh so the cancel should be done on the next.

Andrej
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby GaryRussell » Fri Dec 16, 2011 7:57 am

Code: Select all
Set mybets = mybets.Offset(1, 0)

The above statement is updating the cell in the worksheet?
Do you use "Application.EnableEvents = False" to prevent further events firing? If not then this could be the problem. Try changing your code to read as follows.

Code: Select all
Application.EnableEvents = False
Do Until mybets = ""
If mybets = "B" Then
Do Until horse = ""
trigger = "CANCEL-ALL-LAY"
Set horse = horse.Offset(1, 0)
Set trigger = trigger.Offset(1, 0)
Loop
End If
Set mybets = mybets.Offset(1, 0)
Loop
Application.EnableEvents = True
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK


Return to Help

Who is online

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