Betfair Developers


Exchange API
Discussion about the Betfair Sports Application Programming Interface - API NG

Thread Closed
Weeza Weeza is offline
Junior Member
 
Default Updating the bet persistence of an existing unmatched bet

Using the UpdateBet function, I am able to update either the size or the price of an unmatched bet on a horse race. But I don't seem to be able the change the bet persistence of the bet. On the Betfair website there are 3 radio buttons that let you change the persistence quickly and easily. How can I change the persistence type of an existing unmatched bet?
AlgoTrader AlgoTrader is offline
Senior Member
 
Default

Quote:
Originally Posted by Weeza View Post
Using the UpdateBet function, I am able to update either the size or the price of an unmatched bet on a horse race. But I don't seem to be able the change the bet persistence of the bet. On the Betfair website there are 3 radio buttons that let you change the persistence quickly and easily. How can I change the persistence type of an existing unmatched bet?
There is no problem to change persistence of Bet. It works
Weeza Weeza is offline
Junior Member
 
Default

What parameters do I need to pass into the updateBet function to change the bet persistence type (and leave the size and price unchanged) ?
AlgoTrader AlgoTrader is offline
Senior Member
 
Default

Quote:
Originally Posted by Weeza View Post
What parameters do I need to pass into the updateBet function to change the bet persistence type (and leave the size and price unchanged) ?
Damn, just checked it

Code:
    updateBets : function(cb) {
        console.log('===== updateBets for betId=%s, change bet size =====',betId);
        var bet = {
                betId: betId,
                newBetPersistenceType: "NONE",
                newPrice : "1.01",
                newSize : "5.0",
                oldBetPersistenceType: "IP",
                oldPrice : "1.01",
                oldSize : "5.0"

        }
        var inv = session.updateBets([bet])
The result is extremely strange:
Code:
{ header: 
   { errorCode: 'OK',
     minorErrorCode: null,
     sessionToken: 'removed',
     timestamp: Fri, 06 Apr 2012 15:01:53 GMT },
  betResults: 
   [ { betId: '19209544488',
       newBetId: '0',
       sizeCancelled: '0.0',
       newSize: '0.0',
       newPrice: '0.0',
       resultCode: 'BET_IN_PROGRESS',
       success: 'false' } ],
  errorCode: 'BET_IN_PROGRESS',
  minorErrorCode: null }
It's certainly bug. The call is 5 sec although market is not in-play. Please contact Betfair Team to inform them, they are certainly have problems with backends
AlgoTrader AlgoTrader is offline
Senior Member
 
Default

It works now

Code:
{ header: 
   { errorCode: 'OK',
     minorErrorCode: null,
     sessionToken: 'removed',
     timestamp: Fri, 06 Apr 2012 15:19:46 GMT },
  betResults: 
   [ { betId: '19209925060',
       newBetId: '0',
       sizeCancelled: '0.0',
       newSize: '5.0',
       newPrice: '1.01',
       resultCode: 'PERSISTENCE_MODIFICATION_SUCCESS',
       success: 'true' } ],
  errorCode: 'OK',
  minorErrorCode: null }
Weeza Weeza is offline
Junior Member
 
Default

The parameters that you used was the first thing that I had originally tried. Then I tried various other combinations which didn't work either. I tried it again now and it is still not working.

This is what I sent:
<UpdateBets>
<betId>nnnnnnnnn</betId>
<NewBetPersistenceType>SP</NewBetPersistenceType>
<newPrice>1000</newPrice>
<newSize>5</newSize>
<oldBetPersistenceType>NONE</oldBetPersistenceType>
<oldPrice>1000</oldPrice>
<oldSize>5</oldSize>
</UpdateBets>

And this is what I got back:
<n2:UpdateBetsResult xsi:type="n2:UpdateBetsResult">
<betId xsi:type="xsd:long">nnnnnnnnnn</betId>
<newBetId xsi:type="xsd:long">0</newBetId>
<sizeCancelled xsi:type="xsd:double">0.0</sizeCancelled>
<newSize xsi:type="xsd:double">0.0</newSize>
<newPrice xsi:type="xsd:double">0.0</newPrice>
<resultCode xsi:type="n2:UpdateBetsResultEnum">INVALID_PRICE_A ND_SIZE</resultCode>
<success xsi:type="xsd:boolean">false</success>
</n2:UpdateBetsResult>


The documentation only talks about being able to change the price or the size. But the old persistence and new persistence are parameters to the UpdateBets function. Can you see anything different in what I have done compared to what you have done?
Weeza Weeza is offline
Junior Member
 
Default

Also, if I call UpdateBets and change the size up by 0.01 and have a NewPersistence which is different to the OldPersistence, then the bet still goes in with the OldPersistence.
Weeza Weeza is offline
Junior Member
 
Default

I have figured out what I was doing incorrectly.

The tag for NewBetPersistence type needed to be newBetPersistenceType. For all the other tags I correctly had a lower case letter to start with, but unfortunately I had put a capital N instead of a lower case n on newBetPersistenceType.

It is all working correctly now.

Thanks for your help AlgoTrader.
Thread Closed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump