Have Betfair got this wrong in their documentation?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monkeymagix
    Junior Member
    • Jul 2010
    • 105

    #1

    Have Betfair got this wrong in their documentation?

    Hi

    I want to know 100% when a market is running as I was getting lots of cases of CLOSED markets which still had Inplay as True. And I thought InPlay was the way of checking.

    However I was told this.

    question) How do I know 100% a race is running?

    answer given) If the race is ACTIVE and "inplay":true,

    also

    InPlay means that the market is in play and is subject to the market status being ACTIVE. The CLOSED state indicates that the market has been settled. A market won't changed from CLOSED to ACTIVE in its lifetime, Its will only transmission from SUSPENDED > ACTIVE before being settled (CLOSED).

    But on their ENUM page there are only 4 and none that says ACTIVE.

    https://api.developer.betfair.com/se...s-MarketStatus


    INACTIVE - The market has been created but isn't yet available.

    OPEN - The market is open for betting.

    SUSPENDED - The market is suspended and not available for betting.

    CLOSED - The market has been settled and is no longer available for betting.

    And on their Betting Type Definitions page they say against status this

    status: MarketStatus

    The status of the market, for example ACTIVE, SUSPENDED, CLOSED (settled), etc.

    Have they confused ACTIVE with OPEN?

    Or is there an ACTIVE enum missing from their documentation and code?

    Thanks

    Rob
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    They just mean OPEN.

    Comment

    • bnl
      Junior Member
      • Nov 2012
      • 108

      #3
      I want to know 100% when a market is running as I was getting lots of cases of CLOSED markets which still had Inplay as True. And I thought InPlay was the way of checking.

      I check for OPEN and betdelay > 0.

      InPlay I think if the market is to be a market for inplay betting.

      /Björn

      Comment

      • bnl
        Junior Member
        • Nov 2012
        • 108

        #4
        I was thinking of willTurnInPlay.

        Still betDelay >0 works for me
        /Björn

        Comment

        • monkeymagix
          Junior Member
          • Jul 2010
          • 105

          #5
          Hi

          Hi

          They got back to be and admitted their explaination was confused e.g ACTIVE does not EXIST and the only way to check if a race is running 100% is with

          MarketType = OPEN and Inplay = True

          I guess BetDelay would work to as you only get a betdelay when a race is running.

          However you do get InPlay=True on CLOSED markets, why I don't know, I guess they just forget or don't bother turning it back to false after the race for some reason.

          They have updated their documentation as well on that page e.g

          https://api.developer.betfair.com/se...pe+Definitions

          The status of the market, for example OPEN, SUSPENDED, CLOSED (settled), etc.

          As it used to say ACTIVE.

          Looking at their documentation on that page and the previous comments there could be multiple ways of checking depending on what you wanted e.g

          -race is running
          -race is 100% over
          -race is 100% not started
          -race allows inplay betting

          e.g

          MarketBook

          betDelay > The number of seconds an order is held until it is submitted into the market. Orders are usually delayed when the market is in-play (it says usually - so can we depend on it?)
          bspReconciled > True if the market starting price has been reconciled (Could use this as only a race that has started / finished would be reconciled )
          complete > If false, runners may be added to the market (I was thinking of using this as if complete = false then the market must be closed or running as no runners can be added to a market that is running)
          inplay > True if the market is currently in play (so not whether it supports inplay bets - whether the race is inplay - although it can stay TRUE after the race so a check with MarketStatus is required as well)

          MarketDescription

          TurnInPlayEnabled > If 'true' the market is set to turn in-play (so we know if the market supports inplay betting - I save this in the DB against each race)


          Personally I now use this combo of variables and code to test whether a race is in the past or is currently running.

          I can then decide to allow inplay bets, place bets, or just check for a settled/cancelled/matched status etc.

          I store the TurnInPlayedEnabled when logging all markets so I know if it supports inplay bets.

          Code:
          myMarketDetails = this.GetMarketDetails(marketID);
          
          // find out time until the race where racedatetime comes from my DB
          double raceRunTimeAgo = (raceDateTime - DateTime.Now).TotalMinutes;
          
          bool raceinpast = false;
          bool raceIsInPlay = myMarketDetails.InPlay;
          bool raceIsRunning = false;
          
          if (raceIsInPlay && myMarketDetails.MarketStatus == "OPEN")
          {
          	// race is running and inplay right now
          	raceIsRunning = true;
          }
          else if (myMarketDetails.MarketStatus == "CLOSED")
          {
          	// race is over
          	raceinpast = true;
          	raceIsInPlay = false;
          }


          It is a bit bad for developers when even the documentation is wrong as it can lead people down the wrong path and there have been so many instances of this plus code bugs in the new API - I have personally found about 10 now which they have fixed.

          You would think they wouldn't release the API until it was 100% working with correct documentation but I guess WE are the TESTING crew and OUR money is on the line when THEIR BUGS cause it to go tits up!

          Thanks

          Rob

          Comment

          • zoltanthemage
            Junior Member
            • May 2015
            • 17

            #6
            Beware the TurnInPlayEnabled flag might change over time.
            I happened to see markets going in play while at creation time they were not supposed to (I don't remember if the opposite happens too).

            Comment

            Working...
            X