betfaiR

This function allows bets to be placed, and could require some additional work so proceed with great caution. See the vignette for a more complete example.

Having logged in using the betfair function and found the market and selection that you wish to place a bet on using either marketCatalogue or marketBook methods (or a combination of both). A bet can be struck using placeOrders.

usage

bf$placeOrders(marketId,
               selectionId,
               orderType = c("LIMIT", "LIMIT_ON_CLOSE", "MARKET_ON_CLOSE"),
               handicap = "0",
               side = "BACK",
               order = limitOrder())

arguments

param details
marketId unique market id into which the bet will be placed
selectionId the unique id for the selection in the market, this will be a horse, a team, etc, these ids can be found using the marketCatalogue and marketBook methods
orderType the type of order, LIMIT - a normal exchange order for immediate execution, LIMIT_ON_CLOSE - limit oder for the auction (SP bet with a price limit), MARKET_ON_CLOSE - market order for the auction, SP bet regardless of price.
handicap for ASIAN handicap markets (I believe!), default is 0
side BACK or LAY
order list with details of the bet, if orderType is LIMIT, use limitOrder to help construct correct list. If orderType is LIMIT_ON_CLOSE use limitOnCloseOrder to help construct correct list. If orderType is MARKET_ON_CLOSE then a list with a element called liability which is the size of the bet to be placed at Betfair’s SP.

return

A list with details about the bet, the market the bet was made in, the order type, and whether it was successful or failed