Is SelectionID Unique?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davecon
    Junior Member
    • Dec 2010
    • 86

    #1

    Is SelectionID Unique?

    Hi
    As the selectionId is the only object that is common in all betting calls, it does make an ideal Dictionary Key to collect and store all the market information at start up, especially as marketCatalogue refreshes after a Closed Book.
    Therefore, is the selectionId a unique number assigned to each Runner in each separate Market or would the Runner share the same selectionId if declared for multiple markets?
    So on the occasion when a Runner has multiple entries (Which is common in horse racing in winter and bank holidays)
    Seeing a Dictionary cannot have a duplicate key what would actually be the case?
    (Of course the error could be caught by using If Not Contains(Key) but that would mean the later entries would be ignored on a FIRST_TO_START basis) which could be the one required!
    Example – would it be (Hope Not)
    selId 1234 “Joe Egg” 2.40 Fontwell 2m Novice Hrd mktId 1.4567 status “REMOVED” Kept!
    selId 1234 “Joe Egg” 3.40 Warwick 3m Novice Hrd mktId 1.5678 status“ACTIVE” Dumped!
    Or (Hopefully)
    selId 1234 “Joe Egg” 2.40 Fontwell 2m Novice Hrd mktId 1.4567 status“REMOVED” Kept
    selId 1345 “Joe Egg” 3.40 Warwick 3m Novice Hrd mktId 1.5678 status “ACTIVE”
    Kept
    Would be grateful for any Input
    Cheers
    Dave
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Why not just make your dictionary key a combination of the marketId/selectionId - then it is unique regardless.

    Comment

    • davecon
      Junior Member
      • Dec 2010
      • 86

      #3
      Originally posted by betdynamics View Post
      Why not just make your dictionary key a combination of the marketId/selectionId - then it is unique regardless.
      Thanks Betdnamics - Good thinking Batman That would do the trick
      The only problem being I am already looping the Dictionary with the SelId to give me (amongst other things) the Results in the correct order and to monitor the status as the API likes to shuffle the Removed runners around like a pack of cards especially withdrawals prior to the Off and also reorganize everything on the Closed Book (For some strange reason)
      Should be able to do a revamp though if need be (Going to do a better app anyway when I have finished testing Yep should have done that Months ago lol)
      Cheers mate
      Dave

      Comment

      • JayBee
        Junior Member
        • Oct 2010
        • 114

        #4
        The selectionId is unique to each runner and not to each market.

        Sometimes the same horse is entered for multiple races until the trainer/owner decides which race to run.

        Also, due to some Betfair cock-up a member of staff will enter the same horse multiple times for the same marketId, causing all sorts of chaos. To get round that I have a Try/Catch that throws an exception if the same selectionId is entered for the same marketId.

        To get round the first problem, in some applications that I have written, I concatenate the selectionId and marketId to create a new id that hopefully Betfair can't cause chaos with.

        I think there should be something like a runnerId that is specific to a runner for any race and use a selectionId that is specific to a horse for a single race. Therefore it is different for every runner after each race that they run. It will save a few nanoseconds for us HFT freaks.
        Last edited by JayBee; 26-11-2014, 09:54 PM.

        Comment

        • davecon
          Junior Member
          • Dec 2010
          • 86

          #5
          Originally posted by JayBee View Post
          The selectionId is unique to each runner and not to each market.

          Sometimes the same horse is entered for multiple races until the trainer/owner decides which race to run.

          Also, due to some Betfair cock-up a member of staff will enter the same horse multiple times for the same marketId, causing all sorts of chaos. To get round that I have a Try/Catch that throws an exception if the same selectionId is entered for the same marketId.

          To get round the first problem, in some applications that I have written, I concatenate the selectionId and marketId to create a new id that hopefully Betfair can't cause chaos with.

          I think there should be something like a runnerId that is specific to a runner for any race and use a selectionId that is specific to a horse for a single race. Therefore it is different for every runner after each race that they run. It will save a few nanoseconds for us HFT freaks.
          Cheers JayBee
          Thanks for clarifying this
          So just a change a plan for me now - It was only cosmetic most of the time anyway (Results - Non Runners etc) and did not effect the bet placement as my bot only loads the market 30 secs before each Off time and it places my bets 10 secs before the Off (and exits at Suspended so that all that Book reshuffling nonsense that carries on after that point is disregarded)
          I'm not Trading and just using SP - So no big deal
          I have now took a different approach to the Removed Runner problem in case of a withdrawal before the Off by using the Number of Active Runners and if this changes It just calls Catalogue again a couple of times to refresh the Sort Order of the Selections
          Thanks again mate
          Dave

          Comment

          Working...
          X