If 3 different functions each have a limit of 60 per minute does that mean you can call each of them 60 times inside 60 seconds (a total of 180 calls)?
While I'm at it, in a place market does the ifWin and ifLoss fields of the GetMarketProfitAndLoss response just return the prospective winnings and liability respectively for matched bets on an individual horse (i.e. they don't take into account any bets on other horses)?
On the first question, yes, the throttles apply to each function individually, so you can call the 3 functions 60 times each within the same minute.
On the second ... I've never used getMarketProfitAndLoss, but looking at the manual it says that for a Multi-Winner Line Market (e.g Horse Place Markets):
ifWin: If this selection is the winner, this is the profit and loss for the market (based on matched bets only)
ifLoss: If this selection is the loser, this is the profit and loss for the market (based on matched bets only)
you'd need to use getProfitAndLoss in getBet to get the P/L for an individual runner i think.
On the first question, yes, the throttles apply to each function individually, so you can call the 3 functions 60 times each within the same minute.On the second ... I've never used getMarketProfitAndLoss, but looking at the manual it says that for a
Cheers gus. On the place market question I found this earlier but I always thought the place P/L was a bit more sophisticated than just displaying the P/L for each individual selection.
Cheers gus. On the place market question I found this earlier but I always thought the place P/L was a bit more sophisticated than just displaying the P/L for each individual selection.http://help.betfair.com/contents/itemId/i65767349/index.en.html
Place markets and markets where there can be more than one winner: The left-hand figure is your profit/loss on that selection if it is placed. The right-hand figure is your profit/loss if it is not placed. Calculations are made from your matched bets on each selection independently.
Place markets and markets where there can be more than one winner: The left-hand figure is your profit/loss on that selection if it is placed. The right-hand figure is your profit/loss if it is not placed. Calculations are made from your matched bets
As long as you're a bit creative by alternating calls and not covering lots of markets at once the free API should easily cover most peoples needs. Or are you going to start hammering the markets with some uber trading bot , Feck ?
Worth remembering those 60 p/m calls can be called anytime within that minute rather than 1 per second, I'd imagine it resets on the minute bit like the transaction charge limits reset on the hour.
GetMarketProfitAndLoss can't accurately cover the place markets because there could be many different outcome with 3 or more places up for grabs each with their own different pnl's, it just gives you a win or loss figure for each horse separately
As long as you're a bit creative by alternating calls and not covering lots of markets at once the free API should easily cover most peoples needs. Or are you going to start hammering the markets with some uber trading bot , Feck ?Worth remembering t
Anybody know if there's a way to get ALL your matched and unmatched bets for a particular market in one call. I've seen it asked on the bdp forum but it was not answered definitively.
Would a call to the getMUBets function (https://docs.developer.betfair.com/betfair/#!page=00008360-MC.00008315-MC) with the matchedSince parameter set 1900-01-01 work?
Anybody know if there's a way to get ALL your matched and unmatched bets for a particular market in one call. I've seen it asked on the bdp forum but it was not answered definitively.Would a call to the getMUBets function (https://docs.developer.betf
You just have to make a call to getMUBets, with the betStatus set to MU, and specifying the relevant marketId.
This will return up to a maximum of 200 matched and unmatched bets for that market. Of course if you have more than 200, you have to use more than 1 call.
Feck,You just have to make a call to getMUBets, with the betStatus set to MU, and specifying the relevant marketId. This will return up to a maximum of 200 matched and unmatched bets for that market. Of course if you have more than 200, you have to u
you're better to use no parameters other than the marketId Feck, that way it'll return all of your Matched and UnMatched Bets for that market (up to a maximum of 200 bets) ... if you think you may have more than 200 Bets (which perhaps you might if one of your megaWagers has been matched in dribs and drabs) then you'd have to be a bit more sophisticated, iterating getMUBets with the startRecord parameter = 0 , then 200 and so on, until you'd got them all, in which case you might need to be careful about Data Call charges.
you're better to use no parameters other than the marketId Feck, that way it'll return all of your Matched and UnMatched Bets for that market (up to a maximum of 200 bets) ... if you think you may have more than 200 Bets (which perhaps you might if o
JLivermore , never anyone on the bdp forum to answer :(
Like others have said feck, getMUBets with the marketID should be enough but you also have the lite calls and Get Current Bets etc.
With some of my stuff I keep a track of the betIDs of bets and then send a getMUBets with an array of betids rather than marketID as some of my stuff overlaps. None of my stuff exceeds the 200 bets but if it did it'd be easy to split any arrays into separate chunks
JLivermore , never anyone on the bdp forum to answer :(Like others have said feck, getMUBets with the marketID should be enough but you also have the lite calls and Get Current Bets etc. With some of my stuff I keep a track of the betIDs of bets and
Contrarian, gus, thanks but I was aware of the 200 record limit and that was what was putting me off as a) each call contributes towards the 60 p/m limit and b) something could be matched between calls or maybe even RF's applied. If you read that link I put up to the getMUBets documentation it states (for the matchedSince paramater) "Specifies a date and time to start from for the list of returned bets..... If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returned. Specifying a betStatus of MU causes the API to return your unmatched bets along with the matched ones." To me this suggests if you set that parameter (to 1/1/1900) it will return them all at once even if there is more than 200. If that's the case though I'm surprised that it did not form the basis of a reply to a couple of similar questions on the bdp forum.
Also, if you look at the getCurrentBets documentation there's no mention of a limit on the recordCount parameter. That suggests if you set the marketId=0 it will return every matched and unmatched you have on the exchange across all markets. It would seem strange that they're actually steering you towards retrieving more info than you actually require.
JLivermore, thanks for the link. I was aware of it but two similar questions were unanswered on it.
catfloppo, hopefully around June when I'd normally start back on the flat. It's taken me longer than I thought though as I had to make a lot of changes to my programme to support it and, as is always the case with coding, one change seems to require two changes elsewhere which in turn .....
Joe, I glanced at the lite call but it looked as though it didn't tell you if the bet was a back or a lay. Is that the case? I thought about keeping track of my own betIDs but this just seemed as though it would support a cleaner bit of coding.
Contrarian, gus, thanks but I was aware of the 200 record limit and that was what was putting me off as a) each call contributes towards the 60 p/m limit and b) something could be matched between calls or maybe even RF's applied. If you read that lin
I should've bolded If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returned
Also, not that the getCurrentBets I mention in the 2nd para referes to a different function in case you're a speed reader.
I should've bolded If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returnedAlso, not that the getCurrentBets I mention
You're right that the documentation leaves that open as a possibility (that you could get more than 200 bets returned), but I think it EXTREMELY unlikely. They impose those limits for a reason - partly to prevent us from hogging the servers if we happen to be operating with large numbers of MUbets - and I'm sure that it wouldn't be possible to circumvent them in the way that you're suggesting.
Feck,You're right that the documentation leaves that open as a possibility (that you could get more than 200 bets returned), but I think it EXTREMELY unlikely. They impose those limits for a reason - partly to prevent us from hogging the servers if w
Thanks for your trouble Contrarian. What about the getCurrentBets with marketId=0. No mention of a limit on recordCount although if there isn't then it's an invitation to hog the servers even more.
Thanks for your trouble Contrarian. What about the getCurrentBets with marketId=0. No mention of a limit on recordCount although if there isn't then it's an invitation to hog the servers even more.
If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returned
Sh1t documentation is right. How do they manage an error like that?
If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returnedSh1t documentation is right. How do they manage an error like
Having read the bdp forum and noted the comments regarding getMarketPricesCompressed returning incorrect market status values finding out the documentation is unreliable is no shock but it does not inspire confidence.
Having read the bdp forum and noted the comments regarding getMarketPricesCompressed returning incorrect market status values finding out the documentation is unreliable is no shock but it does not inspire confidence.
I just tested the getCurrentBets with marketId = 0, and 380 unmatched bets, and it does work! The downside, though, is that you have to specify either M or U, you can't do MU. So you're still going to have to do 2 calls to the exchange. It does make the programming much simpler though.
Feck,I just tested the getCurrentBets with marketId = 0, and 380 unmatched bets, and it does work! The downside, though, is that you have to specify either M or U, you can't do MU. So you're still going to have to do 2 calls to the exchange. It does
It's also possible that getCurrentBets will be dropped sooner or later. They "recommend" using the newer getMUBets, which mean that in the next version of the API, getCurrentBets is not included.
It's also possible that getCurrentBets will be dropped sooner or later. They "recommend" using the newer getMUBets, which mean that in the next version of the API, getCurrentBets is not included.
Thanks a lot Contrarian, you've probably saved me wasting a lot of time. The getMUBets documentation is a load of sh1te, the getCurrentBets documentation is a load of sh1te and, going by the forum, the GetMarketPricesCompressed Status is a load of sh1te. It does sound like a betfair api.
Thanks a lot Contrarian, you've probably saved me wasting a lot of time. The getMUBets documentation is a load of sh1te, the getCurrentBets documentation is a load of sh1te and, going by the forum, the GetMarketPricesCompressed Status is a load of sh
Thanks catfloppo, you needn't worry as most of my bets will be elsewhere.
I think Joe's way is the way to go but it means having to note the betid of every bet you place so you're only sending unmatched betid's in the betid array (in that case I'd probably be sending at most 1 betid per runner which would be way short of the 200). A call that would send back a summary of matched bets for each runner (potential profit and stake) along with unmatched bets in one call would've saved a lot of coding.
Another thing that really shocked me was that you're unable to specify you're not betting ir when submitting bets (to combat the bet just being sent as the market goes in play). It's not even like you can call up the market status right after and cancel immediately as you're stuck behind the clock. Is that a bertie bonus for mugging crews or something?
Thanks catfloppo, you needn't worry as most of my bets will be elsewhere.I think Joe's way is the way to go but it means having to note the betid of every bet you place so you're only sending unmatched betid's in the betid array (in that case I'd pro
Paul, you, pathetic little c0ck, what I saw was that you had a little fit, and starting abusing me as well as some other forumites.
By the way, have you seen this video?
http://www.youtube.com/watch?v=Vwigmktix2Y
Paul, you, pathetic little c0ck, what I saw was that you had a little fit, and starting abusing me as well as some other forumites. By the way, have you seen this video?http://www.youtube.com/watch?v=Vwigmktix2Y
Not much you can do to avoid hitting the market just as it goes inplay Feck, I do a getprices call before submitting any bet for latest prices and just use the inplay flag in the response to avoid betting inplay that's probably the best you can do to avoid it.
Not much you can do to avoid hitting the market just as it goes inplay Feck, I do a getprices call before submitting any bet for latest prices and just use the inplay flag in the response to avoid betting inplay that's probably the best you can do to
Thanks Joe. I read a few posts on the bdp forum that suggested the marketstatus and inplay values returned by the getmarketpricescompressed weren't exactly 100% reliable but I suppose there's not much else you can do. The absence of a flag in placebets that you can set to signify you don't want ir is a shocking omission.
Thanks Joe. I read a few posts on the bdp forum that suggested the marketstatus and inplay values returned by the getmarketpricescompressed weren't exactly 100% reliable but I suppose there's not much else you can do. The absence of a flag in placebe
Only other thing I'd suggest is you could consider including a BSP limit bet in each bet array. Usually if a bet is rejected in a placebet request it rejects all the bets in that request so a BSP bet placed after the off would be rejected. By sending a BSP limit bet you'd be able to send a valid bet that had no chance of being matched i.e. lay £10 liability with a max price of 1.1 on an outsider.
Only other thing I'd suggest is you could consider including a BSP limit bet in each bet array. Usually if a bet is rejected in a placebet request it rejects all the bets in that request so a BSP bet placed after the off would be rejected. By sending
Good idea Joe. Even without that, I suppose the duration of the suspend at the off would probably be enough to save me in cases where the api was working as it should.
I think I've got a rough idea now of how to track my bets but one thing I'm not sure of is, if I detect a horse has been withdrawn I take it I can find what backs have been automatically cancelled by calling getCurrentBets with marketID=0 but do I call it with betStaus=C or betStaus=V?
Good idea Joe. Even without that, I suppose the duration of the suspend at the off would probably be enough to save me in cases where the api was working as it should.I think I've got a rough idea now of how to track my bets but one thing I'm not sur
if I detect a horse has been withdrawn I take it I can find what backs have been automatically cancelled by calling getCurrentBets with marketID=0 but do I call it with betStaus=C or betStaus=V?
I'm talking about the lays betfair automatically cancel when a horse is withdrawn and has a RF>0. I'm no longer sure if you can retrieve these using getCurrentBets. Anyone know?
if I detect a horse has been withdrawn I take it I can find what backs have been automatically cancelled by calling getCurrentBets with marketID=0 but do I call it with betStaus=C or betStaus=V?I'm talking about the lays betfair automatically cancel
Forget those last 3 posts regarding cancelled bets. I'm hoping I've found a way of processing a race without having to store betId's or worry about withdrawals and RF's.
The information I need is
a) My stakes matched so far and average odds obtained on each individual runner (after any RF's). b) My current unmatched bets in system. c) The current state of the market (i.e. odds and stakes on offer).
For place markets a) can be obtained simply by calling getMarketProfitAndLoss. For win markets I'm thinking I'll call getCurrentBets for the appropriate MarketID with betStatus M and total the matchedSize and profitAndLoss fields by selectionID. I'm not using getMUBets for this because of the returned records limit and the fact it could theoretically return 200 records for one £2 matched bet (I require only a summary on matched bets).
I'll get b) by calling getMUBets with betStatus U. This will only return 1 record per betId and, as I don't expect to have any more than 2 or 3 unmatched bets per runner, this will be well within the 200 max record limit.
[Note: I could skip b) altogether if getCurrentBets accepted a betStatus of MU in the request but Contrarian said it didn't with marketID=0 and the documentation says you must choose M or U if a marketID is supplied.]
For c) I'll call getMarketPricesCompressed.
The information from a,b & c will allow me to cancel any unwanted bets, and update / add to existing unmatched bets based on my opinion where the value is. After that I can then move on to process the next market (or re-process that one) without the need to store or track anything.
As I've yet to try any of this I may be misunderstanding the less than reliable documentation so if anyone sees any pitfalls (beyond the obvious changes between calls) I'd welcome your comments.
Forget those last 3 posts regarding cancelled bets. I'm hoping I've found a way of processing a race without having to store betId's or worry about withdrawals and RF's.The information I need isa) My stakes matched so far and average odds obtained on
Once I've worked out a Kelly type staking formula I'm hoping I'll be able to use the getMarketProfitAndLoss for both place and win markets for a) but I'm anticipating coming up with this formula will be no easy task. Any links to Kelly formula for multiple bets in same event that takes into account back and lay bets already placed gratefully received.
Once I've worked out a Kelly type staking formula I'm hoping I'll be able to use the getMarketProfitAndLoss for both place and win markets for a) but I'm anticipating coming up with this formula will be no easy task. Any links to Kelly formula for mu
I think he was merely satirising your apparent inability to recall any of a threads preceding posts. Your questions do appear, at least on occasions, much like the blinking man in the video, as if you have only just joined the forums. Which actually you usually have
I think he was merely satirising your apparent inability to recall any of a threads preceding posts. Your questions do appear, at least on occasions, much like the blinking man in the video, as if you have only just joined the forums. Which actuall
No, I don't admit that at all. As Cat says, it was a bit of satire.
There's a distinction between bullying (e.g. your constant attempts to ridicule certain regulars on the football forum), and a bit of gentle mockery. You have to ask yourself why you're on about your 25th forum name, while I've managed to keep the same one for nearly 9 years.
bob,No, I don't admit that at all. As Cat says, it was a bit of satire.There's a distinction between bullying (e.g. your constant attempts to ridicule certain regulars on the football forum), and a bit of gentle mockery. You have to ask yourself why
Does getAccountStatement work properly. Regardless of what I set Req->startDate to (even today's date) I get the same 52 records returned that belong to over a month ago.
GetAccountStatement *Req = new GetAccountStatementRequest; Req->header = new NS_BFExchangeService::APIRequestHeader; Req->header->sessionToken = SessionToken;
int FetchSize=20000; Req->recordCount=FetchSize; Req->startDate=new TXSDateTime; Req->startDate->AsDateTime=TDateTime().CurrentDate(); Req->endDate=new TXSDateTime; Req->endDate->AsDateTime=TDateTime().CurrentDate(); Req->itemsIncluded=AccountStatementIncludeEnum::EXCHANGE;
While I'm at it, if anyone uses c++, can you tell me why I've got to use new to create the startDate and endDate request variables whereas the Request constructers for all other api functions seems to take care of creating / destroying internal variables.
Does getAccountStatement work properly. Regardless of what I set Req->startDate to (even today's date) I get the same 52 records returned that belong to over a month ago.GetAccountStatement *Req = new GetAccountStatementRequest;Req->header = new NS_B
I'm not sure you can set recordCount to >100 You need to use startRecord to page through the items
Make a call, you should get totalRecordCount > 100. Then increment startRecord by 100 and call again. If you are getting totalRecordCount =52 and you are certain you have more settled bets than this then your call has something wrong with it (you can't infinitely old bets).
rinse and repeat.
It works fine, imho.It wont return all your bets in one call.I'm not sure you can set recordCount to >100You need to use startRecord to page through the itemsMake a call, you should get totalRecordCount > 100. Then increment startRecord by 100 and c
Thanks for the reply JL. The FetchSize=20000 was just part of a test but there's no mention of a limit in the documentation. I wasn't expecting any more than 52 records (that's all my activity within the last 3 months), I was expecting zero as I set the startDate to today and my last activity was around a month ago.
PS You're only allowed a call a minute with the free API so if you don't get all the records in a oner you have to wait a minute before the second call or it returns API_ERROR.
Thanks for the reply JL. The FetchSize=20000 was just part of a test but there's no mention of a limit in the documentation. I wasn't expecting any more than 52 records (that's all my activity within the last 3 months), I was expecting zero as I set
ok, I'm with you now.Are you submitting a datetime instead of a date?startDate Y Date Return records on or after this dateendDate Y Date Return records on or before this datehttp://docs.developer.betfair.com/betfair/#!page=00008360-
If itemsIncluded = EXCHANGE, the startdate and endate properties on the GetAccountStatementReq are ignored. startDate and endDate are used when itemsIncluded = ALL
If itemsIncluded = EXCHANGE, the startdate and endate properties on the GetAccountStatementReq are ignored. startDate and endDate are used when itemsIncluded = ALL
Yesterday was the first chance I had to test the GetAccountStatement function. As subversion kindly pointed out setting ItemsIncluded to ALL means the startDate and endDate properties are ignored BUT, as I found out yesterday, if I set ItemsIncluded to ALL then NO_RESULTS is returned. I had to set it to EXCHANGE to get yesterdays bets.
Feck here BTW.
Yesterday was the first chance I had to test the GetAccountStatement function. As subversion kindly pointed out setting ItemsIncluded to ALL means the startDate and endDate properties are ignored BUT, as I found out yesterday, if I set ItemsIncluded
I suppose it depends on how you bet but does anyone else agree with me that if getMarketProfitAndLoss for Win markets just restricted the potential profit and loss figures to wagers on the runner in question (the way it does in place markets) api life would be so much easier? It would be a simple job to use those figures to determine the P/L for each runner over the market as a whole (so no loss there) yet it would enable us to gain a summary of bets so far without having to keep running totals (watching out for RF's) or calling getCurrentBets and summing all bets so far.
I suppose it depends on how you bet but does anyone else agree with me that if getMarketProfitAndLoss for Win markets just restricted the potential profit and loss figures to wagers on the runner in question (the way it does in place markets) api lif