Cancelling remaining bets

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Cancelling remaining bets

Postby posimmo » Sun May 31, 2015 3:39 pm

Although I have been using Gruss BA for years, I am just entering the exiting world of Excel Triggered betting - it's marvellous :D

Forgive me if this question is a bit simplistic but that does describe me. My question is this

I place a number of bets before the off and use the trigger BACK-IP to keep them in play. Is there any way to cancel remaining bets in play if two bets are taken. If there is, I assume it's a command I have to add to the Trigger (or not!). Can anyone help?

Regards

Polly
posimmo
 
Posts: 27
Joined: Sun Feb 08, 2015 1:41 pm

Re: Cancelling remaining bets

Postby Captain Sensible » Sun May 31, 2015 3:56 pm

There are plenty of triggers to cancel all bets, basically you'd just have your sheet monitor the market for when two bets had been matched then send whichever cancel trigger you wanted into the market. Here's a list of the cancel triggers http://www.gruss-software.co.uk/Betting ... iggers.htm and you can monitor the bets either by using the MyBets sheet option and checking that with formulas or VBA or just using formulas to compare the stake and matched stake columns S & V. All the info you need is there just depends how clued up you are with Excel as to how you approach it.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancelling remaining bets

Postby posimmo » Sun May 31, 2015 6:51 pm

Thank you Captain Sensible

Please forgive my ignorance but when you say

"you'd just have your sheet monitor the market for when two bets had been matched then send whichever cancel trigger you wanted into the market"

I understand perfectly the language I just don't have a clue how to do that. I realise there are cancel triggers I just don't know where to place them.

Regards

Polly
posimmo
 
Posts: 27
Joined: Sun Feb 08, 2015 1:41 pm

Re: Cancelling remaining bets

Postby Captain Sensible » Sun May 31, 2015 7:00 pm

All triggers go in the Q column, so you'd just replace your BACK-IP trigger with something like a CANCEL-ALL-MARKET trigger command when your criteria was met and that would cancel any remaining bets within the market.

I've no idea how you trigger the criteria for your current bets but most people use things like nested IF statements within excel to chnage once the criteria is met or even VBA to trigger all the bet commands in column Q
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancelling remaining bets

Postby posimmo » Sun May 31, 2015 8:54 pm

Thank you, Captain Sensible, I think I may just be starting to understand even if I don't have the mechanics right. I have tried to write an IF statement relating to the value of AA5. If it equals "1" then I want the current trigger to remain in place but if that value changes I want the trigger in Q5 to change to "CANCEL". I have written it below.

=IF(AA5=1,Q5=IF(AH5=2,"BACK-IP"),Q5="CANCEL")

Obviously I have not written it correctly because if the value in AA5 changes, the trigger in Q5 remains the same. Can you spot the not so deliberate mistake.

Thanks again.

Regards

Polly
posimmo
 
Posts: 27
Joined: Sun Feb 08, 2015 1:41 pm

Re: Cancelling remaining bets

Postby Captain Sensible » Sun May 31, 2015 9:18 pm

Basically excel formulas will just change the cell that they're put in so if you enter the formula in cell Q5 you dont need to add all the Q5=etc..... stuff as it wont do anything.

The IF statement in excel just has two options either true or false and you can assign a new value for either or both of those, entering this in Q5 would either show BACK_IP if AA1 = 1 if not it would show CANCEL.

=IF(AA1=1,"BACK_IP","CANCEL")

If you wanted to get more complicated routines instead of something showing CANCEL you may stick in another IF statement to give you more options. I've always found Excel's own help screens very good for showing examples of the various formulas if you get stuck. If you're not too clued up with excel I'd spend sometime learning the various formulas before betting automated as it's very easy for routines to go into a loop and bet away your balance if you don't know what you're doing.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancelling remaining bets

Postby Joe68 » Mon Jun 01, 2015 5:55 am

You can take baby steps once you think you've got some usable code too.

Run it with trigger betting disabled (a setting in Betting Assistant) - it can't touch your account that way. Watch its operation for the course of an entire race. Watch it like a hawk and make sure that it does what you want. Fix. Repeat. Make sure it works as expected a dozen times in as many different scenarios as you can think up.

The problem is you will not get feedback from the server on filled bets, so, then...

Set it so that it's only betting 0.01 at a time. Test it. Be ready to just close the software if it goes beserk blowing dough. Take screen shots of its operation as you go so that you've a record of the state of things to rehash afterwards. There are other ways to keep records, but I think this fits your coding skills for now. Fix. Repeat. Make sure it works as expected a dozen times in as many different scenarios as you can think up.

Most importantly, every time you change your code, store a copy of the worksheet, date and time stamped, so that you can roll back your changes if you want. It's a pain to go through half a dozen changes, only to realise that the original was closest to what you wanted, but you've written over what you had.

Try 0.02 per bet. etcetera. Right up to the point where you think you know what it is going to do. Be prepared for surprises.
Joe68
 
Posts: 47
Joined: Tue Jan 22, 2013 9:50 pm

Re: Cancelling remaining bets

Postby Joe68 » Mon Jun 01, 2015 7:44 am

Warning.

Even when you're betting 0.01, you can still lose 5.00 - because of how BA must place bets < 5.00. IE, it places an order for 5.00, adjusts it to 5.01, which results in the original 5.00 bet and a separate bet of 0.01. Cancels the 5.00 bet then adjusts the 0.01 bet.

That's a Betfair requirement and if the faux bet of 5.00 happens to get filled, you're just set for 5.00. That will be at prices of either 1.01 or 1000, depending on whether you backed or laid. This can easily happen during in-play betting and BF delays your betting to boot (for entirely reasonable purpose - see movie "The Sting").

There's no way around it if you want to live test.

Non-live testing; you can note down the information fed from the server, place it in your spreadsheet and ensure that the spreadsheet does what you want. That's fine for incell functions, but more is required if you're using VBA.
Joe68
 
Posts: 47
Joined: Tue Jan 22, 2013 9:50 pm

Re: Cancelling remaining bets

Postby posimmo » Mon Jun 01, 2015 9:19 am

Thanks a million, Captain, I see it all now, it's totally clear as mud.

Of course the IF statement has to go in the Q cells. The thing I had missed was making use of the two alternatives in the IF statement. If one scenario is true then the BACK trigger is operational whilst if another scenario is true, the CANCEL trigger operates - simples :)

Thank you again and also thanks to you, Joe, I will try to walk before I run :)

Regards

Polly
posimmo
 
Posts: 27
Joined: Sun Feb 08, 2015 1:41 pm

Re: Cancelling remaining bets

Postby Captain Sensible » Mon Jun 01, 2015 12:52 pm

Remember you can 'nest' lots of IF statements all together depending on what version of excel you use so even without VBA you can make complicated 'bots' . It's generally best to do some kind of flow chart so you can keep track, so if you're first statement comes up true that response could also contan a nested IF statement and so on like these examples http://www.excel-easy.com/examples/nested-if.html

You also have plenty of other criteria you can apply like AND or OR etc The simplest way for you to see if a bet is matched would be to compare the stake in Column S with the Matched Stake in column W if the stae is a static amount and doesn't change with some formula.

So in say column AA5 down you'd have a simple IF =IF(W5=S5,1,0) but that would show as 1 if both columns showed 0 so we need to add additional criteria, something like an AND statement gives us the option to set the amount should be over 0 so now we have =IF(AND(W5=S5,S5>0),1,0) which just gives us the AA column filled with 0's and 1's which we can easily add up to see if 2 or more bets have been matched using a SUM formula SUM($AA$5:$AA$100) ( The $ sign stops the cells references from being changed when copying).

So to put all those parts together we'd always start with looking to protect our bank at all costs so try not to have backing or cancelling routines hidden away deep in complicated formulas unless you're sure of what you're doing. So we'll have a simple IF statement that cancels bets if 2 bets have been matched

=IF(SUM($AA$5:$AA$100)>=2,"CANCEL",FALSE)

In the FALSE we'll stick you're betting routine of firing when AA1=1

=IF(SUM($AA$5:$AA$100)>=2,"CANCEL",IF($AA$1=1,"BACK-IP",FALSE))

So that would be copied down your trigger column Q from Q5 down to say Q50 and in coumn AA5 to AA50 you'd copy =IF(AND(W5=S5,S5>0),1,0) ensuring that the relative cells changed i'e' in column AA6 the cell references read as =IF(AND(W6=S6,S6>0),1,0) etc
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancelling remaining bets

Postby posimmo » Mon Jun 01, 2015 4:31 pm

Thanks, Captain, that's brilliant.

I did write an IF statement this morning (6 a.m. couldn't sleep) that is nothing like as smooth as yours but is working so far. All I did was keep putting simple IF statements in columns giving value 0 or 1 and only backing if the sum of those columns equalled the correct number. I didn't know about putting IF statements within other IF statements, so I'm going to practice that. It's nice when it works but it's even better if it looks cool like yours :)

Regards

Polly
posimmo
 
Posts: 27
Joined: Sun Feb 08, 2015 1:41 pm


Return to Discussion

Who is online

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