Bat Angel placing multiple bets via excel

Example spreadsheets and comments on example spreadsheets.
Post Reply
dmg
Posts: 10
Joined: Mon Dec 04, 2017 7:46 am

Hi All

I have an excel sheet for placing bets, once the criteria has been met excel place the bet, on some occassions it puts 2 or 3 bets into the market even though I monitor for the unmatched bets cell to = 0. This is random, sometimes it puts the 1 bet in sometimes 2 or 3. I have streaming on and am set for 20ms refresh, wonder if bat angel is going too fast for esxcel to keep up.
below is the log files for such an event happening.

21/01/2018 21:07:14: [Excel] : £ 10.00 Back bet placed on 1. Spot On Blizzard at 5.9. Entirely unmatched when it initially reached the market. Ref: 114289106127 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:15: [Excel] : £ 10.00 Back bet placed on 1. Spot On Blizzard at 5.9. Entirely unmatched when it initially reached the market. Ref: 114289106479 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:15: [Excel] : £ 10.00 Back bet placed on 1. Spot On Blizzard at 5.9. Entirely unmatched when it initially reached the market. Ref: 114289106259 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:17: [Excel] : £ 2.63 Lay bet placed on 6. Millabbey Lara at 3.8. Entirely unmatched when it initially reached the market. Ref: 114289109097 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:17: [Excel] : £ 2.63 Lay bet placed on 6. Millabbey Lara at 3.8. Entirely unmatched when it initially reached the market. Ref: 114289109309 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:23: [Excel] : £ 10 of unmatched bet (Ref:114289106127) was filled before remainder was killed.
21/01/2018 21:07:23: [Excel] : £ 2.63 of unmatched bet (Ref:114289109309) was filled before remainder was killed.
21/01/2018 21:07:23: [Excel] : £ 10.00 Lay bet placed on 1. Spot On Blizzard at 5.8. Entirely unmatched when it initially reached the market. Ref: 114289119111
21/01/2018 21:07:23: [Excel] : £ 2.63 of unmatched bet (Ref:114289109097) was filled before remainder was killed.
21/01/2018 21:07:23: [Excel] : £ 2.63 Back bet placed on 6. Millabbey Lara at 3.85. Entirely unmatched when it initially reached the market. Ref: 114289119246
21/01/2018 21:07:23: [Excel] : £ 2.63 Back bet placed on 6. Millabbey Lara at 3.85. Entirely unmatched when it initially reached the market. Ref: 114289119460
21/01/2018 21:07:25: [Excel] : £ 0.67 of unmatched bet (Ref:114289106259) was filled before remainder was killed.
21/01/2018 21:07:25: [Excel] : £ 10 unmatched bet (Ref:114289106479) was killed.
21/01/2018 21:07:26: [Excel] : £ 0.67 Lay bet placed on 1. Spot On Blizzard at 5.8. Entirely unmatched when it initially reached the market. Ref: 114289122358
21/01/2018 21:07:31: [Excel] : £ 10.00 Back bet placed on 3. Ide Iced at 6. Entirely unmatched when it initially reached the market. Ref: 114289131135 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:31: [Excel] : £ 10.00 Back bet placed on 3. Ide Iced at 6. Entirely unmatched when it initially reached the market. Ref: 114289131274 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:36: [Excel] : £ 10.00 Back bet placed on 2. Bolus Kid at 20. Entirely unmatched when it initially reached the market. Ref: 114289137618 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )
21/01/2018 21:07:36: [Excel] : £ 10.00 Back bet placed on 2. Bolus Kid at 20. Entirely unmatched when it initially reached the market. Ref: 114289137872 ( Fill or kill bet with 10 seconds delay. Offsetting by 1 ticks. )

One thing I have noticed is the time is exactly the same,so they are all hitting the market at the same time.

Any help would be appreciated, although it usually ends up OK, when the market moves agaisnt me the impact is worse due to the exposure.
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Are you using vba or a formula to put the value in, and if you're using code is it in the "worksheet" change" event?
dmg
Posts: 10
Joined: Mon Dec 04, 2017 7:46 am

Hi

It is a mixture of VBA and formulas, but everything that determines if a bet should be place and the actual field that puts the bets in is a formula. The VBA is in a worksheet change event.

Below is the formula that is in L9 etc.

=IF(AND(V10<1,Y10<1,AB10=AE10,$G$1="",$AG$1>$AK$3,$AG$1<$AK$2,AO9="Up",AN9>=$AN$8,BC9>=$BC$7,BC9<=$BC$6,BF9>$BE$7),"BACK OFFSET:"&$AA$6&" FILL_KILL:TRUE KILL_DELAY:"&$AA$5,IF(AND(V10<1,Y10<1,AB10=AE10,$G$1="",$AG$1>$AK$3,$AG$1<$AK$2,AO9="Down",AN9>=$AN$8,BC9>=$BC$7,BC9<=$BC$6,BE9>$BE$7),"LAY OFFSET:"&$AA$6&" FILL_KILL:TRUE KILL_DELAY:"&$AA$5,""))

As can be seen it is checking a few cells to determine if the bet should be placed, and 2 of those cells are V and Y to ensure there is no unmatched bets in the market.

I have also determined it happens in practice mode as well as in live mode.

Very strange.
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Anything in the "calculate" event?
dmg
Posts: 10
Joined: Mon Dec 04, 2017 7:46 am

No Nothing.
I just cant seem to get to the bottom of this. May try reducing the refresh rate to see if that has any bearing.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

dmg wrote:
Mon Jan 22, 2018 7:43 am


One thing I have noticed is the time is exactly the same,so they are all hitting the market at the same time.
Are these bets duplicates on the same runner or just additional bets on other runners where your criteria has been met? Are they also in running as I guess the delay may mean BA doesn't have any returned bet id for unmatched bets. I don't use BA for my own bots so unsure how it reports received data from the API or what you're actually monitoring to stop it placing duplicates.

If you are using VBA within your bits it may be worth coding your betting routine to place via VBA also as it gives you much better control cos you can set flags on when to stop and restart betting so much more reliable than formulas.
Pogba
Posts: 7
Joined: Thu Feb 25, 2016 4:59 pm

This also started happening to me too recently. Random double bets going in, I've never experienced this before after using my spreadsheet without issue or code changes for nearly 2 years. This now seems to be happening at least once per trade when I tested it in practice mode (placing around 20 bets into the correct score market over the period of 90+ mins) and I cannot reproduce it by choice it just happens randomly.

I added in Application.Wait(Now + TimeValue("00:00:02")) after the bets are placed. As I trade football markets in-play and there is a delay anyway getting bets into the market an extra couple of seconds later is acceptable for me and the strategies I use.

This seems to have fixed things so far but am contining to test extensively in practice mode as much as possible before using it again in live markets. Very frustrating to say the least and maybe due to back end changes to the BA software?

If it's acceptable for you to have a delay in placing your bets you could try using Application.Wait and see if that helps?
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

I think it's down to the high re-fresh rate. Excel looks at/calculates the data from left to right, A1,B1,C1 etc etc.

What could be happening is that it's populating the L9 cell and before it get to look at/populate the status column/ matched/unmatched bets columns, another instruction comes in again to re-issue the back command in cell L9, so it's filled twice before the other cells are filled. It makes no odds if the word "Back" is already in there, if you tell it to put the word in again it will , although obviously it will not contain the word "Back" twice.

Pogba says that if he slows it down it's ok so you could add a delay or slow down the re-fresh rate,and spreadbetting mentions vba. If you could enter your formula with vba, you could check first to see if the cell is empty before issuing the command/entering your formula. eg.

Code: Select all

If isempty (Range("L9")) then 
Range)"L9".formula="=********"
Range("L9")=Range("L9").value
this would hardcode the formula to its value and the next time round it won't be empty so it wont be filled agin.
dmg
Posts: 10
Joined: Mon Dec 04, 2017 7:46 am

Many thanks for your ideas on this, I have reduced the refresh rate to 500ms and it is still happening, almost every bet. I will reduce further or disable streaming to see if that makes any difference.
dmg
Posts: 10
Joined: Mon Dec 04, 2017 7:46 am

So I didnt check my refresh before posting the last comment, it had gone back to my default when I started BA again. I have now reduced it to 500ms and it is now placing single bets as it is supposed to. So it does look to be refresh rate related.

Hope this helps others who may be seeing the issue.
Post Reply

Return to “Bet Angel - Example spreadsheets”