Track Topic
: rss

Topic: Bot-Writing Experiences

posts 1–20 of 32 newer >
Page 1 · 2
?
62 posts

I guess it's just natural nosiness, but I'd be interested to know what got other people into writing bots, what experiences they've had etc.  I'm not asking anyone to give away their secrets - just a bit of background info.  I'll get the ball rolling myself.

Getting Started

A year ago, I knew very little about betting, and nothing about bots.  Somehow I stumbled across Betfair, and was impressed by the number of football markets they had.  In particular I got interested in the Total Goals market.  Because it had prices for each number of goals, and commission was only 1% at that point, and total goals follows a Poisson distribution reaosonably closely, it seemed to me possible that there could be opportunities for statistical arbitrage between different selections in the market.

Shortly after that I learnt there was a free API, and the idea of writing a bot became obvious.  Googled to see what information I could find, and found the fred77 site, which had extremely useful sample code in PHP5.  I already knew PHP - I built a simple CMS in PHP for my wife's website business - so I was away.

Early Experiences

My first bot was cobbled together in a few weeks as a fairly unstructured piece of PHP code.  I wrote it quickly because to be honest I thought it probably wouldn't work.  Markets are supposed to be efficient, so the idea a simple program could consistently earn money seemed a bit daft.  In fact I codenamed my first algorithm (the Total Goals one) 'Snowflake' because I genuinely thought it had a snowflake in hell's chance of working.

I ran that simple bot for a couple of months late last year (2007), and to my surprise it did seem to work.  It was actually implementing two algorithms: Snowflake (which made £200 from a £400 bank in a couple of months) and another one (which I won't describe here) which made very small but very consistent profits.  It was all very exciting, and even when BF just increased the commission on Total Goals from 1% to 5%, it didn't seem to have too big an impact.

I stopped running it after a couple of months because it was full of bugs that were going to be too difficult to fix.  The bugs meant you really had to be there while it was running (or at least check it every couple of hours) to correct any stupid mistakes it had made.  And the fact I'd cobbled it together as an unstructured pile of s**t made changes increasingly difficult.  For a while I ignored these problems and just carried on running it, but then I lost £30 due to a stupid error it made (not a lot of money I know but it meant a week's profit gone in an instant).

I decided it was time to put v0.1 of my bot out to pasture, and start writing the new improved v0.2.

(to be continued)

 

?
47 posts

Hi JPL,

Similar background. I do alot of coding in my spare time, all open-source stufg, [livecds, morphix, debian]. I also dabble a bit on betfair at gambling and trading. As well as playing online Poker.

As part of another project (http://mbuild.livecd.org) I had to write some python code. reading the old fred77 site I found a python library for using the free api. so decided it was time to learn python and have fun with a betfair bot.

I did laugh when I read your comment about coding mistakes. It is annoying when coding mistake now cost real money. I can leave the bot now un-supervised. I am also re-writing my bot as version 2!

Currently showing a few percentage profit on stake - excluding coding mistakes. Not sure what will happens after today when the English Premiership finishes.

Does everyone have seperate accounts for their bots ?
Does anyone more than one bot ?
Is the paid-access value for money ?

BMS

?
70 posts

Hi Guys ....

Been on betfair since the early days ... and using the api since its launch.
Built a database (use mysql) and an infrastructure wrapper around the API. Did a lot of data capture for a year or so and then lots of analysis.
Started gently on the bots and have been ramping up ever since.
Now have several bots betting on many markets ... ticking along nicely ... at 2% commission.
Also got a nice custom GUI interface ...

Difficult to say if the paid access API is value for money really. I've been paying all along because I got into this way before they introduced the free access. The throttle restrictions on some of the calls would scupper me now anyway. They say you're paying for 'support' but not really had much from them to be fair ... you're basically paying to get rid of the throttling.

AP.

?
31 posts

Hi,

I'm still working on my first bot - it's taking a while... I wish I had got more done before my baby daughter arrived, as there are definitely fewer hours in the week for this now!

I started with the Gruss program and Excel, with the trading brain in C# managed code linked to Excel by VSTO, which lets me record events and test strategies in simulation or real time. Haven't completed bet placement in that system yet, as I've now moved on to a pure C# program with a SQL Server database - should have recording and playback sussed soon, and can then resume testing my strategies. One of my strategies relies on timely traded volume data, hence the move away from Gruss. I hope this is a good idea, as it's a lot of work to start from scratch, and the Gruss codebase has the advantage of being thoroughly tested by a large community - not sure how I can ensure the same level of quality in my own code!

I'm definitely in it for the intellect pursuit as well as the potential profits, but not for the gambling aspect. About the only thing I bet on manually is the Tour de France, where I've done very well out of the freak events around Landis and Rasmussen in the last couple of years. I do some manual horse racing trading when testing new systems. I find it relatively easy to be profitable, but not to the extent that it's worth sitting there. I've got 14 years in financial IT, and so a high level of confidence that I can automate something I can do manually, but very little programming in the last 7 or 8 years, which I regret, and so this is also me getting the programming back up to speed.

The aim is definitely to have something I can run as an HA app at a datacentre, contacting me (e.g. by SMS) each time a market settles!

Cheers,

Pete.

?
62 posts

Pete - like you I used to program professionally some years ago. I think if I'm honest part of the attraction of writing a bot is that it's quite nostalgic in that respect - a return to simpler days.

I wish you luck finding time to code with your new daughter to look after. Mine are six and eight now, but I remember those early years being a bit crazy.

?
31 posts

I know what you mean. But it only feels like a simpler way of life until you do it and remember that you need big chunks of uninterrupted concentration, which can be hard to come by!

?
91 posts

How did I get started mmmm, it's all a bit of a blur now, I commit lots of gambling sins, the main one being not keeping any records! I'm not a professional programmer and just get by the best I can. I've had an off/on interest in gambling since I was a teenager. I think my first brainwave that got me into it was a staking system I thought up, it turned out to already be a well known system though, the martingale ! Using BASIC programs I soon learned how futile that was.

First thing to cost me money was probably Clive Holt's fineform, late 80s or early 90s I think, I wrote a program that allowed me to type in details from my growing pile of racing posts. I then used (what I now know as) backfitting to "improve" the fineform formula and proceeded to place bets with a bookmaker via the telephone. Needless to say, it went horribly wrong.

A couple of years later I took time off work to look at it again, and it went badly wrong again. Later I tried another variation and then in desperation I did something really daft - I subscribed to a telephone tipster...

Anyways, several thousand pounds later, I threw away all my racing and gambling books, binned my racing posts, I destroyed my data (even the backup copies) that I'd spent months typing in - No way was I ever going to be tempted to try gambling again!

My next programming interest came about from discovering the internet. After making a homepage I soon felt the need to have interactive bits on it. I'm not quite sure how I settled upon choosing PHP but glad I did. I learned PHP and made a simple guestbook, followed by chatrooms, over a couple of years these were joined by games and a forum. All simple stuff but done DIY.

I can't remember how I got back into gambling. I started placing bets on football, "just 3 outcomes, must be easier than horses!" Knowing nothing about football, by choosing specific odds and playing every match available with a bookmaker I broke even for some time. I then read about betfair so I registered and started playing my football bets there. I hadn't investigated thoroughly so it'd be no surprise if I was taking worse value than using the bookmaker! That fizzled out after my money was gone. 6 months later I got the bug again, I further explored this betfair site, intimidating place it was with a bizarre twilight underworld called the forum. Then it happened... I found the API, and yes, it was accessible using the language I knew.

I found some example PHP code on the bdp website, at first it didn't make much sense but once I started experimenting (very easy with a scripted language) things became much clearer. My first simple bot acquired win horse markets when they became available and placed lays at 1.01.

?
91 posts

While doing some backup work last night I unearthed one of my first bots, vintage 2006. Virtually unreadable as that was before I learned to indent code. I was thinking I'd give it a blast just for fun, until I realised it was for API v4 and I didn't even have the MySQL tables to go with it.

I don't know if it's something to do with the way I write or what (too much copy and paste perhaps) but all my bots look the same, they all revolve around similar MySQL tables, and just, well, they seem boring and non-dynamic. They're missing a secret ingredient, something beyond comprehension such as machine built artificial intelligence. Looking at that first bot I made it was actually placing random stakes at random prices - stupid or fighting random with random?

?
70 posts

Are you serious? ... betting random stakes at random prices ... was this on random selections in random events? :-)
What were you trying to achieve? Even at 2% commission eventually you'll get eaten doing that surely...

Can't say I've ever tried to fight random with random ... if of course we are fighting against random??

My first bot wasn't great though and probably may as well have been random! ... i think it was a pathetic attempt to trade on soccer win markets. It's certainly been decommissioned for a long time now!

For me, some early important lessons learned:

* be structured, use version control, regular refactoring
* separate development and production environments
* track and monitor everything

?
91 posts

Ok, I was exaggerating, it was more like random weighting of stakes and prices linked to prices on horse markets, it sort of broke even if memory serves (doubtful!)

I think it's fairly obvious that we all come to bot writing from different angles (I had to google refactoring to see what that meant), there's loads of things I should do - but to me playing with bots is still gambling and I find it hard taking things too seriously.

?
62 posts

Obviously everyone has to find a way of working they're comfortable with. I have to admit I'm generally guilty of putting a new algorithm into live and running it on small stakes without much testing. Life's too short to do a lot of very structured testing on what is (for me at any rate) just a hobby. I do make a big effort to document everything quite carefully though (design specs, user guides) because otherwise I find I forget how it all works.

This evening I've been running some reports on the year's betting to date, and was rather shocked to find my net profit was almost zero. I've lost almost all the money my bot made on ill-considered manual bets (e.g. I lost quite a lot because I couldn't believe London would when it came to it elect Boris). So I think the lesson is clear - it's bots and algorithms only from now on. I'm just too c**p at manually judging probabilities for betting the old-fashioned way to be worthwhile.

?
47 posts

Off Topic: I also could not believe London would elect Boris. That why you I took out "Insurance" :)

?
91 posts

I have to admit I'm generally guilty of putting a new algorithm into live and running it on small stakes without much testing.

I've always done that (sometimes not even small stakes either) and most likely will continue to do so. Basically I don't believe test scenarios with recordings etc EVER match real life on the exchanges. Trading wise, I think once you have a fair idea of what works and what doesn't you can blunder in without it being a big risk, safe in the knowledge that things will even out whatever. I stuck £200 into betdaq the other day, fired up my bot after 10 minutes of coding a quick strategy, it is now £400. But that brings me on to another point I've learned, any strategy that seems to make lots is usually capable of losing lots too - so it will be no surprise whatsoever to me if that £400 is £50 by the end of tomorrow!

?
70 posts

Was it you fred who used the term 'botting pro' on the regular betfair forum?

?
91 posts

Yes indeed, I used it as a fun reference. I still fully intend to bludgeon my way into the ranks of betfair's finest pro bot ops ;p (positive thinking and all that!)

?
128 posts

There you are you buggers!!! :o)

?
91 posts

Yes a new secret hangout, despite what I said before I couldn't resist joining, I think I missed the old place just as much as everyone else.

?
29 posts

It's like some AA meeting with no one wanting to reveal too much

?
70 posts

Birch ... I've just read your website ... LMAO ...

"potential customers who are not really sure what they want"
"customers who expect to pay £20 for a week long project"
etc.

... LMAO ...

I think we need a thread on here to 'discuss' some of the more ridiculous requests that come up on the FAD site :)

?
128 posts

Yes, i missed the discussions as well, although i'm not really doing much botting of late because the bot i wrote before christmas is still chugging along nicely. I've updated it to scrape the "new" JSON pages and done a couple of small tweaks/bug fixes but the bet trigger function is almost identical to the 40-liner i wrote last November. Overall profit is around £800 to minimum stakes which is not very exciting but it's averaging a gnat's willy over 5% ROI which is reasonable. Latest mod was to change the stakes so that i aim for a "target" % of bank which means that a) stakes increase as the bank grows and b) the odds are used to calculate the final stake.

Lost £70 today (so far) but won £90 yesterday so it's simply a case of the good outweighing the bad in the long run. 7 day profit as of now is £94. Incidentally, i'm a LOT more patient now which is good because i ran for about a month where i lost best part of £200 of my profit but that got recovered in 4 day golden spell.

As you can see, i decided to sell my skills and bought myself a disposable website. Had a LOT of enquiries and was getting about 50 hits a day, of which i was getting about 3 or 4 enquiries. I completed about a dozen decent projects but the time spent finalizing the specifications and then dealing with after-thoughts when i was 90% complete really annoyed me and i averaged about 50hrs on a £100 project. Funniest enquiry of all simply read: "please send me winning bot. i will pay you £20"....hence the reminder on my website. :o)

posts 1–20 of 32 newer >
Page 1 · 2

This Topic Is Locked To Guest Posts

It's been a while since this topic was active, if you'd like to get it going again, please post as a registered member

join now