Cancel and clear

Please post any questions regarding the program here.

Moderator: 2020vision

Cancel and clear

Postby Elf » Wed Oct 20, 2021 9:52 am

I want to cancel a back bet if the conditions change after the bet is accepted pending but clear the bet ref so if the back bet trigger applies again it fires again. I’m using a IF statement that if the criteria fits I “BACK-SP” with the odds set at my maximun figure but if the criteria changes and no longer applies, I want to cancel the bet and clear the reference so that if the criteria fits again it fires.
I have =IF(AND(Criteria fits),”BACK-SP”, “CANCEL-CLEAR”)

Would that be a valid way of using the CANCEL and CLEAR triggers?

I’m aware if I am matched before In Play and taking SP that the bet stands.
Elf
 
Posts: 13
Joined: Thu Aug 30, 2018 11:37 pm

Re: Cancel and clear

Postby Captain Sensible » Wed Oct 20, 2021 1:27 pm

Not sure what you mean by CANCEL as you can't cancel a bet on Betfair you'd have to send an opposing bet with the same odds or liability to 'CANCEL' it. You can just use 'nested' formulas in excel , so where you have “CANCEL-CLEAR” you could have another IF formula to check between cancel and clear. I think you can have at least 27 nested IF formulas depending on the version of excel you use.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancel and clear

Postby Captain Sensible » Wed Oct 20, 2021 3:41 pm

Think I might have read your post incorrectly and thought where you said accepted you meant it was matched but you just mean it's waiting to be matched?

Haven't used formulas for a while as most of us use VBA for complicated routines as you get more control but generally you have to work backwards and ensure you don't get into loops when using formulas as it's easy to empty your account with bets continually being sent when using CLEAR or CANCEL. As far as I'm aware CANCEL acts pretty much the same as CLEAR and clears the bet reference for you when cancelling the bet.

What I'd do is make the most of your matched bet and bet reference columns to drive any routine and think your trigger sequence back to front.

So say we only wanted to bet when the odds were 25 or over the formula might be something like

=IF(AND(F5<25,T5<>"",W5=""),"CANCEL",IF(AND(F5>=25,T5=""),"BACK-SP",""))

So the routine first checks if we have already bet and if that needs to be cancelled, the W5="" is checking that we don't have any matched portion of a bet so hopefully you don't get into a loop of sending bets. I say hopefully as the API can do funny things and not send data that's why VBA gives you much better control on when to or when not to bet as you can use the MyBets worksheet to see what bets are matched or outstanding , any errors with a formula could end up with your account being bet. I wouldn't recommend re arming your bets using formulas or certainly trial these things with low stakes before you let it go live.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Cancel and clear

Postby Elf » Thu Oct 21, 2021 8:54 am

Thanks for that Captain. Unfortuately I am more adept with Excel formula than VBA. I will try your suggestion. Appreciate you taking the time.
Elf
 
Posts: 13
Joined: Thu Aug 30, 2018 11:37 pm


Return to Help

Who is online

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

cron