Discussion A Lockdown Project

Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#1
Hey guy's, need a bit of input. I've been thinking about what I can learn while in lockdown. I have decided to learn to code/program. There seem to be thousands of different languages out there, so I need some input as to which would be best for me to start with. There is a particular project that I had in mind so this may help with which language i need to learn. As many of you would know, I don't mind the occasional bet. :eek: What I want to do is download quite a large amount of race results that are in excel and write a code that can go through all that info to find the best combinations of factors that lead to a method to narrow down possible outcomes. Over the years I have improved alot in learning formula's in excel to carry out the sorting/spreading/ordering/looking up data and that sort of stuff. The lock and load comp helped me with alot of those sorts of things. So basically I need to learn to be able to scrape those excel files from a website and then have a program sort those results into many different files based on things like track/race type/race distance and so on, and then be able to put in a set of queries that would run different scenarios in order to find combinations that throw up better results than average. I am not sure where all this ranks on a scalke of difficulty. Some things that seem very complicated can be made to look very easy with the right knowledge. I am under no illusions about how difficult this may be for me but really not much else to do with my time at the moment, apart from trying to cook. Appreciate any thoughts on this project of mine.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#2
Hey doc,
I spent many years doing something similar, gathering results purely through XL.
I have a number of thoughts for you, on the racing side of things, but I am clueless on the coding side of things.
Possibly someone like @Beg2Differ might have a more informed opinion on that side of things.
I'm short of time right now, so I'll do my racing thoughts over the next day or two.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#3
Thanks Rowsus, I have the ideas floating around the brain but not the coding knowledge to be able to test out those thoughts. These ideas are not form related but related about betting patterns and the like. I have found over the years that my form study tends to lead to average results. Some really good days, really bad days but most in between. It's led me more to the betting side of things and pretty much turning it into a complete mathematical game rather than form.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#4
I think a consistent profit can be returned from betting on consistent circumstances with the right staking system, and taking the emotion completely out of it.
 
Joined
15 Mar 2019
Messages
14,185
Likes
54,332
AFL Club
Hawthorn
#5
If you can get this to work, it could be quite lucrative. Good luck!

I don't have any programming skills to help you out unfortunately, but I would have thought if there was a way to make money by doing this, someone would have come up with it already.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#6
If you can get this to work, it could be quite lucrative. Good luck!

I don't have any programming skills to help you out unfortunately, but I would have thought if there was a way to make money by doing this, someone would have come up with it already.
Favourites tend to win between 30-35% of races. This has remained fairly consistent for as long as racing has been around. Even with the advent of computers with faster and more complex processing abilities favourites win percentage stays the same. Second favourites have the next highest percentage and so on down the line. While over a large data set favourites will lose less money on turnover than outsiders, the average LOT will be whatever the overound or takeout figure is. So as a collective group, punters seem to generally get things reasonably accurate when doing the form. Obviously if you can be more accurate than others then you shpuld be able to turn that loss into a breakeven or a profit situation. I cannot do that so I figure I will use a different approach to what most others take. Hopefully I can find some niche areas that others either haven't found or haven't looked for.
 
Joined
22 Oct 2014
Messages
7,118
Likes
36,857
AFL Club
North Melb.
#7
Given I have been mentioned in this thread I will offer some thoughts.

Firstly I have no formal coding qualifications or training and I am sure there would be members of this site who do, and could offer a much more comprehensive answer that I can. My knowledge basically comes from 30 years of using Microsoft products (Excel and Access) so that is what I know. I have dabbled in some other languages however not enough to offer any type of opinion on them.

Excel has an inbuilt coding language call Visual Basic for Applications (VBA) which I think is a good place to start for a number of reasons.
  • It is accessible (assuming you have Excel)
  • It will teach you how to structure code and understand the sort of commands you need to think about.
  • it is procedural in that it runs lines of codes one after the other and only jumps around if you tell it to.
  • It will give you a good grounding in general coding concepts that would apply in any coding environment.
  • However the kicker is that it has a very useful recording feature which means you don’t have to write the code from scratch. You can simply perform the task you want and the recorder will convert that into the appropriate VBA commands. That will show you the command with the proper syntax and also provides you with a base to start from that you can then modify as required. Even now when I can probably write code from scratch it is still quicker and more efficient for me to use that technique.
In regard to your project specifically I would suggest the following. I would start by just manually downloading all the data (or a sample) from its source. Automating this part is quite tricky so would not waste time initially trying to achieve this. I would focus on setting up the code that manipulates the data in Excel the way you want first. You seemed to suggest the data was already in Excel however if not you should be able to copy and paste.

Finally Excel will struggle if you are using a lots of data so do your experimenting with a subset and only use the full set when you have it working as you wish. There is a limit to the amount of data you can effectively work with in Excel and if you are talking about a volume of data greater than that you could use Access. Microsoft Access is relational database that can handle much larger volumes of data however it would add the need to learn about how to enter and manipulate data into it which is more complex that Excel. Note however it also does also include inbuilt VBA which is similar to Excel.

Happy to assist if you have any specific questions,

Good luck with it.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#8
Thanks Mark. The separation of data I can pretty much handle more or less, it's being able to put say 2 or 3 criteria in and cross check every available combination, but it might also be up to a dozen different criteria which obviously contains enormous amounts of combinations.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#9
Hi doc,
I just want to get a handle on the basics of your idea here.
Are you saying no form, but purely based on betting fluctuations?
That could be fluctuations in the starts leading into this start, and also for this current start.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#10
A little history.
Betting fluctuations are much "purer" now, and were previously more open to manipulation, even in the not so distant past.
Before the current system, of gathering live betting data from more sources (ie. corporates, interstate bookies, and on course), the old sytem was totally reliant on just what was happening on course, where the horse was racing. There were 2 main ways shrewd stables/punters used to manipulate this "flaw" in the system.
Generally the idea was, to not have a single dollar for your horse on course! The most common thing to do, was to send bowlers* up to Sydney (if you were racing in Melbourne), and have them wait until late in the betting, when the price inevitably drifted out, and snap up the good odds in Sydney. The other option, though not quite as lucrative**, was to back your horse with one or more of the larger, illegal SP Bookies.
Now, I can see people saying "Why go to the trouble of having your money in Sydney, when you can just wait for the price to drift in Melbourne, then back it there?". That's a good question, and there are 2 good reasons.
Finding "unknown" bowlers to get your money on, in an efficient manor, would not be easy in your home state. Most bookies know the local bowlers, and would be quick to react. They might be looking for the start of something, if it was a well known stable, with a history of plunges, like Saunders or Smerdon. Once the money came, the price would evaporate quicker than it would interstate. Keep in mind, both Sydney and Melbourne had some HUGE Bookies, holding over $1,000,000 on a race in some cases. That, as far as I know, doesn't happen today, but back in the 80's and 90's I can tell you it did. I worked on course for a rails bookmaker for 13 years, so I have direct experience of what I'm talking about. When the first wave of money came, those bookies would be looking at the official fluctuation screens to see if there was money in Melbourne for the horse. If it hadn't tightened in Melbourne, they would be more likely to let you on. Keep in mind most of this was before Bookies were allowed to have phones on course. It wasn't until the 80's that there were even official fluctuation screens, showing the prices on course. It was in the early 90's they got on course phones for betting. Before those screens, there would be a P.A. announcement every 2 or 3 minutes, telling everyone, including the Bookies, what the official prices currently were on the "home" track.
This leads to the 2nd reason to send your money interstate. Bookies were held to some pretty strict rules, and pretty much still are. There are 2 rules that helped those planning an interstate plunge. First rule, up to 5 mins before the official starting time, Bookies HAD to accept a bet from a punter, wanting to back a horse at SP. Second Rule, and this was the most "juicy" rule for the plungers, Bookies operating on Interstate races had to offer the odds being broadcast as the official prices!!!!! This rule was based on a ridiculous notion, that Interstate Bookies in general couldn't get into more "trouble" with a horse, than those Bookies operating on the "home" course.
Now Bookies had one get out clause, that helped them just a little bit. They were legally allowed to limit a bet, but not refuse a bet. That limit depended where on the course the Bookie was betting. Main rails they had to let the punter get a bet on, to lose the the Bookie $2,000. Off the rail $1,000 and other areas $750. So as an example, you could front a rails Bookie wanting $5,000 on a 10-1 chance ($11 these days), and the Bookie was quite within his rights to say "No, you can have $200 on it". Not many rails Bookies ever cut you to the minimum to my knowledge, but in the example given, it wouldn't be unusual to be cut it to say $2,000 on it, instead of $5,000.

*bowler - a bowler is someone a punter uses to place a bet, so the Bookie doesn't know who is really backing the horse. This is different to a commission agent, as they were still watched closely by the Bookies, but a good bowler was a total unknown.

**Backing with an SP Bookie wasn't as lucrative, because if they got a big bet, they could manipulate the price, even before there were mobile phones. They would have runners (someone whose job it is to get info or put bets on) located at the closest place to the gate to the racecourse that had a phone. A Milk bar, any sort of shop really, or a home. The runner would get a call, and be told "Get $XXXXX on this we've been hit for a fortune". If the runner got the money on, the SP Bookie was sitting on easy street, as it might force the horses odds in, leaving the SP Bookie with the sweet position of having backed the horse at say 10-1, but his money forced the odds into 7-1, which would be the odds the SP Bookie would give to the punter.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#11
Hi doc,
I just want to get a handle on the basics of your idea here.
Are you saying no form, but purely based on betting fluctuations?
That could be fluctuations in the starts leading into this start, and also for this current start.
Yes purely betting flucs. The info contains the highest and lowest prepost prices bet plus the same for inplay prices plus the sp of course. It is Betfair info for UK horse races. I find that with the increased amounts bet on each race it is less likely to give out skewed info if you get my drift.
So basically trying to find patterns in the prepost that combined with the inplay prices may give various signals for betting propositions and the best price to hold out for. Then look at these signals across different tracks/distances/race types to see if it's a general signal or if it can narrowed down even further so as to be more selective. Hope this gives a somewhat clearer picture.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#12
Yes purely betting flucs. The info contains the highest and lowest prepost prices bet plus the same for inplay prices plus the sp of course. It is Betfair info for UK horse races. I find that with the increased amounts bet on each race it is less likely to give out skewed info if you get my drift.
So basically trying to find patterns in the prepost that combined with the inplay prices may give various signals for betting propositions and the best price to hold out for. Then look at these signals across different tracks/distances/race types to see if it's a general signal or if it can narrowed down even further so as to be more selective. Hope this gives a somewhat clearer picture.
It does, thanks.
I could be wrong, but I think the "in play" odds are the odds offered between when the race has actually jumped, until they get past the post. If I'm right, I'm not sure that adds much to your analysis, as it is very reactive, and also limited in it's opportunites to bet, given how short a period of time it represents.
As a general rule of thumb, I have found betfair is an exaggerated mirror of what is happening on course. If a horse has drifted from $9 to $14 on course, you might if you are lucky get $21 or $23 on Betfair. The opposite happens, especially if a horse tightens late. If a horse is $9 into $6 late, you might be lucky to $5.80 on Betfair.

I have wondered once or twice myself, if there is some profitability to be had by range betting on Betfair, compared to the official prices. It would mostly involve betting latish in the market. ie just off the top of my head, adding 50-100% to the official prices, and seeing if you could get that on Betfair. So $16 on a $10 chance, $200 on a $100 chance, $9 on a $6 chance etc.
The basic problem with that plan is, you won't get set on the shorteners too often, but you will be getting set at "the good odds".
The idea would be to then try and Dutch book them as best you can.
I assume you are familiar with both Dutch booking, and how to get smaller than $5 on as a bet on Betfair.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#13
One of the first things i learnt was how to get under the minimum bet on. And yes I am familar with dutching. I usually use a trading software platform which makes things alot easier with setting up potential bets, especially in play, even though I don't think it is actually allowed here in Aus.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#14
I'm not sure my experience would help you too much, doc.
My analyses always were form based filters.
There's a few vagaries that a fluctuations only basis won't cover, and while I'm not saying it is impossible to build a successful model, I do think it will be very difficult.
I wish you luck in your endeavour.
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#15
Thanks Rowsus, managed to get about 8 years data downloaded yesterday, about 676,000 rows. I'm not going to kid myself about how difficult it will be to end up with something profitable. But I am optimistic that I can come up with something that may give me a fighting chance. I will update this thread as I acheive little goals along the way.
 

Rowsus

Statistician
Joined
19 Mar 2012
Messages
28,743
Likes
62,807
AFL Club
Melbourne
#16
Thanks Rowsus, managed to get about 8 years data downloaded yesterday, about 676,000 rows. I'm not going to kid myself about how difficult it will be to end up with something profitable. But I am optimistic that I can come up with something that may give me a fighting chance. I will update this thread as I acheive little goals along the way.
You mentioned something about that British info. Is that where you'll be betting, or are you hoping to translate it to Aus racing?
 
Joined
8 Feb 2013
Messages
5,569
Likes
9,528
AFL Club
Hawthorn
#17
British racing. Alot more money traded even on the worst races. The end game is to place triggers for bets to be placed when certain conditions are met, by using a bot. But that is a long way off yet.
 
Top