excel file fires a bet twice

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
verycrispy
Posts: 18
Joined: Wed Jun 23, 2010 12:45 am

Hi all,

I have a problem, Ik put in some automated trades using the file which is explained in http://www.youtube.com/watch?v=WmBOhMpE5UI

I have done this with some success but sometimes excel fires two the same bets in the same second.

Have someone else the same problem and does someone know how I can solve this?

thanks in advance!
Photon
Posts: 206
Joined: Mon Nov 29, 2010 10:14 pm

It’s almost impossible for two bets to go on a single selection and it hasn't happened to me yet. Are you sure two bets were not placed on two different selections? If it is on a single selection then you might want to post a screenshot and log entry as I doubt there two bets placed on a single selection simultaneously.
PeterLe
Posts: 3726
Joined: Wed Apr 15, 2009 3:19 pm

Hi
If you are using the new version 1.27.3, you could add some conditions that check the matched and unmatched bets (you will need to use the new spreadsheet that accompanies 1.27.3 as the older spreadsheets no longer work correctly)

regards
Peter
User avatar
Shamrock
Posts: 205
Joined: Thu Sep 30, 2010 11:41 am

This has happened to me. I have set the spreadsheet to fire a bet in at a certain time, eg when the countdown clock hits 1:30.
I also have the CLEAR STATUS code.
Sometimes, not always, it would fire in two bets. After banging my head for a while I put the refresh rate back to 750ms and since then have not had a problem.
I guess that sometimes it managed to place the bet, clear the status and bet again in the same second.
I don't know if you are using the clear status or not, hope this helps.

Shamrock.
kevinstaight
Posts: 7
Joined: Mon Jun 20, 2011 7:48 pm

Hi,

I have the same problem. My sheet fires perfectly for a proportion of markets throughout the day and then out of nowhere it fires 2 or 3 bets on a back and then the same on the lay. My sheet is setup up to fire one back bet, then a lay bet 12 seconds later and nothing afterwards. this is my log for a market today:

06/07/2011 17:31:36: £ 2 Back bet placed on Under 2.5 Goals at 2.16. Fully matched at 2.18. Ref:
06/07/2011 17:31:37: £ 2 Back bet placed on Under 2.5 Goals at 2.16. Fully matched at 2.16. Ref:
06/07/2011 17:31:38: £ 2 Back bet placed on Under 2.5 Goals at 2.16. Fully matched at 2.16. Ref:
06/07/2011 17:31:58: £ 2.04 Lay bet placed on Under 2.5 Goals at 2.12. Entirely unmatched when it initially reached the market. Ref:
06/07/2011 17:31:59: £ 2.04 Lay bet placed on Under 2.5 Goals at 2.12. Entirely unmatched when it initially reached the market. Ref:
06/07/2011 17:32:00: £ 2.04 Lay bet placed on Under 2.5 Goals at 2.12. Entirely unmatched when it initially reached the market. Ref:
06/07/2011 17:32:01: £ 2.04 Lay bet placed on Under 2.5 Goals at 2.12. Entirely unmatched when it initially reached the market. Ref:

Is it guardian / bet angel not working correctly or is it excel formula or vba programming that can fix this.

I have also made sure that once each bet is placed that a cell for each is changed to 1 to make sure the formula is not run again.

I have tried everything I can think of and have a reasonable level of programming experience with excel and vba. I cant get my head round this.

Kev
User avatar
TheTub
Posts: 267
Joined: Thu Mar 26, 2009 7:53 pm

Are you using code to clear the status cells?
kevinstaight
Posts: 7
Joined: Mon Jun 20, 2011 7:48 pm

thanks for your quick reply.

I am using VBA range("CELL LOCATION").Clearcontents

Is there a different way I should be doing this?

Many thanks in advance.
James1st
Posts: 318
Joined: Thu Apr 16, 2009 10:28 am

I can confirm that this does indeed happen if you place a bet and use VB code to clear the placed status marker but it only happens when there is a timing delay on placing bets eg in-running. Depending on your refresh rate several bets may be entered.

Usually coders include some aspect of testing either P/L (Col:D) or Liability (Col:C) in order to decide whether to fire single or multiple bets. The problem here is that, with a delay, these fields have not been updated by the time the Excel back/lay code is executed a second time and in the meantime the independant VB code has cleared the "PLACED" marker thus allowing a second..third etc bet through the system (status is clear and P/L (Liab) is still zero).

In BA, the "PLACED" status is set when the bet is submitted, not after it has matched.

Is this what people are seeing?
kevinstaight
Posts: 7
Joined: Mon Jun 20, 2011 7:48 pm

Thank you

A great explanation. I will test the matched or unmatched fields instead of PLACED to see if this helps.

Thanks again

I may be back :)
maik79
Posts: 22
Joined: Fri Jul 23, 2010 9:19 am

Hello

i came across this as well. I am placing two different bets on horses. It must indeed be the case that placed is deleted by the makro and right after a bet is placed.
Have you found a resolution for the problem?

I would like to know what BA actually is doing. It writes PLACED in Excel then fires the bet, does it write anything in the right columns as well, e.G. maybe unmatched bets. I have linked the algorithm to the P/L column of course. It still fires twice pretty often.
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Is the code in a module or a worksheet calculate event?
Zenyatta
Posts: 1143
Joined: Thu Mar 11, 2010 4:17 pm

Another problem that can cause bets to fire twice sometimes (unless you correct for it) is that Betfair often starts swapping the order of the cells for no apparent reason.
Bet Angel
Bet Angel
Bet Angel
Posts: 4031
Joined: Tue Apr 14, 2009 3:47 pm

If anybody can reliably replicate the issue and tell us why it occurs we can look into it. It looks like a timing issue at first hand.
maik79
Posts: 22
Joined: Fri Jul 23, 2010 9:19 am

Yes it's a timing issue. I wanted to place two bets on horse races from different systems. the first 8 minute before a race and the second 4 minutes before a race. i have a multiple market spreadsheet and the makro is deleting placed in all sheets every minute. it's supposed to be every minute but somehow is not.
So inevitably the 8 or 4 minute bet trigger and the deleting Placed makro will meet somewhen. Since it's a system i cant afford to sometimes having a bet placed twice. i think for making markets it's not a real problem, but for several different bets there is no solution i think. i will now change it to only one bet.

Thanks for your replies.

To Betangel: If you want to place two bets on the same selection you need to clear PLACED with a makro as i understand it. My spreadsheet does recognize bets which are met on betfair, so if a lay is send AND matched or listed as unmatched, the sheet won't fire another bet. but right after the bet is send, it's nowhere on the spreadsheet except the PLACED in O, so when the makro kicks in and deletes PLACED just in that moment it will fire another bet. I suggest that somwhow in the future you add another column XX where BA could write SEND or PENDING, so that it will write SEND in XX then PLACED in O then in the next actualisation check where the bet is gone (matched unmatched, p&l updated) and after that has taken place remove SEND in XX.

P.S. I have uploaded an example spreadsheet for multi markets with makro. (without algorithm)
https://docs.google.com/leaf?id=0BziuV2 ... y&hl=en_US

you need to click download, cant upload here its too big (2MB)
kevinstaight
Posts: 7
Joined: Mon Jun 20, 2011 7:48 pm

i have no idea why this happens but what ive done to solve this at my end is to change guardian refresh market time to 2 secs and to make sure any vb script has a longer delay than this. works perfectly now.
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”