Code Monkey home page Code Monkey logo

bettor's People

Contributors

jimtheflash avatar papagorgio23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bettor's Issues

All calls to get_lines() returning 463; add option to specify User-Agent?

All calls I'm making to get_lines() are returning error code 463. For example:

> bettoR::get_lines(start_date = "20210201")
Error in open.connection(x, "rb") : HTTP error 463.

This is the case running locally as well as in RStudio Cloud (happy to provide system info and loaded libraries, but I don't think those are really the issue here).

However, visiting the URL https://classic.sportsbookreview.com/betting-odds/?date=20210201 in my browser works just fine.

Would it be possible to specify the user-agent when grabbing data from SBR? It may be the case that non-browser agents are being blocked.

Create function to calculate CLV for spreads and totals

I see that you have a clv_calc function which calculates closing line value for a moneyline bet. Would it be possible to create a function to calculate clv for spreads and totals?

Example

Let's use the Pacific vs. Loyola Marymount Men's College Basketball game on Jan 16, 2021 as an example. My bet was Pacific -1 (-108). My current process to calculate CLV manually is this (and boy is it slow/painful):

  1. Looks up the spread closing odds for Pinnacle using SportsBookReview. There I see the closing odds as Pacific -1.5 (-118) and Loyola +1.5 (+101).
  2. I make sure the League is NCAAB, the Bet Type is Spread and the Odds Type is US. Then, I enter 1.5 into Spread, -118 into Fave Price and +101 into Dog Price using the SBR Half Point Calculator.
  3. I see that Pacific -1 corresponds to -127.7 so I round it to -128 and enter it into my spreadsheet for the Closing Line Odds.
  4. I calculate (using spreadsheet formulas) the implied probability of both -108 (51.9%) and -128 (55.9%).
  5. Finally, I calculate the CLV with (55.9% - 51.9%) / 51.9% which returns 7.8% CLV.

Possible Solution

This feels like a great opportunity for someone to calculate push probabilities and have this be incorporated into the package. I found this article helpful. If we have the push probabilities already calculated, then we could have a function like:

calculate_spread_clv <- function(my.bet.spread = NA, my.bet.price = NA, closing.spread.num = NA, fave.price = NA, dog.price = NA) {
  etc
}

When this function is called, it would return the CLV. In the example provided above, it'd return 7.8% (assuming my math is correct).

Could you add a rounding argument to each function?

First of all, the bettoR package is great and works like a charm. However, it would be helpful if rounding was added as an argument to the function. Perhaps an argument that specifies the number of decimal places or even turn off rounding all together. There are many instances where it is valuable to not round results. If you could add this functionality to all of the bettoR functions it would be extremely useful.

true_prob <-
  round(implied_prob(odds = line, type = type) / sum(implied_prob(odds = odds, type = type)), 4)

fair_odds <- implied_odds(true_prob, type = type)

return(fair_odds)

}

Bankroll Plot

The bankroll plot doesn't calculate the losses correctly if the betsize is anything besides 100.

get_lines() SportsBookReview website outdated.

Hi, I have attempted your get_lines() function for the NBA, e.g.

get_lines(
+     sport = "NBA",
+     bet_type = "total",
+     period = "2Q",
+     start_date = "20191221"
+ )

and receive the error
Error in teams[[1]] : subscript out of bounds

After inspection it appears the oddsURL is outdated.
oddsURL <- glue::glue( "https://classic.sportsbookreview.com/betting-odds/{SPORT}/{TYPE}/{PERIOD}/?date={DATE}" )I have attempted to manually fix this, but am unsuccessful.

Add other methods to calculate implied probability

Curious to know if you have considered adding functionality to not only calculate multiplicative (current default value) but also Additive, Shins, Power, etc.. There are other methods to calculate implied probability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.