Trigger

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

Moderator: 2020vision

Trigger

Postby Bezza » Tue Jun 05, 2007 1:20 pm

Can anyone please help.I want to use a certain function in excel to trigger a bet once certain conditions are matched.

e.g.If the value in cell A1 is 30 then the formula =And(A1>10,A1<40) would return TRUE.In this case I would like the "true"outcome to trigger a back bet.As you can probably tell I an a complete novice and would be grateful for any advice.
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby PeteB » Tue Jun 05, 2007 2:04 pm

In the Trigger cell for the runner, put =if(and(A1>10,A1<40),"BACK","WAIT")

The cell should display "WAIT" until your both tests in the And are true, when it will change to "BACK". This will fire a bet if the Odds and Stake cells are populated.
(you can use the same approach to populate the Odds and Stake cells too)
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby Bezza » Tue Jun 05, 2007 6:20 pm

Thank you very much Pete
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby Bezza » Tue Jun 05, 2007 7:09 pm

Pete,I tried that and it works a treat,however,it highlighted my next problem.In the same trigger cell I would also like the following =if(and(A1<10,A1>40),"LAY","WAIT").So under the given conditions the trigger would either back or lay.Is this possible.
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby PeteB » Tue Jun 05, 2007 8:27 pm

The syntax is
=if(<test condition>, <result if true>, <result if false>) and you can nest them

So to do:

if and(A1<10,A1>40)
BACK
else
if and(A1>10,A1<40)
LAY
else
WAIT
endif
endif

You would do =if(and(A1<10,A1>40),"LAY",if(and(A1>10,A1<40),"BACK","WAIT"))
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby PeteB » Tue Jun 05, 2007 8:27 pm

Rats - my indenting in my pseudo-code didn't work, and there's no edit!!! anyway I hope this makes sense...
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby PeteB » Tue Jun 05, 2007 8:31 pm

Doh - and I put the conditions the wrong way round grrrr.....

This time with consistent pseudo-code and Excel formula:

if and(A1>10,A1<40)
...BACK
else
...if and(A1<10,A1>40)
......LAY
...else
......WAIT
...endif
endif


=if(and(A1>10,A1<40),"BACK",if(and(A1<10,A1>40),"LAY","WAIT"))
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby Bezza » Tue Jun 05, 2007 9:08 pm

Pete, your a star.I was on the right lines myself but would still been trying this time tommorow.
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby Bezza » Tue Jun 05, 2007 9:50 pm

So far so good but am I right in assuming that it would keep firing bets unless I write a formula limiting to one bet per race.I would like to fire one bet only(either back or lay)per race and at a certain time before the race begins and not in play.My other point is that I would also like to back/lay to a set liability i.e. % of bank but I think Gary will introduce this function in the near future anyway.Again,I am indebted to you for your help.
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby PeteB » Tue Jun 05, 2007 10:49 pm

You're welcome :-)

It will only fire one bet - this will show 'pending' and then the bet reference once the bet is submitted. To place a new bet, you would have to clear the bet ref first. You can do this by making the trigger cell say CLEAR. Probably possible to do in formulae, but starts to get quite complex,and VBA code starts to be a better option.
Do Tools->Macro->Record New Macro
Then do some things, like typing BACK, LAY, or CLEAR in the trigger cell, or editing the odds or stake.
Then click the stop recording button
Then do Tools-Macro-Macros
Now double click on the macro you recorded, and you willsee the VBA code to repeat the options you did. This will give you some first clues on how to write VBA - there is lots of help on here on other threads.

For the % of account, you can get BA to send your account balance to Excel - it doesn't update all the time, only when you change market - but there's a cell you can set which will make it update (you'll have to search on here e.g. for 'balance' to find the thread)
Then you can use a formula in the stake column based on the balance.
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby Bezza » Tue Jun 05, 2007 10:58 pm

Makes sense but all I would want to do is to make sure the bet is triggered at a set time(30 secs before the start time)
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby PeteB » Wed Jun 06, 2007 9:10 am

Ok if you only want to place one bet, formulae should be fine - only one bet should be placed, as you can't place a second bet while the bet ref from the previous bet is still showing
Cell D2 will give you time before off - but for me it's an hour out, so would have to adjust for that too.

The time is stored in Excel format - so 30 seconds is 0.000347222222222222. There are some other recent threads that show how to do a neat test for whether the time is 30s without having to put numbers like that in your formulae.
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Postby Bezza » Wed Jun 06, 2007 10:18 am

So if I were to use the formula =Time(A1) in cell U5 the bet would be triggered at the time stated in A1?
Bezza
 
Posts: 54
Joined: Sat Mar 11, 2006 3:33 pm

Postby GeorgeUK » Wed Jun 06, 2007 4:03 pm

You will need to watch for bets not being sent if the time is not exactly right. I usually put >= so that if a second is missed, then the bet will still fire and as only one bet is sent, will not keep firing off repeat bets. Got caught on that one a few times - kept wondering why the bet didn't get sent at a specific time.
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland

Postby PeteB » Wed Jun 06, 2007 10:14 pm

But it's not cell U5

That's a cell that gets written to by the program - it tells you the time the bet hit betfair.

You need to set up a cell where you test the current time against your desired bet time, and then incorporate that test in the formula that chooses to back or lay
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm

Next

Return to Discussion

Who is online

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