Category Archives: Automated betting

Trading mistakes

In reply to this post by Betfair Pro Trader, here are some mistakes I’ve made (I’ll keep it to trading else this could be quite long).

When I first started manual trading, there were the usual mistakes, jumping in after the move, trading just to be “in”, letting losers run, going in-play and the rest. My greatest (most costly) mistake was, after slowly building a decent bank, thinking that there must be something to the in-play markets. So off I went, both feet and brilliant, more money in one race than ever before. Then the next race, again big win. This was the way. I was writing my notice to my boss, booking a test drive and browsing the Seychelles. Next up, crash bang broke. How did I let this happen? Well, like Homer retrieving cans from a power line, surely doing the same thing again will result differently. It didn’t. After not making it to in-play millionaire status I returned to the less violent arena of pre-off trading, where I still dwell. The move to automation was due to an interest in coding, lack of time during the trading period and an idea that it would produce better consistency.

The mistakes in automation have been less costly. Usually due to rushing code into service or, early on in this adventure, making changes after only a few results. The way for me now is to code efficiently, test thoroughly and implement in stages. No rush for the long term.

There’s an easier way

When I download the bet history from Betfair, the “Bet placed” data is only to the minute and I need to know to the second to have any chance of matching up with the bet entry data. This is why I’ve been testing some new code trying to handle the MyBets data which seems to come in different on each update. It’s recording some rows of data multiple times which I can’t figure out but am sure is due to the jumbled nature in which it’s received.

But then, that little voice reminded me that when I view bets on my mobile, it does include the second it was placed. So I had a look at Betfair, again, and there it is, in My bets. Easily downloadable and workable.

This is how I was getting data from Bet History –

BetHistory mins

 

And this is how it comes from My bets, a bit more accurate –

BetHistory secs

 

I’ll try matching this with my bet entry data, only problem I can see is Betfair’s time and my time being different but I might be able to offset it. Something for another day now.

 

Week ending 15-05-16

The UK dogs are continuing on as previous weeks. The P&L isn’t rising with Traded Volume, suggesting  improvements in other areas are needed to bring greater return.

160515week

A nice chart from Aus markets with no great losses.

Aus160515week

The US bot is still missing most markets but I haven’t managed to included a start time update yet. I’m not sure my current method of scraping is the most efficient, although if I can get it working in a fashion, it’ll be a start.

US160515week

VPS – a guide

Tony asked about where to start with a VPS so I thought I’d do a short guide to getting the set-up I have.

Here are  some previous blog posts on the subject-

VPS – includes Mike’s contribution

VPS active – My initial VPS package and MSOffice

Api delay testing – The improvements measured

From VPS to Cloud Hosting – Another step forward

To get the cloud VPS, go to Tagadab and choose what spec you want by moving the slides This is what I selected –

VPS slides

Then on the next page, I choose Windows server 2012. I don’t know what the difference is between 2008 and 2012 but 2012 sounds better to me. There are some other options on the page but I didn’t select any. This gives a monthly price of £15 including VAT.

VPS choice

Click on the “Create Virtual” button and on the next page, check everything and click “buy”. You’ll get the emails telling you they’re on with it and then one telling you it’s ready. My VPS took about 15 mins to be ready, on a bank holiday. Log into your account on-line and click on your server icon –

Cloud panel

Then click on the green connect tab –

VPS connect tab

In the pop-up you can download the RDP file which makes connecting to your server a doddle. This puts an icon on your desktop. Just open it like any other icon and away you go.

You can open IE to download apps. Files can be transferred by simple copy/paste as the clipboard is shared between your PC and the VPS

Here’s a short video of connecting to the VPS Opening VPS from desktop. Hope this helps.

Code cleaning

My intention was to improve data collection but as I struggled along, I decided  there needed to be some housekeeping.

Ever since moving all the calculations to VBA I’ve been unable to view any sheets other than Sheet1  whilst running, as the code contained a series of sheet.select lines. This was done initially to overcome lazy referencing.

So where I had Cells(10, 1), I now have Worksheets(“Sheet1”).Cells(10, 1).

I’ve also got rid of some sheet.select-copy-sheet.select-paste-sheet.select routines by simply using full references.

Although this has taken a bit of time and testing, it will result in faster code execution.

 

Week Ending 08-05-16

Greyhounds traded ok but I would prefer a more consistent trend than that in the chart.

160508week

Aus horses were looking like a flat return until a late boost ended the week with a positive result.

Aus160508week

First week of US horses has seen a loss but nothing too concerning for now. The main issue is the lack of activity but this is more down to the way the US markets drift away from the start time as reported by Betfair. I’m seeing most activity early on in the racing day when the post times are still close to reality. I’ve been given a good site for start times (https://classic.ebetusa.com/racing_menus/next-race.html) that drops into excel really easy but I’m trying to figure out the best way to use this info with my bot.

US160508week

Week ending 01-05-16

Here are Oscar’s charts. The dogs have done well to return 0.079% with volume increased by over 2.5x since January. I want to start adjusting stake to matched volume as I think the effect of it’s current size on smaller markets is negative. I’ve only looked at a few examples so far, so more investigation is required.

The Aus chart is pleasing with a good return. This is in line with expectation after the percentage stake effect I mentioned last week.

160501weekAus160501week

(Sorry for chart quality, I’ve been playing around with settings. I’ll try again next time.)

Bot name

I’ve been working on a few things recently, my own vb bot and my betting bot (bot3). To make it easier to reference each bot in the blog, I think it’s time to give them names. So the first one to get a name is my old faithful scalping bot, previously referred to as my bot or Bot 1.

I name thee – Oscar.

Oscar (Original SCalping Algorithm Robot) is currently working emotionless and uninterrupted in a cloud.

Week ending 24-04-16

Last week’s charts both end positive. The UK dogs is still going good, the last week in loss was back at the beginning of January.

The Aus markets traded to a profit since being flat (excluding errors) for a month. I’d previously set the Aus stake to £2 to avoid the turnover charge and was thinking that using the same stake may make my bot stand out. Or I may be paranoid. Well I changed it to a percent of bank earlier in the week, so the stake is different most races, if only by a penny or two. I hoped this would provide some cover from bot stalkers/baiters. The proof isn’t here yet but it hasn’t had an immediate negative effect.

160424weekAus160424week