getMarketPrices: getMarketPrices

Description Usage Arguments Author(s) Examples

Description

Betfair getMarketPrices

Usage

1
getMarketPrices(marketId, currencyCode = list(), service = Exchange)

Arguments

marketId

marketId

currencyCode

currencyCode

service

service

Author(s)

colin@betwise.co.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(marketId, currencyCode=list(), service=Exchange)
{
  v <- .bfapi(match.call(), service=service)
  z <- .xmlp("errorCode", v)
  if(is.null(z)) return(v)
  if(z != "OK") return(z)
  x <- .xmlp("marketPrices",v)
  tags <- c("bspMarket","currencyCode","delay","discountAllowed","lastRefresh","marketBaseRate","marketId","marketInfo","marketStatus","numberOfWinners","removedRunners","runnerPrices")
  market <- lapply(as.list(tags), .xmlp, x)
  tags <-  sub(".*:","",tags)
  names(market) <- tags
  mrp <- .xml2list(market$runnerPrices)
  names(mrp) <- c()
  mrp <- lapply(mrp, .xml2list)
  mrp <- lapply(mrp, function(x) {x$bestPricesToBack=.xmlarray2dataframe(x$bestPricesToBack);x$bestPricesToLay=.xmlarray2dataframe(x$bestPricesToLay);x})
  market$runnerPrices <- mrp
  market
  }

bwlewis/betfair documentation built on May 13, 2019, 9:05 a.m.