Trying to use the Q2 -1 trigger

Please post any questions regarding the program here.

Moderator: 2020vision

Trying to use the Q2 -1 trigger

Postby ians1711 » Thu Apr 08, 2010 5:29 pm

Hi
Trying to use Excel (Visual Basic) to move through a list of markets using the -1 trigger. The code is storing LAY against my selection and setting Q2 to -1 within the same IF statement. What appears to be happening is that a LAY bet is being placed on the current market, the next market is then displayed, and a LAY bet is then placed on the next selected market as well. What do I need to do to ensure the original LAY bet is the only one placed?

Thanks
Ian S
ians1711
 
Posts: 72
Joined: Fri Jul 11, 2008 9:33 pm

Postby Captain Sensible » Thu Apr 08, 2010 7:25 pm

Stick something in your code to reset the cell or range of cells containing LAY to "" after the bet is placed and just before setting Q2 to -1.

Alot depends on how you're triggering the LAY part of your sheet but basically you need to clear the LAY from the sheet before opening a new market
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby ians1711 » Thu Apr 08, 2010 7:31 pm

Captain
Does the LAY stay there after the bet is placed? What would happen if I cleared the cell too quickly? Should I be looking for a valid bet ref before clearing the cell and triggering with -1?

Thanks so far
Ian S
ians1711
 
Posts: 72
Joined: Fri Jul 11, 2008 9:33 pm

Postby Captain Sensible » Thu Apr 08, 2010 7:38 pm

I think BA loads the market then on the next refresh will process any bets .

So if you're firing bets via some formula it'd load the market, process any formulas then if the formulas came up with LAY it'd fire a bet on the next refresh

If you're using VBA to decide whether to place a bet then just clear the previous LAY's on the market change

Just add something like

Range("Q5:Q50").Value = ""

at the start of your VBA or even use a separate sub like

Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("Q5:Q50").Value = ""

End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub

to clear them on market change
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby Captain Sensible » Thu Apr 08, 2010 7:42 pm

Basically if you're adding the LAY to the sheet using VBA you'll have to clear those refs yourself
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm


Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 34 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.