Using Excel

 

Betting Assistant includes an interface to Excel to enable you to analyse prices and place bets using triggers from an Excel spreadsheet. We will only explain how to set up the link and which triggers are available and what they do, but we cannot teach you how to use Excel you will need to learn how to use Excel first before attempting to use this feature.

 

Excel_Options_Screenshot

 

First open an Excel spreadsheet then select Log Current Prices from the Excel menu.

Select the required workbook and worksheet name using the drop down lists and the top left hand cell to log the prices to.

Tick enable triggered betting if you wish to place bets from Excel.

Tick show balance if you want your account balance displayed in Excel.

Set your triggered betting options, you can choose that the CLEAR trigger clears matched odds (the CLEAR trigger is explained below). You can also choose that your bet refs are cleared when markets are auto selected.

Click OK to start logging.

 

View your Excel sheet and you should see the prices updating automatically according to your refresh rate.

 

 

Triggered Betting

 

The following triggers will activate when you insert the trigger in the trigger column (all triggers are uppercase).

 

BACK                  Place a back bet at the odds and stake inserted into the odds and stake columns to right of the trigger column.

LAY                     As above, placing a lay bet.

Note: As soon as the bet is placed the bet reference is logged in the bet ref column and no further bets will be placed unless you use the CLEAR trigger or clear the bet ref cell using a VBA macro for example.

UPDATE             Update odds of unmatched bet. If the odds column is different to the current odds of the unmatched bet then the bet will be updated and the bet reference will be replaced.

CANCEL            Cancel unmatched bet (the bet reference from the bet ref column is used)

CANCEL-ALL   Cancel all unmatched bets for this selection.

LAYFIELD         Insert this trigger against just one of the selections and a lay bet will be placed against every selection.

CLEAR               Clears the bet reference so that another bet placement trigger may be used.

 

Excel_Triggered_Betting_Screenshot

 

 

Partially matched bets

 

If a bet is partially matched and the unmatched portion has not been cancelled then the bet ref will have P as the suffix (eg. 3230882684P). If the unmatched portion is cancelled (either manually or using CANCEL trigger) then the P will be removed.

 

 

Trigger modifiers

 

The BACK and LAY triggers can be extended to place fill or kill, tick offset bets and set the bet persistence options for in play markets.

 

Examples
BACK-T1            lay at one tick offset lower when bet is matched
LAY-T1               back at one tick offset higher when bet is matched
LAY-TL1            back at one tick offset higher when bet is matched.

                             The back bet will attempt to auto green up: back stake = (lay odds / back odds) x lay stake
BACK-T2-F5      lay at two tick offsets lower when bet is matched or cancel the bet if not matched before 5 seconds
BACK-F5            cancel bet if not matched before 5 seconds
LAY-F10             cancel if not matched before 10 seconds

BACK-IP             If the bet is not matched when the market goes in play then the bet will not be cancelled.

LAY-SP               If the bet is not matched when the market goes in play then the bet will be converted to a Starting Price bet, the liability must be at least £10 otherwise the bet will be cancelled when the market goes in play.

BACK-T1-IP       lay at one tick offset lower when bet is matched and if the bet is not matched when the market goes in play then the bet will not be cancelled (including the original back bet and the offset lay bet)

BACK-T1-IPC    lay at one tick offset lower when bet is matched and if the lay bet is not matched when the market goes in play the bet will not be cancelled. The back bet will be cancelled if not matched when the market turns in play.


Please note that BACK-F1-T1 will not work, you must put the tick offset option first, ie. BACK-T1-F1
When a bet is cancelled by fill or kill the bet reference in Excel will read CANCELLED. This will also happen if you cancel the bet manually.

 

As soon as a trigger is detected the bet ref cell will contain PENDING. This is to avoid multiple bets being placed while waiting for the bet reference to be returned by Betfair.

 

 

Error messages

 

If there is a problem placing the bet then the bet ref column will contain one of the error messages below instead of a bet reference.

 

API_ERROR, INTERNAL_ERROR, UNKNOWN_ERROR: General API error, unlikely but possible. It would probably mean there was a problem with the API and not Betting Assistant. It could also mean the request was not formed properly which would be a problem with BA that needs looking at.

INVALID_PERSISTENCE: You have used the -SP or -IP trigger modifier, but the market will not be turning in play.

BETWEEN_1_AND_60_BETS_REQUIRED: Number of BetPlacement less than 1 or greater than 60. Typically you will see this if you populate the trigger column but leave the odds column blank or the odds column contains text instead of a numeric value.

DIFFERING_MARKETS: All bets not all for the same market. Should not be possible with BA, but one user has reported this message. I am awaiting further details from them.

EVENT_CLOSED: The market has closed. If you weren't expecting this the event may have been abandoned. If the event wasn't abandoned then your trigger fired after Betfair had closed and settled the event.

EVENT_INACTIVE: Market is not active

EVENT_SUSPENDED: Market is suspended. If you are monitoring for the market going in play and aiming to place the bet as soon as this is detected it is possible you will get this error as there is an outstanding issue with the API where the market can be reported as in play and not suspended, but is suspended again on a subsequent refresh. You should place your bet again.

VACANT_TRAP: The selected trap is vacant

BBM_DAEMON_NOT_AVAILABLE: The exchange encountered a critical error and was not able to match your bet. Your bet was not placed.

ACCOUNT_CLOSED: Account is closed - please contact the Betfair Helpdesk

ACCOUNT_EXCLUDED: The account has been locked due to self-exclusion

ACCOUNT_LOCKED: Account is locked - please contact the Betfair Helpdesk

ACCOUNT_SUSPENDED: Account has been suspended. One reason you might receive this message is that you have attempted to place a bet on the Australian exchange server but your Australian wallet is suspended because Betfair have not yet received confirmation of your name and address.

AUTHORISATION_PENDING: Account is pending authorisation. If the PlaceBetsResultEnum is also CANNOT_ACCEPT_BET, this means that the market is operating under the Tasmanian Gaming Commission rules and the account holder’s identity has not yet been verified.

SITE_UPGRADE: Site is currently being upgraded

EXPOSURE_CALCULATION_IN_PROGRESS: The bet was not placed because the system is calculating your exposure. This error is most likely to occur when the account is close to the exposure limit and you are placing multiple bets in a short space of time.

EXPOSURE_OR_AVAILABLE_BALANCE_EXCEEDED: Account Exceeded Exposure Limit or Available to Bet Balance

INSUFFICIENT_BALANCE: Insufficient available money in the account

SELECTION_REMOVED: The runner has been removed from the event

LOSS_LIMIT_EXCEEDED: The potential loss for the bet exceeds the loss limit for the account (as set in your profile on the website)

 

 

Logging current bets

 

If you provide a worksheet named MyBets then all current bets for the market will be logged to this worksheet. If you are logging multiple markets to multiple worksheets in the same workbook then you must prefix MyBets with the worksheet name and an underscore eg. Sheet1_MyBets

 

MyBets worksheet example

 

 

Logging bet results

 

Tick ‘Log Bet Results’ and select a worksheet (the worksheet must be different to the worksheet you have selected to log the prices to)

When a bet is matched or partially matched then the program will record the bet reference and when the next market is auto selected from the quick pick list the bet results will be logged to the specified worksheet. The results are logged in descending order of the bet reference so that the most recent result will always be on row 2. The results are obtained from your account statement so it is important you organise the quick pick list to allow time for settlement (eg. log horse race meetings to separate worksheets and don't select the next race too early as the results are only updated when the next race is selected). If the bet has not been settled when the results are queried then the result is logged as RESULT_NOT_AVAILABLE.

Note: The amount column represents the amount won or lost, not the stake.

 

Bet results worksheet example

 

 

Updating the balance

 

Assuming the origin cell is A1 then put U in cell J2 to update the balance and exposure.

 

 

Setting the refresh rate

 

Assuming the origin cell is A1 then put your required refresh rate (in seconds) in cell Q2.

 

 

Selecting next/previous market from quick pick list

 

Assuming the origin cell is A1 then put -1 in cell Q2 to select the next market in the quick pick list or -2 to select the previous market.

 

 

Refreshing quick pick list

 

Assuming the origin cell is A1 then put -3 in cell Q2 to refresh the quick pick list according to the option set in preferences. Use -4 to load the different venues into separate tab pages. -4 can only be used on a spreadsheet linked to the first tab page.

This option can be used run BA continuously without user intervention (eg. Refresh the quick pick list each morning to load the current day’s racing)