betfaiR

limitOrder

The limitOrder function helps construct a bet order in the correct format.

usage

limitOrder(size = 2,
           price = NULL,
           persistenceType = "LAPSE")

arguments

param details
size the bet size, NB for a market of type EACH_WAY the total stake is 2 * size
price the limit price, the price you at which you wish to strike your bet
persistenceType what to do with the order at turn in play, three choices. LAPSE - lapse the order when the market goes in play (ie. cancel bet); PERSIST - persist the order at in-play, the bet will be placed automatically into the in-play market at the start of the event; MARKET_ON_CLOSE - put the order into the auction (SP) at turn in-play

returns

A simple list

limitOnCloseOrder

The limitOnCloseOrder function helps construct a bet order in the correct format.

usage

limitOnCloseOrder(size = 2,
                  price = NULL)

arguments

param details
size the bet size, NB, for a market type of EACH_WAY the total stake is 2 * size
price the limit price, the price you wish to place your bet

returns

A simple list

betfaiR:::prepare_order

The prepare_order function helps contruct a bet, it is used inside the placeOrders function so the arguments are exactly the same, the reason why I’m sharing it is in case you wish to see the list it constructs.

usage

prepare_order(marketId,
              selectionId,
              orderType = "LIMIT",
              handicap = "0",
              side = "BACK",
              limitOrder = limitOrder(),
              limitOnCloseOrder = limitOnCloseOrder(),
              marketOnCloseOrder = list())

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
limitOrder list with details of the bet, required if orderType is LIMIT, use limitOrder to help construct correct list
limitOnCloseOrder list with details of the bet, required if orderType is LIMIT_ON_CLOSE, use limitOnCloseOrder to help construct correct list
marketOnCloseOrder single number, the size of your bet to be placed at Betfairs SP.

return

A list with details about the bet.