GetParlayLine: Get Parlay Lines for a Given Leg List

Description Usage Arguments Details Value Examples

View source: R/GetParlayLine.R

Description

Queries the available lines for a series of parlay legs and calculates the relevant odds.

Usage

1
GetParlayLine(legs, oddsformat = "AMERICAN")

Arguments

legs

A list of parlay legs. See Details.

oddsformat

Format for the returned odds. One of "AMERICAN", "DECIMAL", "HONGKONG", "INDONESIAN", or "MALAY".

Details

Each parlay leg must be a named list containing the eventId, periodNumber, and legBetType (which is one of "SPREAD", "MONEYLINE", or "TOTAL_POINTS").

The parlay legs must also contain the fields team, side, and handicap, depending on the particular bet type. These fields accept the same formats as other functions in this package. See the examples below.

This function will raise an error if the API does not return HTTP status OK. For information on the possible errors, see the API documentation for Get Parlay Line.

Value

A list of lines, which will be empty if there are none. The list contains information on the validity of the parlay (in status), the minimum and maximum risk, and the error (if present). It will also contain a list of possible round robin options and their associated odds, and a list of validated legs. Importantly, these legs contain the lineId entries that are needed to actually place the parlay bet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SetCredentials("TESTAPI", "APITEST")
AcceptTermsAndConditions(accepted = TRUE)

# Define three parlay legs.

leg1 <- list(eventId = 620550552, periodNumber = 0,
             legBetType = "MONEYLINE", team = "DRAW")

leg2 <- list(eventId = 620671010, periodNumber = 0,
             legBetType = "TOTAL_POINTS", side = "OVER",
             handicap = 2.5)

leg3 <- list(eventId = 620671010, periodNumber = 0,
             legBetType = "SPREAD", team = "TEAM1",
             handicap = -0.5)

## Not run: 

# Since leg 2 and 3 are from the same game, they will be rejected
# for betting as correlated:
GetParlayLine(list(leg2, leg3))

# But leg 1 and 2 should be fine:
lines <- GetParlayLine(list(leg1, leg2))

# You must use the lineIds before placing bets.
leg1$lineId <- lines$legs$lineId[1]
leg2$lineId <- lines$legs$lineId[2]

bet <- PlaceParlayBet(riskAmount = 50,
                      legslist = list(leg1, leg2),
                      roundRobinOptions = "Parlay",
                      oddsFormat = "AMERICAN" ,
                      acceptBetterLine = TRUE)

## End(Not run)

marcoblume/pinnacle.API documentation built on Sept. 11, 2019, 4:05 a.m.