Can you combine individual commands?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
imajik
Posts: 14
Joined: Thu Mar 24, 2011 2:45 am

Hi,

I am working on a bot that bets in play. When my horse is in the green I want to fire a "CANCEL_ALL" followed by a "GREEN" as individual commands (ie only for the one horse).

My VBA code looks like this:

ActiveSheet.Range("L" & betrow).Value = "CANCEL_ALL"
ActiveSheet.Range("L" & betrow).Value = "GREEN"

Should this work? or will "CANCEL_ALL" be replaced with "GREEN" before Betfair has a chance to process it? Is the any way of combining individual commands for example "CANCEL_ALL_GREEN"? Is there a better way of doing this?

Thanks for any help!
User avatar
Shamrock
Posts: 205
Joined: Thu Sep 30, 2010 11:41 am

The smart people at BA have already thought of this. When you Green up, BA will cancel all outstanding bets. So just put the "GREEN" in and "CANCEL ALL" will take care of itself.
imajik
Posts: 14
Joined: Thu Mar 24, 2011 2:45 am

Thanks for your reply, I now have GREEN working as I would like. However as I do not want to use GREEN if my position goes against me I need to use CLOSE_TRADE to exit my position which does not do a CANCEL_ALL. What is the best way of performing a CANCEL_ALL followed by a CLOSE_TRADE when running in play?

I have tried:

ActiveSheet.Range("L" & betrow).Value = "CANCEL_ALL"
ActiveSheet.Range("L" & betrow).Value = "CLOSE_TRADE"

which correctly closes the trade but the cancel all is not executed.

I have tried using:

Application.Wait Time + TimeSerial(0, 0, 2)

to pause for 2 seconds after doing the cancel all but this doesn't seem to help.

Any help is very much appriciated!
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”