Time trigger

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

I've developed a spreadsheet which I'd like to adapt to auto trade. I came up with a macro which would cancel all bets after x seconds of in-play time. This seemed to work OK with manual testing, but as soon as I connect to BetAngel it doesn't fire at all. Any ideas why this should be - or is there a time trigger example anywhere else that I could use? My VBA knowledge is limited and mostly acquired through Googling. Any suggestions would be much appreciated.
User avatar
Euler
Posts: 24816
Joined: Wed Nov 10, 2010 1:39 pm
Location: Bet Angel HQ

There is a countdown timer on the spreadsheet that counts down to the start of an event or UP from the start of an event, you may want to use that?
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

Yes, that's what I'm using to trigger my macro. I want to cancel all bets at (say) after 20 seconds in play according to the timer. Are you saying that I could achieve this by somehow incorporating the command in my bet rules?
User avatar
Euler
Posts: 24816
Joined: Wed Nov 10, 2010 1:39 pm
Location: Bet Angel HQ

You could trigger the cancel all global rule using this timer I would imagine? You wouldn't need to use a macro to do this.
User avatar
TheTub
Posts: 267
Joined: Thu Mar 26, 2009 7:53 pm
Location: Nottinghamshire

Be careful how you use the countdown timer.

Excel stores the time as a decimal fraction so 00:00:01 for one second is actually 0.0000115741. But as soon as the countdown timer displays a negative value (-00:00:01) then there is no decimal equivalent and the value is stored in the cell as text.

Therefore, if you are relying on the countdown timer having a decimal fraction equivalent then you need to strip the negative symbol, convert to a true time format then work with the decimal fraction.

See here for a quick overview of the decimal fraction time value - http://support.microsoft.com/kb/214094
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

Thanks to both. Particularly over how time is presented. I realised there was a problem with negative time, but found a way to work around it. How would you get rid of the negative sign?
User avatar
Shamrock
Posts: 205
Joined: Thu Sep 30, 2010 11:41 am
Location: Perth Wester Australia

Multiply it by minus 1
User avatar
TheTub
Posts: 267
Joined: Thu Mar 26, 2009 7:53 pm
Location: Nottinghamshire

You can't multiply text by minus 1.

You need to strip out the negative symbol and format as time.

I use this formula to get an Excel decimal fraction from the countdown cell during in-play:

=TIMEVALUE(RIGHT(F4,8))

And format the cell as a number to 8 decimal places.
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

Many thanks
foxwood
Posts: 394
Joined: Mon Jul 23, 2012 2:54 pm

TheTub - thanks for that - saved me putting the thinking cap on where the negative was crashing my sheet :)
qvaz
Posts: 1
Joined: Sun Nov 04, 2012 11:48 pm

Hi, I have some problems with my macro that should save in cell time of last market suspension - sometimes catches that time sometimes doesnt. It's a pity that BetAngel doesn't provide neither Last Suspension Time reference to excel cell nor excel instruction such as "DELAY" that could postpone trigger firing. Somebody could help with reliable action-delaying macro?
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”