phillc73 / abettor

An R package for connecting to the online betting exchange Betfair, via their API-NG product, using JSON-RPC.
Other
51 stars 36 forks source link

Betfair balance #8

Closed Tammboy closed 8 years ago

Tammboy commented 8 years ago

Hi Phill,

It would nice to be able to access your betfair balance so that I could instruct the automated program to bet a proportion of bank rather than flat stakes.

It would also be great if it were possible to access profit and loss (or just simple account bet result data) in order to produce daily/weekly betting reports relevant to selections.

Many thanks,

Jake.

phillc73 commented 8 years ago

A quick look at the Betfair API documentation seems to indicate it is possible to return Account Statement information limited by time/date range.

My initial proposal would be to write an Account Statement function, including "Date From" and "Date To" options. You would be able to return account history data between any date range you desire. Your local application would then calculate the P&L.

Tammboy commented 8 years ago

That would be fantastic - thanks

Sent from my iPhone

On 15 Dec 2015, at 14:50, Phill notifications@github.com wrote:

A quick look at the Betfair API documentation seems to indicate it is possible to return Account Statement information limited by time/date range.

My initial proposal would be to write an Account Statement function, including "Date From" and "Date To" options. You would be able to return account history data between any date range you desire. Your local application would then calculate the P&L.

— Reply to this email directly or view it on GitHub.

jg-repos commented 8 years ago

Hey phill you can use my forked account balance API call to start if you want. I was going to do the update myself, but I'm not very familiar with Github and didn't want to mess anything up.

On Dec 15, 2015, at 11:39, Tammboy notifications@github.com wrote:

That would be fantastic - thanks

Sent from my iPhone

On 15 Dec 2015, at 14:50, Phill notifications@github.com wrote:

A quick look at the Betfair API documentation seems to indicate it is possible to return Account Statement information limited by time/date range.

My initial proposal would be to write an Account Statement function, including "Date From" and "Date To" options. You would be able to return account history data between any date range you desire. Your local application would then calculate the P&L.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

phillc73 commented 8 years ago

Thanks! I will certainly use your function as a starting point. Much appreciated. It'll for sure save me some time.

dashee87 commented 8 years ago

Hi guys,

If you check out my fork, I've created a few account related functions (e.g. account balance, market P&L, etc).

I've also added other bet related calls (cancel/update orders) and edited loginBF to incorporate basic error handling. I too am not very familiar with Github, so I'm not too sure the best way to proceed. But I am very keen to create a comprehensive library of Betfair API requests to use within R.

phillc73 commented 8 years ago

Thanks @dashee87 for the collaboration on this project.

The first thing to do is to create a pull request (PR) from your forked branch back to the master here.

https://help.github.com/articles/github-flow-in-the-browser/ (step 3) https://help.github.com/articles/using-pull-requests/

That should make it much easier for me to review the changes and incorporate into the main repository.

I really appreciate your participation on this.

phillc73 commented 8 years ago

This enhancement is now complete thanks to additions by @dashee87

phillc73 commented 8 years ago

@dashee87 I'd like to include you as a package author in the DESCRIPTION file. Can you send me an email with your name and email address (assuming you'd like to be included of course!)? phill [at] starkingdom.co.uk