MarketStatus (open/closed) - can't get from MarketCatalog - have to use MarketBook ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guest

    #1

    MarketStatus (open/closed) - can't get from MarketCatalog - have to use MarketBook ?

    Originally I had a listbox returning the horse races starting between NOW -> and the next 1 hour. But I noted that once the start time passes, then of course MarketCatalog does not return a race which still may be available to bet on (ie OPEN).

    To fix this I now search for races starting between NOW-10 minutes -> and forward 1 hour.

    I also need to filter out OPEN races.
    I also need to filter out IsInplay races. In Australia we can't bet online on IN-PLAY events (we have to ring up betfair!!! Thanks au government with your nanny stance!)

    Anyway I found what I was looking for which is the "IsInplay" booleand and MarketStatus which is an enumeration shown below.

    Public Enum MarketStatus
    INACTIVE
    OPEN
    SUSPENDED
    CLOSED
    End Enum


    Problem is, both IsInplay boolean and MarketStatus enumeration is only returned when you call MarketBook and not MarketCatalog which means you can only find out whether an event is OPEN/IN-PLAY after requesting price data. You think that you would be able to find out the MarketStatus when requesting the MarketCatalog. This requires less work and also less data traffic to BetFair's servers.
    Last edited by Guest; 21-03-2014, 12:54 AM.
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #2
    You are likely to misunderstand listMarketCatalogue and listMarketBook invocations.

    listMarketCatalogue is intended for finding markets. It has pretty static info about markets. As soon as you "found" market, listMarketCatalogue is useless for the market.

    listMarketBook is intened for getting dynamic information about market: it's state, prices, trading volumes, bets (both matched and unmatched), runners state and market outcome.

    If you know marketId, just always use listMarketBook. listMarketCatalogue is needed to learn marketId and some static info about market
    Betfair Bots Made Easy

    Comment

    • Guest

      #3
      Originally posted by AlgoTrader View Post
      If you know marketId, just always use listMarketBook. listMarketCatalogue is needed to learn marketId and some static info about market

      I agree - I guess I was talking about calling ListMarketCatalogue 1 min before the race starts.

      Ta for response.

      Comment

      Working...
      X