is Bet matched?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Guest
    Guest replied
    Hey mate - thanks for your reply. It is good to know people out there helping others

    Just on the visualizers, it might be an Australian thing but the account visualizer works ok, but the betting one has never worked for me (regardless of endpoint UK or AUS).

    With regards to that bet I showed above, it is a current market (setup about 4 months ago) and I have a current bet on it.

    I have also gone to Betfair - looked up a current horse race, placed a high bet on it like Horse 1 to win at 80:1 and still I can't get any details on the bet through the ListcurrentOrders call ?

    Do you have the full JSON parameter call for ListCurrentOrders and ListClearedOrders ? For instance is the following JSON call correct ?

    Code:
    Calling: SportsAPING/v1.0/listCurrentOrders With args: {"marketId":"2.100947624","orderProjection":"ALL"}

    Also here is a call to ListClearedOrders which takes around 3 seconds to return a response, and doesn't return what I would expect. The response I do get looks like help on the call ..

    Code:
    Calling: SportsAPING/v1.0/listClearedOrders With args: {"betStatus":"SETTLED","includeItemDescription":false}
    
    Got Response: {"jsonrpc":"2.0","result":{"betStatus":"SETTLED","side":"BACK","groupBy":"EVENT_TYPE","includeItemDescription":false,"fromRecord":0,"recordCount":0},"id":1}
    Last edited by Guest; 27-04-2014, 10:50 AM.

    Leave a comment:


  • betdynamics
    replied
    How old is the market? Is it still active?

    Can you repeat the exercise via the Visualiser for an active market?

    [Update]
    I have just created a bet and successfully looked at it via the visualiser (although you have to click on the + button to see the bet id and then the info button to see the details)
    Last edited by betdynamics; 24-04-2014, 10:33 AM.

    Leave a comment:


  • Guest
    Guest replied
    Originally posted by betdynamics View Post
    Try setting a value for OrderProjection ?
    Thanks Betdynamics, I did try with OrderProjection but again no real response

    Code:
    Calling: SportsAPING/v1.0/listCurrentOrders With args: {"marketId":"2.100768838","orderProjection":"ALL"}
    
    Got Response: {"jsonrpc":"2.0","result":{"moreAvailable":false},"id":1}

    Leave a comment:


  • betdynamics
    replied
    Try setting a value for OrderProjection ?

    Leave a comment:


  • Guest
    Guest replied
    NOW FIXED - 4 MAY 2013: I have now fixed these classes so they are correct.



    BTW. I am using the VB.NET API_NG example code and have included some the additional coded I have added including classes to make it easier to drill down through the data. Hopefully this is correct and it helps someone else out.


    Code for IClient.vb
    Code:
            Function listCurrentOrders(ByVal betIds As IList(Of String), ByVal marketIds As IList(Of String), ByVal OrderProjection? As OrderProjection, ByVal placedDateRange As TimeRange, ByVal dateRange As TimeRange, ByVal OrderBy As OrderBy, ByVal SortDir As SortDir, ByVal intfromRecord As Integer, ByVal intrecordCount As Integer) As CurrentOrderSummaryReport
    Code for JsonRpcClient.vb
    Code:
    Public Function listCurrentOrders(ByVal betIds As IList(Of String), ByVal marketIds As IList(Of String), ByVal OrderProjection? As OrderProjection, ByVal placedDateRange As TimeRange, ByVal dateRange As TimeRange, ByVal OrderBy As OrderBy, ByVal SortDir As SortDir, ByVal intfromRecord As Integer, ByVal intrecordCount As Integer) As CurrentOrderSummaryReport Implements IClient.listCurrentOrders
                Dim args = New Dictionary(Of String, Object)()
    
                args(BET_IDS) = betIds
                'args(MARKET_IDS) = marketIds               TO ADD LATER
                'args(ORDER_PROJECTION) = OrderProjection   TO ADD LATER
    
                Return Invoke(Of CurrentOrderSummaryReport)(LIST_CURRENT_ORDERS, args)
            End Function

    CurrentOrderSummaryReport and CurrentOrderSummary Classes including ENUMS
    Code:
    Imports System
    Imports System.Collections.Generic
    Imports System.Linq
    Imports System.Text
    Imports Newtonsoft.Json
    Imports Newtonsoft.Json.Converters
    
    'TROY ADDED THIS CODE HERE BASED ON BETFAIR WEBSITE 23 APR 2014
    Namespace API_NG.TO
        Public Class CurrentOrderSummaryReport
            <JsonProperty(PropertyName:="CurrentOrderSummary")> _
            Public Property CurrentOrderSummary() As List(Of CurrentOrderSummary)                   'The list of current orders returned by your query. This will be a valid list (i.e. empty or non-empty but never 'null').
    
            <JsonProperty(PropertyName:="moreAvailable")> _
            Public Property moreAvailable() As Boolean                                                'Indicates whether there are further result items beyond this page. Note that underlying data is highly time-dependent and the subsequent search orders query might return an empty result.
        End Class
    
        Public Class CurrentOrderSummary
            <JsonProperty(PropertyName:="betId")> _
            Public Property betIds() As ISet(Of String)                     'The bet ID of the original place order.
    
            <JsonProperty(PropertyName:="marketId")> _
            Public Property marketId() As String                            'The market id the order is for.
    
            <JsonProperty(PropertyName:="selectionId")> _
            Public Property selectionId() As Long                           'The selection id the order is for.
    
            <JsonProperty(PropertyName:="handicap")> _
            Public Property Handicap() As Double?                           'The handicap of the bet.
    
            <JsonProperty(PropertyName:="priceSize")> _
            Public Property priceSize() As PriceSize               'The price and size of the bet.
    
            <JsonProperty(PropertyName:="bspLiability")> _
            Public Property bspLiability() As Double                          'Not to be confused with size. This is the liability of a given BSP bet.
    
            <JsonProperty(PropertyName:="side")> _
            Public Property Side() As Side                                  'BACK/LAY
    
            <JsonProperty(PropertyName:="status")> _
            Public Property Status() As OrderStatus                         'Either EXECUTABLE (an unmatched amount remains) or EXECUTION_COMPLETE (no unmatched amount remains).
    
            <JsonProperty(PropertyName:="persistenceType")> _
            Public Property PersistenceType() As PersistenceType            'What to do with the order at turn-in-play.
    
            <JsonProperty(PropertyName:="orderType")> _
            Public Property OrderType() As OrderType                        'BSP Order type.
    
            <JsonProperty(PropertyName:="placedDate")> _
            Public Property placedDate() As Date                            'The date, to the second, the bet was placed.
    
            <JsonProperty(PropertyName:="matchedDate")> _
            Public Property matchedDate() As Date                           'The date, to the second, of the last matched bet fragment (where applicable) 
    
            <JsonProperty(PropertyName:="averagePriceMatched")> _
            Public Property averagePriceMatched() As Double                   'The average price matched at. Voided match fragments are removed from this average calculation.
    
            <JsonProperty(PropertyName:="sizeMatched")> _
            Public Property sizeMatched() As Double                           'The current amount of this bet that was matched.
    
            <JsonProperty(PropertyName:="sizeRemaining")> _
            Public Property sizeRemaining() As Double                         'The current amount of this bet that is unmatched.
    
            <JsonProperty(PropertyName:="sizeLapsed")> _
            Public Property sizeLapsed() As Double                            'The current amount of this bet that was lapsed.
    
            <JsonProperty(PropertyName:="sizeCancelled")> _
            Public Property sizeCancelled() As Double                         'The current amount of this bet that was cancelled.
    
            <JsonProperty(PropertyName:="sizeVoided")> _
            Public Property sizeVoided() As Double                            'The current amount of this bet that was voided.
    
            <JsonProperty(PropertyName:="regulatorAuthCode")> _
            Public Property regulatorAuthCode() As String                     'The regulator authorisation code.
    
            <JsonProperty(PropertyName:="regulatorCode")> _
            Public Property regulatorCode() As String                         'The regulator Code
    
        End Class
    
        <JsonConverter(GetType(StringEnumConverter))> _
        Public Enum SortDir
            EARLIEST_TO_LATEST                                  'Order from earliest value to latest e.g. lowest betId is first in the results.
            LATEST_TO_EARLIEST                                  'Order from the latest value to the earliest e.g. highest betId is first in the results.
        End Enum
    End Namespace
    Last edited by Guest; 04-05-2014, 01:26 PM. Reason: wrong code posted

    Leave a comment:


  • Guest
    Guest replied
    ListCurrentOrders ????

    I am trying to code up ListCurrentOrders. I have a bet in the market for Broncos as 2014 RL premiers so hopefully ListCurrentOrders should return this bet.



    Here is the JSON response to my call which provides no data ???
    Code:
    Calling: SportsAPING/v1.0/listCurrentOrders With args: {"betIds":["3550545168"]}
    
    Got Response: {"jsonrpc":"2.0","result":{"moreAvailable":false},"id":1}

    This time with no parameters which should return all current orders" ... again nothing ????
    Code:
    Calling: SportsAPING/v1.0/listCurrentOrders With args: {}
    
    Got Response: {"jsonrpc":"2.0","result":{"moreAvailable":false},"id":1}
    so can anyone tell me what I may be doing wrong ????

    Leave a comment:


  • bnl
    replied
    Ok, then listClearedOrders is what I am looking for.
    Thanks
    /Björn

    Leave a comment:


  • BetfairDeveloperProgram
    replied
    Hi Björn

    listCurrentOrders can be used to check the status of your unmatched or matched bets.

    The listClearedOrders call (due to be released on the 16th December) will enable you to check details of your bets following market settlement.

    Thanks

    Neil

    Leave a comment:


  • bnl
    started a topic is Bet matched?

    is Bet matched?

    Hi!
    If I place a bet with PERSIST flag,
    and the bet is matched during in-play,
    how can I find out via the api-ng if it was matched?
    it seems that listCurrentOrders is only good before
    the race is settled
    Code:
    2013-11-20 17:35:09.872 RPC. : posting: {"method":"SportsAPING/v1.0/listCurrentOrders", "jsonrpc":"2.0", "id":15, "params":{"betIds":["31842324833"], "placesDateRange":{}}}
    2013-11-20 17:35:09.916 RPC.Bet_Is_Matched : Got reply: {"id":15, "jsonrpc":"2.0", "result":{"moreAvailable":false, "currentOrders":[{"marketId":"1.111937147", "betId":"31842324833", "handicap":0.00000E+00, "orderType":"LIMIT", "sizeCancelled":0.00000E+00, "bspLiability":0.00000E+00, "selectionId":5473866, "sizeVoided":0.00000E+00, "status":"EXECUTION_COMPLETE", "matchedDate":"2013-11-20T16:32:16.000Z", "placedDate":"2013-11-20T15:29:52.000Z", "sizeLapsed":0.00000E+00, "side":"BACK", "priceSize":{"size":3.00000E+01, "price":2.00000E+01}, "regulatorCode":"MALTA LOTTERIES AND GAMBLING AUTHORITY", "sizeMatched":3.00000E+01, "persistenceType":"PERSIST", "sizeRemaining":0.00000E+00, "averagePriceMatched":2.00000E+01}]}}
    which is fine, I got EXECUTION_COMPLETE in this case.
    But for an order that has a settled market I get an empty reply

    Code:
    2013-11-20 20:34:08.912 RPC. : posting: {"method":"SportsAPING/v1.0/listCurrentOrders", "jsonrpc":"2.0", "id":15, "params":{"betIds":["31846248762"], "placesDateRange":{}}}
    2013-11-20 20:34:08.936 RPC.Bet_Is_Matched : Got reply: {"id":15, "jsonrpc":"2.0", "result":{"moreAvailable":false, "currentOrders":[]}}
    The bet above was matched at in-play. But I did not poll
    between the in-play and end of race, thus missing the match.
    How can I get the matching status of a bet after the race is settled?

    /Björn
Working...
X