Tag Archives: VPS

Streaming and NSW

Mike left a comment on the previous post –

Always good to follow your progress. I’ve been trialing the new Gruss at home but have yet to let it loose with my Bots on my VPS. You say; “To note, the charts on the VPS are showing lower times than those at home” I’m reading that to mean “faster” times not “slower” times. What’s the bandwidth usage like with multiple sheets running?

As for the NSW markets, if you lay first it is theoretically possible to close out/green/red up your trade by laying out the other runners across the field, thereby not placing any back bets and avoiding the turnover charge. Albeit more complicated mathematics and process and it may not suit your trading style, but it is an option.

Thanks for the comment.

You are right, I meant faster times. Below is an image showing the charts whilst streaming from the VPS and from home, both monitoring same event at same time. Although the scales are different, I’ve added 100, 200 and 300 increments to highlight the difference. The VPS is generally lower times, faster, but more importantly, the consistency is better. For example, the VPS chart has 1 refresh greater than 300ms for this period, whereas at home I see 12 occasions of greater than 300ms.

gruss_stream11

In this next image I’ve tried to match the timings. Interestingly it looks like the home refresh is sometimes faster but this is just a consequence of refreshes coming in close after the refreshes that are notably slower (otherwise, if every refresh was slower, the market would drift away behind real time as the delay is compounded – mind boggling).

gruss_stream12

I’m not too sure how best to measure bandwidth in real-time but this is from the resource monitor in Windows Task Manager. This was taken with two sheets open. The first was a UK evening greyhounds with about 40s to off. The other was a US horse race from about 2 mins out (approx £5K matched). 2600 Bit per second is equal to 325 Byte per second (according to Google). Hope this helps, or let me know if there’s a better measure.

vps_bandwidth

Your possible solution to the NSW issue is very much outside the box and an excellent reminder of what we’re doing in the market. If you back one selection, you’re not only backing it, you’re effectively laying every other selection. Using this logic, as you say, it’s possible in theory to trade through the market without having to place a back bet. It does require a market with tight spreads. And also a large enough stake to be able to lay all other selections with as close to calculated values as possible. But it could work. Not likely for me though, off the top of my head, my initial stakes would be too low. I like the thinking though.

A comment, an icon, rounding and an offer.

US Horse Racing Off Times have been a problem for bot developers since the year dot. The US off times are just a guide and are not religiously adhered to like the rest of the world. Initially I got around this by polling the Time to Post stat that gives a guide of when the off time is due. This value can be scraped from a number of different sites. Even this was a little hit and miss. What I eventually landed on was waiting till the overround was less than 105% to indicate that the race was about to go off. Works quite well in sparse US markets where all the money comes in at the end before the off.

Thanks for this comment. I’ve looked into scraping times and have found a few sites. Not made any attempts to integrate yet. The idea of watching the overround is very good and something I hadn’t thought of. This goes on the to-do list, thanks.

 

 

I’ve been coding an app in Visual Studio to replicate a spreadsheet I’d made when I was doing the matched betting thing. I added an icon and thought I’d add it to this site, so if you haven’t noticed, it should be at the top of the address bar and look like this –

favicon3

I like the simple look, which is fortunate. And it should show up as different to WordPress in any bookmarks, or in the blog roll on green-all-over (It’s been quiet over there recently).

 

The app I’ve made calculates the lay stake at given odds. A problem I encountered whilst testing my little app was a difference between what I calculated and what I was seeing on the Betfair site. It’s only small but at large stakes it’s noticeable and any discrepancies are worrying, suggesting an error in the formula used. My error came down to rounding. Initially I was just rounding the result only to 2dp. Each step of the formula requires rounding to 2dp to keep it accurate. At no point can you place a lay stake of £50.083333. Attention to detail is key, my mistake.

 

Talking of attention to detail, I recieved an offer to try out a VPS in Dublin with less than 3ms delay. That’s extremely fast for sports trading and probably as good as it gets without co-location (something I’m sure goes on). I had looked at getting a Dublin based VPS when I was setting up but was not willing to pay the obvious premium rate. The offer I received came via Twitter and the first thing anyone does is look at the website of the people making the offer. I remember this company was looking for people to trial its VPS about a year ago. Their website still has some pages that haven’t been altered from the template settings – the blurb you get when you start a website from a pre-made layout offered by these site builder outfits. There’s a lot of trust when putting your bots onto a VPS and you want to know you’re in safe hands that pay attention to detail. I declined the offer.

Out of sync

With Oscar running on the VPS, I can view the desktop from my mobile and, with no rush to get out of bed this morning, I had a look to see what was happening. Something was wrong, an error but not costly.

  • System time was 7:34
  • Next race in list was due off at 6:43
  • Countdown timer was at +17 mins (should be -51mins)
  • Transaction log had over 41000 entries and nothing in since 16:30 yesterday
  • Last trades in Betfair history were 3:00 this morning

I don’t know why this happened but am guessing it’s been too long since I last restarted the software. I’ve hit an error before in VBA with having variables declared with too low capacity and not coding to deal with when they’re full. Today’s error was on the Gruss side of the set-up and maybe running for 44 days without stopping is too long and fills a dim. I’d be more sure if the log was at a capacity level but I don’t think there’s any variable limit around 41000.

Action taken – saved transaction log and rebooted Gruss. It’s traded some races over the past hour or so and all seems well again. 

Interesting test results

I’ve been recoding my horse racing form bot (Bot 3), trying to get it to work without errors. It scrapes a lot of data for each race – runner form, jockey form, track data, going, weather. Having got it to a point where it runs okay with me sat in front of it, I decided to run it live on the VPS but without placing bets, allowing performance and data collection checks. To keep things separate I’m running this on Betdaq with a slow refresh and, as I’ve not used it for a while, I’ve added a short section of code to place some pointless bets based on where the market odds are, nothing to do with the bots purpose but hopefully keeps the exchange happy.

The results so far are good and the bot is gathering most of the data without error. Any missing data isn’t causing the bot to stop, however, I’d like it to make multiple attempts to gather it, so some adjustments are needed. The algorithm for choosing a selection to back or lay is operational but requires refining. I’m basically calculating my own ‘betting forecast’ and backing or laying a selection depending on how far away from my suggested odds it is trading.

The interesting part comes from the short bet placement code I added. Of the 12 bets it placed over the five days testing, only 1 of the selections won. Obviously I’d backed them all.

 

My theory for this code was – if I place bets in efficient markets (which I thought close-to-off horse racing markets were), I will likely lose at a rate around my commission (5%) plus half the spread position. Therefore stakes of £0.1 are a small price for testing.

I know the small sample is hardly proof but with average odds of 3, none greater than 3.5 and results at 12, I’m going to keep this little code running to see how it pans out and update the blog on results. It will be interesting to find out if I just happened to drop into the strategy during a 10 long losing streak.

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.