Asynchronous Bet Placed Event

Please post any questions regarding the program here.

Moderator: 2020vision

Asynchronous Bet Placed Event

Postby kiint » Thu Oct 10, 2013 3:13 pm

Hi,
I have a vb.net application that I've recently modified to place bets asynchronously that are then processed via the betplaced event.
It fires fine when placing bets but it also seems to be firing, returning "OK_REMAINING_CANCELLED", for a cancel bet function. It also seems to be returning a token value when it does this.
Is it supposed to do this? If yes, then are there any other times it will fire?

Many thanks.
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby osknows » Thu Oct 10, 2013 3:46 pm

OK_REMAINING_CANCELLED is an error code from the UpdateBets response so it looks like the app is attempting to update existing bets.

The application sounds like it's operating as expected but without any more detail it's hard to say.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby kiint » Thu Oct 10, 2013 4:31 pm

osknows wrote:OK_REMAINING_CANCELLED is an error code from the UpdateBets response so it looks like the app is attempting to update existing bets.

The application sounds like it's operating as expected but without any more detail it's hard to say.


I think it also gets returned by the cancel bet api call.
But anyway, the COM functions don't provide for asynchronous processing so I would not expect the event to fire as a consequence. The appearance of the token is also strange as it can only be passed via the placebet function. So it appears to me that the bet placed event is firing for events that update bets placed asynchronously.

Gary, can you confirm how and when the event should be triggered?

Thanks.
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby osknows » Thu Oct 10, 2013 4:56 pm

From the Betfair API guide, OK_REMAINING_CANCELLED - The remaining stake was cancelled and the new bet was submitted successfully.

The COM function do allow asynchronous processing.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby kiint » Thu Oct 10, 2013 5:22 pm

osknows wrote:From the Betfair API guide, OK_REMAINING_CANCELLED - The remaining stake was cancelled and the new bet was submitted successfully.

The COM function do allow asynchronous processing.


Unless I've missed something, only placebet and the two market volume functions exposed by the COM interface provide for asynchronous processing. Happy to be corrected but from what I understand, the cancelbet function does not provide this in which case after calling this function there should not be a corresponding triggering of the bet placed event. But, this event is triggering, and returning a token used for a previous call to the placebet function.

Nowhere have I seen anything documented that says that this is correct behaviour.
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby osknows » Thu Oct 10, 2013 6:06 pm

I understand what you are asking now :)

Can you test it manually in VBA using placeBets and then see if the event fires when you update the bet? I would test here but don't have BA on this tablet.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby osknows » Thu Oct 10, 2013 6:39 pm

Also, if you are placing below minimum £2 bets then you are probably getting the responses from the first placebet and subsequent update/cancel bets.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby kiint » Fri Oct 11, 2013 7:41 pm

Hi Os, sorry for the delay replying, I've been a bit tied up but I've had a bit more time now to lok into things.

My app isn't an Excel/VBA one so I haven't tried your first suggestion but I have put aa lot more trace statements into it.

Bets placed are always above £2.00 so I know it isn't this although it does raise another question, i.e. when is the event fired for sub-£2 stakes?

Anyway, as I said, I've now done a lot more tracing and I can be more specific around what is happening.

The sequence is as follows:
1. A back bet is placed for £2.00, token="0001"
2. The ba_betPlaced event fires correctly returning the token "0001"
3. Part of the bet is matched with a matched amount of £0.02
4. The bet hangss around for a bit waiting to get matched.
5. The programme decides it's been waiting too long and cancells it via the cancelBet method.
6. The programme then places a lay bet for the original matched amount of £0.02, token = "0002"
7. The ba_betPlaced event fires with a return code of OK_REMAINING_CANCELLED and returns a token of "0002"

Note that the ba.cancelBet never fires in response to the lay bet placement.
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby kiint » Fri Oct 11, 2013 9:07 pm

Right, I've sussed it and probably answered the below £2 stake question. Os, you were probably on the right track earlier.

The OK_REMAINING_CANCELLED return code is returned when a below £2 bet goes in. The event fires when the bet completes being placed and as the last action was to cancel the £2 bit, it returns OK_REMAINING_CANCELLED.

So, I think the mystery is solved but Gary, it would be nice if we could have some documentation for these additional features. I know it is a beta version but this has caused me a lot of grief and quite a bit of effort to track down.
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am


Return to Help

Who is online

Users browsing this forum: No registered users and 40 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.