Trigger 1 but cancel others

Please post any questions regarding the program here.

Moderator: 2020vision

Postby Captain Sensible » Wed Aug 03, 2011 11:11 pm

You should also be using the CANCEL-ALL instead of CANCEL if you have bets on the exchange not placed with excel. CANCEL will only cancel the bet reference of any unmatched bet whereas CANCEL-ALL will cancel any unmatched bets on that selection

=IF(AND(SUM($W$5:$W$46)>0,W5=0),"CANCEL-ALL",IF(AND(F5>=3.5,F5<=4.1),"BACK",""))
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby todger » Thu Aug 04, 2011 8:48 am

Thanks Captain, will try the new order of the formula today to see what happens. Yep the W3 was just a typo, I understand the concept and the references better now, though still a long way from originating my own formulas containing more than one condition.

Thanks also to Ian and my fellow newbie Bertrand for their help - I will keep you posted as tp progress.

Excellent forum, people trying to genuinely help rather than show how clever they are or score points - it's very refreshing.

Todger
todger
 
Posts: 16
Joined: Wed Jul 27, 2011 7:35 am

Postby todger » Thu Aug 04, 2011 9:02 am

Captain - Just re-read your last post and the fill and kill option would definitely be useful to me as a part of the strategy (so that I have the discipline of getting out before the prices go haywire in the last few furlongs.

Is this something that can be worked into a formula or is it something that can be applied to a range of the placed bets generically ? (as opposed to the field).

Todger
todger
 
Posts: 16
Joined: Wed Jul 27, 2011 7:35 am

Postby Captain Sensible » Thu Aug 04, 2011 11:16 am

Have a read thru the manual at http://www.gruss-software.co.uk/Betting ... p/help.htm for the section using excel->trigger modifiers as it'll explain them better than me, what they all do

But yes simple enough to add them into any existing triggers just a case of changing any current trigger "BACK" to and new one with whatever extra attributes or combination you want attached i.e.

"BACK-TL20-F1" sends in a back bet that will be live for 1 second (fill or kill F1) If any matches it'll send an opposing lay bet 20 ticks lower set to level any profit rather than use the same stake T(tick)L(level profit)20(number of ticks)
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby todger » Thu Aug 04, 2011 1:23 pm

Thanks - read that now and it does make sense. Trouble is what I really wanted to do was cancel all bets automatically (including conditional ones) a certain amount of time after the off. The purpose was to avoid the risky period as a race approaches the end. It looks like I can put the fill or kill instruction for bets already placed in the market - ie not conditional ones, unless I have got this wrong.

On a related note, is there a way to set the timer on the Gruss page to zero at the start of the race so it acts as a race timer rather than a countdown to the next event. Apologies if the answer to this is obvious.

Todger
todger
 
Posts: 16
Joined: Wed Jul 27, 2011 7:35 am

Postby Captain Sensible » Thu Aug 04, 2011 1:47 pm

todger wrote:It looks like I can put the fill or kill instruction for bets already placed in the market - ie not conditional ones, unless I have got this wrong.


Not too sure what you mean by that, The fill and kill option works with the bets placed via excel because you just set a certain amount of seconds that bet should be live for. BACK-F10 just means any of the unmatched back bet will be automatically cancelled after 10 seconds. So for any bets already within the market you'd either have had to place them using fill or kill option (either will excel or via the normal BA interface).

Alternatively you have to code things to cancel those after the race has been running for a certain amount of time. This is generally where excel formulas don't cut the mustard and you need to start using VBA.

If you search the site you'll find quite a few snippets of VBA where people are doing similar things to monitor the exact start times. Basically as all the times being sent to excel are continually changing and there's no way for BA to send the exact off time from betfair to excel you need to freeze the time the race changes to inplay to get a good idea of the off time. Once you have that time frozen you can then use that to say cancel 10 seconds into the race.

Even then you're still susceptable to things like false starts or errors on betfairs part turning thing in play too early and resuspending etc but it's probably the best option available.

VBA might seem complicated at first but sometimes it's a neccessary evil. A small piece of code like this would log the seconds from the time the market went in play into cell X2 that you casn then reference for any other triggers

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
If Cells(2, 5) = "In Play" Then
If Cells(1, 24) = "" Then Cells(1, 24) = Cells(2, 3)
If Cells(1, 24) <> "" Then Cells(2, 24) = DateDiff("s", Cells(1, 24), Cells(2, 3))
End If
If Cells(2, 5) <> "In Play" And Cells(2, 6) <> "Suspended" Then
Cells(1, 24) = ""
Cells(2, 24) = "Not In Play"
End If
Application.EnableEvents = True


End Sub
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby todger » Thu Aug 04, 2011 8:15 pm

Thank you - I seem to be getting ever deeper into excel with a danger of running before I can walk.

The point is not really to cancel bets placed (or at least not just these) but those that are ready and waiting to be triggered if the conditions arise. The idea being that I don't want to be in the market place after a certain amount of time has lapsed since the off.

From what you say that is possible with VBA which is a whole new planet to me. I will try to find some relevant threads and that might help me make sense of your formula as you suggest.

Had a reasonable day tinkering today, but hard to put a thorough test it because i kept getting a "market loading (req's pending)" or something message which never actually produced a market unless I logged out, fired up BA again and then excel only for something similar to arise subsequently. I tried just creating a new page but this made my computer impossibly slow. Is there a set procedure to follow when this happens?

Thanlks for the help as always it is very much appreciated. I can't remember being so excited about racing investments in a long time.

Todger
todger
 
Posts: 16
Joined: Wed Jul 27, 2011 7:35 am

Postby GaryRussell » Thu Aug 04, 2011 8:50 pm

Had a reasonable day tinkering today, but hard to put a thorough test it because i kept getting a "market loading (req's pending)" or something message which never actually produced a market unless I logged out, fired up BA again and then excel only for something similar to arise subsequently. I tried just creating a new page but this made my computer impossibly slow. Is there a set procedure to follow when this happens?

That suggests it was busy trying to copy data to Excel. Those are the "requests pending". Next time you see this check if Excel is responsive, ie. will it allow you to type in a cell? If it's not responsive you'll need to figure out why. It could also be that you had started editing a cell and not finished. When Excel is in this state BA will get stuck updating it. Check if that's the case.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby todger » Sat Aug 06, 2011 7:06 pm

Thanks Gary, it didn't happen at all today when I just let it run, and yesterday I was going back and forth between markets, tinkering with excel as I did so, so your explanation makes sense.

Happy to report that the formula worked today as well - I think Captain Sensible's suggestion to reverse the order around did make a difference. It is a good little idea I have got going but I still need to sit down and work out how to iron out some factors.

In terms of writing in an offset I am presuming that it would relate to the price I put in column R and not the price actually taken.

Many thanks,

Todger
todger
 
Posts: 16
Joined: Wed Jul 27, 2011 7:35 am

Previous

Return to Help

Who is online

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