Double Betting

Please post any questions regarding the program here.

Moderator: 2020vision

Double Betting

Postby steven » Thu Dec 08, 2011 10:10 pm

I'm just getting started with vba triggered betting, and I have hit a slight hicup. When I trigger a bet and the bet reference is returned on the following update, then all is well, but occasionally the bet isn't matched untill the second time round and this is activating a second bet being placed. I have a flag which is set when a bet is placed, in order to stop any further bets occuring by the program untill a bet is fully matched, and this appears to work, but there is still a second bet going off for the same amount and oods. Is this me (very likely) or is BA picking up on the "BACK" trigger twice when the Reference cell is still empty and sending a second bet. I am just using the standard 1 second interval for updates.
Thanks
steven
 
Posts: 7
Joined: Mon Jul 18, 2011 12:55 pm
Location: Bedfordshire

Postby GaryRussell » Fri Dec 09, 2011 7:51 am

If your VBA code is inserting the trigger during the worksheet_change event then this can cause problems if you don't insert the trigger during the appropriate update. We advise that you only insert the trigger when the prices are updated. See example code below. Note that it only runs when the updated column count is 16 which is when the prices are updated and the triggers are processed by Betting Assistant. It also disables events because when your code inserts the trigger it will cause the event to fire again unnecessarily. It's definitely not BA picking up the empty cell just because it isn't matched. It actually inserts "PENDING" before the bet is even placed to prevent multiple bets.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Columns.Count = 16 Then
        Application.EnableEvents = False
        ' insert your code here
        Application.EnableEvents = True
    End If
End Sub
User avatar
GaryRussell
Site Admin
 
Posts: 9894
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby steven » Fri Dec 09, 2011 9:59 am

Thanks Gary I just needed the confirmation that it's me. My code is in the correct place and fires at the correct time. But then it gets complicated. I do not get the Pending notification, so i guess my sequence is too long or I'm missing something and overwriting the columns Q-T again. I figured you would have put in place a check, I must be messing it up. Can I find the timing and sequence of events that BA goes through anywhere, so that I can trim down my code and fit it in the gaps.
Thanks
steven
 
Posts: 7
Joined: Mon Jul 18, 2011 12:55 pm
Location: Bedfordshire


Return to Help

Who is online

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