Cancelling Unmatched Bets Problem

Please post any questions regarding the program here.

Moderator: 2020vision

Cancelling Unmatched Bets Problem

Postby jrarmstrong » Sat Mar 31, 2012 5:56 pm

Hi,

I am using a slightly modified version of the Multiple Bets sheet to trade in play. The only changes I have made are to the formula in column Q of the Market sheet to insert “CANCEL-KO” if a flag set in the MyBets sheet returns 1 and to only trigger positions once a market is in play.

I have written some code to insert the word “CANCEL” into column T using the same flag that triggers the CANCEL-KO formula. A worksheet calculate event in the MyBets sheet calls the macro. Both bits of code are below.

The formula and the code work in the sense that they populate columns Q and T but this does not have the effect of actually cancelling the unmatched positions.

Can anyone point out what I am doing wrong?

I am using the latest beta version.

Thanks,

James

Code: Select all
Private Sub Worksheet_Calculate()
Application.ScreenUpdating = False
If Range("K2") = 1 Then
   Cancel
Application.ScreenUpdating = True
End If
End Sub


Code: Select all
Sub Cancel()
    Sheets("Market").Range("T5:T55") = "CANCEL"
End Sub
jrarmstrong
 
Posts: 54
Joined: Fri Sep 23, 2011 6:27 pm

Postby Captain Sensible » Sat Mar 31, 2012 8:12 pm

I know not everyone uses A1 as there Top left hand cell but if you are then the CANCEL should be input into the trigger column Q and not in the bet reference column T.

If T is your trigger column then you need to remember CANCEL will only cancel whatever bet reference is in the bet ref column.

As you're using the beta version you might as well use the CANCEL-ALL-MARKET trigger as it'll be quicker.

Something like this should be sufficient

Code: Select all
Sub Cancel()
    Sheets("Market").Range("Q5").Value = "CANCEL-ALL-MARKET"
Sheets("Market").Range("T5").Value = "1"
End Sub


If your trigger and bet ref columns aren't Q & T just change them to whatever they are.
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby jrarmstrong » Sun Apr 01, 2012 5:23 pm

Thanks Captain.

Turns out I was trying to use a trigger designed to cancel individual positions in the way that the "CANCEL-ALL" triggers work. The Place Bets sheet blanks the bet reference so additional positions can be opened on the same selection. The individual cancel triggers require the ref to execute rather than just anything in the bet ref column.

James
jrarmstrong
 
Posts: 54
Joined: Fri Sep 23, 2011 6:27 pm


Return to Help

Who is online

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