listMarketBook & market start time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Debcho
    Junior Member
    • Oct 2012
    • 5

    #1

    listMarketBook & market start time

    Hello,

    Kind of stupid question, but cannot figure it out.

    I'm using list of MarketIDs and checking prices with listMarketBook.
    And when Marker.Status != OPEN just loading next market.

    But is there a way to get market start time?

    Also get that listMarketCatalogue do not have MarketProjection.MARKET_START_TIME:

    Code:
    ISet<MarketProjection> marketProjections = new HashSet<MarketProjection>();
    
                    marketProjections.Add(MarketProjection.RUNNER_METADATA);           
    //marketProjections.Add(MarketProjection.MARKET_START_TIME);
    Any help will be highly appreciated
  • Merlin
    Junior Member
    • Jan 2009
    • 56

    #2
    Hi Debcho,

    If you want the market start time, just call listMarketCatalogue with MARKET_START_TIME included in the list for the 'marketProjection' parameter - Note that there is NO 's' on the end of this parameter name, making it inconsistent with most other parameters on the API which require a list.

    cheers
    Merlin

    Comment

    • Debcho
      Junior Member
      • Oct 2012
      • 5

      #3
      Hi,

      Thank you for your response but

      S in the end it's just a name in the app:

      Code:
      ISet<MarketProjection> marketProjection = new HashSet<MarketProjection>();
                      marketProjection.Add(MarketProjection.RUNNER_METADATA);
                      marketProjection.Add(MarketProjection.MARKET_START_TIME);
      And I'm getting

      Error 1 'BetfairAPI_NG.TO.MarketProjection' does not contain a definition for 'MARKET_START_TIME'



      Any ideas how to fix this?

      Thanks
      Last edited by Debcho; 28-02-2015, 12:44 AM.

      Comment

      • Merlin
        Junior Member
        • Jan 2009
        • 56

        #4
        Hi,

        it looks like an omission in the library you are using; 'MARKET_START_TIME' is definitely in the Enum for MarketProjection at the betfair end. I suspect you are using the C♯ code from betfair, or something derived from it - this is missing 'MARKET_START_TIME' from the enum in MarketProjection.cs - I would suggest getting in touch with the betfair development team and asking them to fix it.

        Cheers,

        Merlin

        Comment

        • geoffw123
          Senior Member
          • Mar 2014
          • 250

          #5
          Hi

          Should be as simple as just changing code to this

          Code:
              [JsonConverter(typeof(StringEnumConverter))]
              public enum MarketProjection
              {
                  COMPETITION, EVENT, EVENT_TYPE, MARKET_START_TIME, MARKET_DESCRIPTION, RUNNER_DESCRIPTION, RUNNER_METADATA 
              }
          Regards Geoff

          Comment

          • Debcho
            Junior Member
            • Oct 2012
            • 5

            #6
            Originally posted by Merlin View Post
            Hi,

            it looks like an omission in the library you are using; 'MARKET_START_TIME' is definitely in the Enum for MarketProjection at the betfair end. I suspect you are using the C♯ code from betfair, or something derived from it - this is missing 'MARKET_START_TIME' from the enum in MarketProjection.cs - I would suggest getting in touch with the betfair development team and asking them to fix it.

            Cheers,

            Merlin
            Thank You

            I have zero c# & JSON experience, but have a general one.
            So after you tell me where is the problem, here is the solution for other people using BG reference code:

            Add following in MarketCatalogue.cs:

            in public class MarketCatalogue{

            Code:
                    [JsonProperty(PropertyName = "marketStartTime")]
                    public string MarketStartTime { get; set; }
            and in MarketProjection.cs:

            , MARKET_START_TIME in the end, e.g.:

            Code:
                [JsonConverter(typeof(StringEnumConverter))]
                public enum MarketProjection
                {
                    COMPETITION, EVENT, EVENT_TYPE, MARKET_DESCRIPTION, RUNNER_DESCRIPTION, RUNNER_METADATA, MARKET_START_TIME 
                }

            Comment

            Working...
            X