No announcement yet.

[horse races] How to sort horses by odds in a simple manner?

  • Filter
  • Time
  • Show
Clear All
new posts

  • [horse races] How to sort horses by odds in a simple manner?

    I have historical data for horse races. I'm trying to figure out an algorithm of how to:

    for any given date/event:

    * take top N horses in the descending order (winner will go 1st, then - horse on the 2nd place, etc...)

    * attach odds to each one

    * data should be as close to "start" time as possible; that is, the most recent will have presedence over the old one, and overwrite them

    But what prevents me is understanding how to combine all those files for an event: "$event_id" and "1.$market_id", in a directory of an event.

    And what data should I actually take, except "runners'? Whilst having in mind that there're market changes too.

    So how to do it, what would be a simple algorithm? I don't need perfect solution, rather one which will just do.

    I'm a developer - able to program
    Last edited by fdsafds; 30-07-2022, 03:03 PM.

  • #2
    Or rather: is the amount of information in the historical data of the BASIC tariff even suffient to determine the order in which top N horses finished?


    • #3
      The BASIC files specifically show the change in the last traded price of every selection in a market at 1-minute intervals. They do not provide details showing the order in which the horses have finished, only the WINNER and LOSER in the final marketDefinition message at the end of each file.

      You can find sample code for visualizing the historical data files via


      • #4
        Alright, thanks