Code Monkey home page Code Monkey logo

betfair's People

Contributors

durtal avatar

Stargazers

 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

betfair's Issues

price charts

Betfair price charts are available using the marketId and selectionId, is it possible to retrieve these plot them, save them, etc?

example url:

https://sportsiteexweb.betfair.com/betting/LoadRunnerInfoChartAction.do?marketId=123456789&selectionId=123456

NB. the marketId doesn't include the domain prefix for each exchange.

marketPnL

the marketPnL method might need a little work, fails to parse response if the market has close.

helper functions

a collection of small helper functions are required to help users place bets, cancel bets, filter markets, think about how best to organise these, naming conventions, etc.

facilitate logging into all betfair jurisdictions

hi!
can you make changes to let users access other betfair exchanges (.it, .es, .ro), alongside the global one (.com)?
I've looked through the code, but I'm not really an advanced R user to do it myself without errors.
I did add a jur argument to bf_login function, that changes the endpoint string (this is the only difference between jurisdictions), with "com" as default value, then making necessary changes to bf_account and betfair.
this let me login no problem, but can't use the other methods. lol.

methods + `betfair` environment

At the moment the only way to use the methods is to use them via the betfair function, allow use outside of environment.

Should the environment keep track of queries/requests made?

Cancel_instructions: sizereduction

Hi,

I have been trying to use the size parameter in the cancel_inst function when using the cancelOrders method but can't get it to cancel part of the bet. Instead it cancels the entire bet.
Please see example below:

cancel <- bf$cancelOrders(
cancel_inst(size = 35,
betId = 158757475816),
marketId = "1.156666122"
)

summary(cancel)
Status: SUCCESS
Orders:
status betId sizeCancelled cancelledDate
SUCCESS 158757475816 65 2019-03-27T15:57:39.000Z

function arguments - marketFilter

When filtering markets with the marketFilter function, some of the parameters can be tricky to remember. For example, the withOrders parameter needs to be either EXECUTABLE or EXECUTION_COMPLETE, could these be simplified, to TRUE/FALSE values.

Other functions/methods have parameters which call for specific (and hard to remember) values, such as priceProjection, etc.

Error loading packge

Nice work building this package, it looks really interesting and I'm keen to take a look.
I'm having trouble installing the package. after running

devtools::install_github("durtal/betfaiR")

`* installing source package 'betfaiR' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error in namespaceExport(ns, exports) : undefined exports: collect_data
Error: loading failed
Execution halted
*** arch - x64
Error in namespaceExport(ns, exports) : undefined exports: collect_data
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'

  • removing 'C:/Users/xx/Documents/R/win-library/3.2/betfaiR'
    Error: Command failed (1)`

Any thoughts?

S3 methods

explore as.data.frame methods for the lists returned by the methods found in betfair

write tests

Not sure how to test a package like this which requires authentication, but can probably use testthat to test that requests are correctly formatted.

Other packages to look at for testing

package link test dir
gistr link tests
googlesheets link tests
rgbif link tests
rstudioapi link tests

I will add others when I find them, but these are packages which should serve as good examples of how testing an API package like betfaiR should be carried out. Read Hadley on testing

print method for `marketCatalogue`

The print method for marketCatalogue could be simplified to print just data on the market and event (if available), with the addition of a summary method.

The current print method can be found here which is perhaps more suitable for summary.marketCatalogue_list

parse marketBook data

One of the methods marketBook returns the unparsed response from Betfair's API. This is due to the response being heavily nested and making life difficult to write a function to organise it into useful data structures for R users to work on.

see lines

The betfair_parse method will likely look like the parse method for marketCatalogue (see here), but I need to explore the data that can be returned.

australian markets

Explore possibility of adding Australian markets.

Looks like the endpoint is the only difference?

Domain Endpoint
UK https://api.betfair.com/exchange/betting/json-rpc/v1
Aus https://api-au.betfair.com/exchange/betting/json-rpc/v1

Might be as simple as including a switch statement in the bf_post function?

data returned from markets

This relates specifically to the marketBook function.

Rather than have the user store any queries from the available methods in objects and leave them to explore the data, it might be beneficial to also store queries inside the betfair environment.

Providing them with functions (in the environment):

bf$findSelection()
bf$findMarketId

making it easier for them to explore that data.

OR

return an environment, with various functions to explore the data, return the raw data, etc.

suggestions welcome

clean up code

with the addition of more methods some of the code could use a bit of clean up. Functions like replaceInstructions and limitOnCloseOrder are doing very similar things, rather than having multiple little functions perhaps think about storing them in a similar fashion to the [betfair] environment.

This would reduce the number of functions being exported.

Also look to change names from betfair_parse to shorter bf_parse

Swedish jurisdiction

Hello!

Just started using the package when the gambling law changed in Sweden the 1st of January. Can you please add..

"sweden" = "https://identitysso.betfair.se/api/login"

..to the rest of the countries in the jurisdiction switch in betfair_login.R?

Thank you for a good package!

documentation

Documentation (in R package and docs on web) could use a clean up, so it is more in line with Betfair API docs.

  • Parameter defaults
  • Parameter options
  • Links to other functions

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.