Feature request for listCurrentOrders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Magoo
    Junior Member
    • Jan 2011
    • 86

    #1

    Feature request for listCurrentOrders

    The new API doesn't provide a simple way to list your matched bets, which seems like a pretty significant omission to me!

    listCurrentOrders() can request EXECUTABLE bets (those with an unmatched portion), EXECUTION_COMPLETE (those that are fully matched) or ALL (everything)

    EXECUTION_COMPLETE is, in my view, a bit of an odd state. If I place a £100 bet and £99.99 of it is matched, then it won't be returned. The only way to find out that I've had a £99 bet matched is to request ALL bets.

    Could we please have an additional orderProjection state that returns both fully and partially matched bets? The old API did this perfectly well. Having to request all bets in order to find the matched ones is very inefficient, especially when you have got a lot of bets.

    Secondly, it would be fantastic if there was a way to return the selection name and market name of the bets. All you get back from the new API is the selection ID and market ID. To discover the names of your bets, you need to load the market data of each market.

    Imagine having to implement something like the 'My Account/Current Bets/Matched bets' web page using the new API. You'd have to call listCurrentOrders( ALL ) (multiple times, paging through the output), then listMarketCatalogue() for each individual market there, to retrieve market & runner names. It's amazingly inefficient and IMO poor design, especially since the old API could do this so well.
  • geoffw123
    Senior Member
    • Mar 2014
    • 250

    #2
    ListCurrentOrders

    Hi

    Interesting post as I am just tinkering with the same ListCurrentOrders command myself. I agree with your comments, its an oversight on their part I think.

    I was currently pondering how to test that my code was working correctly for partially matched orders, they are a pain to test as they are infrequent and aren't predictable when they occur. I wonder how I can test this without it costing me a lot of money placing largeish bets that will likely only get partially matched.

    The other thing that I thought was maybe an oversight(assuming I haven't missed something in their API) is how would I implement the feature to display a bunch of matched trades on one runner as average odds over all bets. I had assumed that I could request average odds in my request packet to the Server. This of course would be good as it would save a ton of traffic back to me. It seems though I cant request average odds, I have to get all the orders and do the maths on the client side

    Regards Geoff

    Comment

    • kawafan
      Junior Member
      • May 2011
      • 33

      #3
      Incomplete

      in every announcement i read statement from betfair that API-NG is in production since mid 2013 .

      We dont even have complete method like getting funds of AUS wallet till now and they are expiring the old api.

      i don't know how others feel about it but that's odd if you haven't released full functional All in One api and you still expiring the old stable one.

      on the topic i also had to call it multiple time and then process them individually for matched and un matched or partially matched bets.
      Same goes for Market Profit and loss for Multi runner win market like place or Asian line ids;

      Comment

      • BetfairDeveloperProgram
        Administrator
        • Oct 2008
        • 680

        #4
        Feature request for listCurrentOrders

        Hi Mr_Magoo, geoffw123 & kawafan,

        Thanks for your feedback.

        Could we please have an additional orderProjection state that returns both fully and partially matched bets? The old API did this perfectly well. Having to request all bets in order to find the matched ones is very inefficient, especially when you have got a lot of bets.
        Following the initial release of listCurrentOrders we made some additional changes to allow fully/partially orders to be filtered from the list of returned bets. You can do this by making a listOrders request with ORDER_PROJECTION “ALL” and OrderBy ‘BY_MATCHED_TIME’. This will filter out any bet records that have no matched date and provides the list of betIds in the order of which they are fully/partially matched.

        In addition you can use the dateRange parameter to filter your matched orders from a specific date or within a given time-frame.

        Secondly, it would be fantastic if there was a way to return the selection name and market name of the bets. All you get back from the new API is the selection ID and market ID. To discover the names of your bets, you need to load the market data of each market.
        We don't have any plans to add this information to listCurrentOrders, but as previously mentioned, we are investigating the development of a price & order streaming services which should be more efficient for high volume use.

        I had assumed that I could request average odds in my request packet to the Server. It seems though I cant request average odds, I have to get all the orders and do the maths on the client side
        You can use listMarketBook to calculate the average odds by setting MatchProjection ROLLED_UP_BY_AVG_PRICE. You would need to calculate this yourself if using listCleared orders as averagePrice is only provided at betId level.

        We don't even have complete method like getting funds of AUS wallet till now and they are expiring the old api.
        These operations will be released on the 9th September, sorry for the extended delay in making these available!

        Kind Regards

        Neil

        Comment

        • Mr Magoo
          Junior Member
          • Jan 2011
          • 86

          #5
          Following the initial release of listCurrentOrders we made some additional changes to allow fully/partially orders to be filtered from the list of returned bets. You can do this by making a listOrders request with ORDER_PROJECTION “ALL” and OrderBy ‘BY_MATCHED_TIME’. This will filter out any bet records that have no matched date and provides the list of betIds in the order of which they are fully/partially matched.
          Thanks! This seems to work fine. I was a bit skeptical about this, thinking that it might still be doing a lot of work and be very slow, but actually the responses seem to be as quick as the old API.

          We don't have any plans to add this information to listCurrentOrders, but as previously mentioned, we are investigating the development of a price & order streaming services which should be more efficient for high volume use.
          That's a shame, because it really treats the API as a second-class citizen compared to the website. Surely many (if not all) apps will want to have a window to show all of your current bets. The website has this and it loads just fine. But in the API, we have to fetch the bets and then load the markets for each and every entry in order to put a description and runner name to the bet. It's not a matter of high volume, just a case of retrieving basic information quickly in order to show it to the user. With the new API, we have to inundate the API with lots of calls. With the old API, one call got all of the information.

          Comment

          • IainMack
            Junior Member
            • Oct 2010
            • 19

            #6
            List Cleared Orders

            I am confused and I apologise in advance for asking such a simple question.

            I have a program in Visual Basic that looks at the current state of play and submits wagers. I'd like to add code to check on the status of previous wagers, but I can't figure out what code to add - that is: I have found and copied a few examples but they always give an error. I accept that it may well be that I need to add something some place else, but at the moment: I'm stuck. I have looked at a VB.NET course and I am sure that it explains everything, but it doesn't help me figure out the error. Can someone post sample code to list cleared orders from a Visual Basic program?

            Thanks in advance.

            Comment

            Working...
            X