All posts by trader247

Zero sum

I just downloaded some collected data from my VPS and thought I’d see how it compared to the Betfair Betting History. Coincidentally, the P&L since running on the VPS is zero, exactly. That’s after 11,500 bets settled across 2200 markets. I’ve only made very minor adjustments so far as I’m more interested in the amount of data I’m collecting – the more the better. Anyway, the data and betting history are well matched. Some discrepancies in the cancelled bets but this appears to be in how I’m capturing the greening trades, which doesn’t always include the sub ┬ú2 bets. It’s the bet modification that misses but I can code for this just in the greening procedure, so the fix shouldn’t be much and won’t impact the trading code.


Longing to be an integer.

Here’s an interesting fact from Microsoft –

VBA converts all integer values to type Long, even if they’re declared as type Integer. So there’s no longer a performance advantage to using Integer variables; in fact, Long variables may be slightly faster because VBA does not have to convert them.

It’s taken from here –


With thanks to this answer for pointing it out –


Although the size of my code has increased, I still don’t think it’s very big, so any speed increase may be minimal. However, as I now know about this, and having spent time previously reviewing all declarations and changing to the smallest (least bits), I feel the need to go through the code and replace any integer declarations to long. Bring on the errors.

VPS set up

I’ve done posts about this before but as a refresher/update, here’s another.

I’ve set up a cloud VPS with Tagadab, now branded as Simply Cloud. I chose the basic settings – 1GB ram, 1 core, 20GB storage – and selected Windows 2019 Server as the operating system, which looks and acts like Windows 10.

It was up and running in around 15 mins so I started adding some apps. I installed Gruss, Dimension4 and ms office. The office install is free to download but only comes with a trial license. You can search the internet for trial keys that supposedly allow you to continue using for free but sounds a bit iffy, especially as you’d have to keep remembering to add them. I used a key i got online for around a tenner, which I’d used on a Windows tablet but no longer needed, and it worked fine on the vps by creating a new ms account on setup.

Within a couple of days I noticed how slowly the VPS was running. I cracked open the task manager and found sdxhelper was using all available ram, keeping it at 100%. Googled it and it’s a known issue. Best solution for me was to end the task and rename the sdxhelper.exe file. Only problem with this is that if I restart the server, Windows helpfully repairs itself and puts a new copy of sdxhelper.exe in the associated folder. A quick rename is the fix though.

Another way to reduce ram usage is to restore down both Gruss and Excel, with the Excel window then stretched down to is smallest size. This works better than minimising the windows, as can be seen when viewing the task manager. I assume this is because on the VPS, the ram is also used for graphics, whereas on my pc/laptop there’s a separate graphics processor.

Back in the market

I lasted about a year before I started playing with the bot code again. I did some live testing from home before Christmas and then started a VPS a couple of weeks back. No big shocks so far, only a few stops due to coding errors but these were to do with market navigation, not during trading, so no half trades. The bot’s been running constantly for the past week, usefully collecting data.

I’m hoping to drop the odd blog post as I go along but won’t be regularly posting results, unless it’s massive profits ­čĄĹ (don’t expect any results).

Moving on.

I stopped trading last year after seeing the small profits disappear and not spending any time with the bot. My interest is in programming and as I moved from VBA to .NET and the wonders of Visual Studio, I was more interested in app development than raking over market data.

I decided to stop the bot and shut down the VPS, pointless spending money on something I no longer enjoyed.

Thanks to all those who visited and contributed to this site.

Happy trading and keep it fun ­čÖé

What’s going on?

[I started this post last week and now I think I’ve solved the problem, but as I’ve written it, you can read it. solution at bottom.]

Over the past two weeks, Oscar, my UK dogs bot, has had six markets failing to trade out or green up. After the first two, I stopped for two days whilst I got round to checking the code but everything was fine, as it should be as I hadn’t changed anything. I restarted and after another few days of trading ok, it happened again, so it’s now stopped. I can’t see anything particular about the markets it’s happening on, and the connection from my VPS appears good. I’m now thinking of adding some extra code to record more details in hope of catching what’s going on.

I’m less narked than you may think as the result so far is I’m up ┬ú40 from the errors. But obviously I can’t let it carry on.

In other news, I’ve been reading. A challenging task for someone who flits from one thing to another. Anyway, this had lead to some really good coding sessions (from my point of view) but nothing live yet, only recording and paper trading.

I put quite a bit of time into code that aims to measure the chance of being matched after a trigger is reached and over what period that match would take place. Recording price movement is pretty easy and amount matched over a short period in one direction is also simple. But tracking price, piq and amount matched if the price moves against and then returns, then goes positive, before returning against, is a job for good code. (I’ve not had it marked yet, so no conclusions.)

And I’ve just put on test some code for showing which runner has won on inplay markets. My aim is to know the winner straight away and not have to have a separate process. I have some old code that would take my bets sheet (paper trades) and check it against the RP results page (by runner) after all the races were finished but it requires random fettling to keep up with the website changes. I haven’t used it for some time. It also only happened once a day. My new code works with obvious winners, reaching and staying at 1.01, but then handles close calls individually, with unknowns highlighted for my attention at the moment (this still requires input from me but I’m not checking through every market). I get a rolling update from this.

Inplay is not something I’ve botted with any interest before. But a post on the Gruss forum caught my attention. It regards a simple strategy shown in a YouTube video. It got my interest in the inplay side of things. Rather than throwing bets in and seeing what happens, I thought I’d approach this with a plan and code my way to results rather than bet my way there. If the testing comes to nothing, no waste, I’ve got some cracking reusable code.

[SOLVED, I think]

As mentioned at the top, I think I’ve found the problem.

It’s a time issue. My server clock was 33.7 seconds behind. You can find this out by going to the website – (My laptop is 0.8s out.) UK dogs are quite sharp with suspending, 30secs+ could easily miss my greening period.

A simple fix? No. Why would it be? Multiple tries at pointing my desktop clock to various internet ntp clocks resulted in a 0.1 second increase in error (huh). I Googled around and found an article on Dimension 4. Downloaded it. This took a few attempts with different servers and then bingo! Back to for an exact result. Bot restarted. Time will tell (time, it’s a time pun, ha ha).


Outsourcing theft

Seamus asked –

How does using a VPS affect your risk of hackers stealing your strategies?

The main risk from using a VPS is not from hackers but from an insider ie an┬á employee of the VPS provider. Some random could target the VPS provider but I’d guess there’s more valuable data than my penny bot.

There are steps to take to improve security. Google “setting up a VPS” for some tips. Also password protect excel code. This is weak but combined with an event handler that clears certain settings on close and open events would render the bot useless. As with all things, if someone really wants it they’ll get it, whether that’s hacking your home pc, your VPS or smashing your back door in and legging it with your computer.

If you’ve got a very profitable bot then I don’t see any need to move to a VPS, you’re already winning. If, like me, your main point when people ask “how’s the betting going?” is to say “well, I don’t lose”, then move to a vps, save money on the electric bill and have less connection-loss, enjoy the feeling of playing in the big league and don’t worry about someone twoc-ing your ok bot.