close Lefora Announcement: We recently turned back on the 'Send Invites' link in the userbar. New features include the ability to hook directly into your Hotmail, Yahoo, or Gmail accounts. Click here.

denp's Blog

Male, 42, NC, US
Member For: 5 months, 1 week
Posts: 12

Member of: Diybetfairbots Forum.
Top Post By denp (most thumbs up):

No posts received thumbs up, next time you see a good one, give some respect and thumb it up.

Recent Posts by denp:

Re: Scraping....

November 19, 2008 by denp

i use python for this kind of stuff, with the SGMLParser. Some easy examples at http://www.boddie.org.uk/python/HTML.html. Python seems to be the preferred scripting language on ubuntu. Get eclipse and pydev. Or IPython is a pretty neat shell with auto complete, command history, persistent environment variables between shells etc.

Not sure what the DIY tools parallel is for python. Perhaps myrddin can help out.

Re: Finding the optimum odds to close a position.

November 18, 2008 by denp

i think, as with the constipated mathematician, you need to work it out with a pencil :-)

I did this a while back, and it went along these lines. Assuming two runners, profit of p1 for runner 1 winning, stake of s1 on runner 1, at odds1 etc, and backing only (cos it's simpler for the example) you can say:

p1 = s1 * (odds1 - 1) - s2 winnings if runner 1 wins
p2 = s2 * (odds2 - 1) - s1

To green up, p1 = p2 ==>
s1 * (odds1 - 1) - s2 = s2 * (odds2 - 1) - s1

s1 * odds1 = s2 * odds2

given you have s1, odds1, odds2 you work out s2.

So it gets a bit more complicated when you want to lay instead. But i think it follows through much the same way.

Or am i teaching you grandmothers to suck eggs here?

pip calculator

November 15, 2008 by denp

here's one for the community library. If you need to place a bet one tick away, or "n" ticks away from the current price, this will let you do it, dealing with all the boundary conditions. See the test cases for example use.

Re: [JAVA] parsing GetMarketPricesCompressed

November 11, 2008 by denp

awwww shucks

Re: Interesting blogs and sites

September 4, 2008 by denp

still haven't got the hang of this interweb thingy

http://www.econ.ox.ac.uk/students/james.reade/MarketEfficiencyPaper.pdf

Re: Interesting blogs and sites

September 4, 2008 by denp

Here's another one that might be of interest - some academics have been looking betfair too:
http://users.ox.ac.uk/%7Eball1647/Goal%20Arrival.pdf
This paper looks at market efficiency in soccer betting - trying to see whether the impact of a goal being scored is absorbed immediately.
Not sure there's anything astonishing in here, but worth a quick read. But I don't know why the drift towards 1.0 of the current score (as being the final result) over time is less than obvious to the academic community.

Re: regexes for parsing compressed strings

August 9, 2008 by denp

ahh... called my bluff. Can't say I'm any kind of regex expert. I know they are useful and can be a very fast way of parsing strings. I generally arrive at the right combination of squiggles more through trial and error than any kind of intelligent design.

This one is made of two parts. The requirement is to split the markets string on the ":" character, except where it has been prefixed with a backslash indicating it has been escaped. You find this sometimes in times or other uses of the ":". So the part in brackets is (with enough slashes to convince the java compiler) known as a "Zero-width negative lookbehind", for a single backslash in this case. This ensures a match is only made if the ":" doesn't have a slash before it. See http://www.regular-expressions.info/refadv.html for a more accurate description.

Re: New Cross-Matching Logic on Betfair

July 16, 2008 by denp

but as I understand these new matching algorithms, there's no direct profit in it for betfair; they are reducing the risk by ensuring punters get the best price available. This should reduce average spread and hence increase the competitiveness of their product... and potentially increase profits through higher volumes.

i would expect to see betfair introduce changes that drive profits - however they need to do that. High-volume, low-profit per bet bots don't drive profits, so arguably discouraging them is nothing for betfair to worry about. You could argue that the bots add liquidity and that is a good thing, i guess.

Re: New Cross-Matching Logic on Betfair

July 16, 2008 by denp

they don't seem to have turned it on yet - tennis and football markets are still showing over 100% lays and under 100% backs.

I would think applying it to markets with a lot of runners could impact their performance. Presumably they'll need to do this transactionally - unless they can replicate the odds of a single bet with a complete set of "other side" bets on the other runners, you wouldn't get a complete bet for the original user. To do this they'll have to lock the market while they match. I don't think anything they've got currently would require a market-level lock, only runner-level locks.

Re: regexes for parsing compressed strings

July 6, 2008 by denp

the web page removed half the slashes
so once more:

(?<!\\):

"(?<!\\\\):" if you want it in java.

regexes for parsing compressed strings

July 6, 2008 by denp

Here's one for splitting the markets from GetAllMarkets api:
(?<!\):

or
"(?<!\\):" if you want it in java.

(?<!\) is a lookback to not split based on \:

Re: Java

June 15, 2008 by denp

I use java and python, but run my analysis and plotting using python and trading with java. They're both really neat languages.

matplotlib, numpy and scipy give a lot of plotting and statistical functions for python and pydev gives you a neat coding/debugger in eclipse. If I'd seen your python/betfair examples 6 months ago I'd probably be using python for trading too.