Binary Ladder

Example spreadsheets and comments on example spreadsheets.
Posts: 340
Joined: Wed Apr 15, 2009 11:00 pm

Fri Jul 07, 2017 2:05 pm

If he no longer visits it doesn't matter.

Posts: 14
Joined: Sat Jan 16, 2016 1:21 pm

Sun Jul 09, 2017 10:11 pm

Just looked at this sheet again and realised that it doesn't really show you anything more than the normal spreadsheet. I mistakenly thought they had managed to pull in all the available money on all prices. Does anyone know if Bet Angel plan to add to the existing Excel integration in the future so that all price info is available?

User avatar
Posts: 163
Joined: Sat Jul 30, 2016 8:29 pm

Wed Aug 30, 2017 5:54 pm

Yeah, it's misleading, it just shows queued money not the matched money at each price.

I did write a method a while back which is able to show matched money at individual prices. The results were indicative but not 100% accurate partly due to limitations in spreadsheet update speed but also peeps pulling money from queues.

I found using LTP was misleading, so my method compared how the queued money change vs. total matched against the runner. There are some things you have to consider though. First of you have to normalise the matched amount by dividing it by 2, this is because betfair show the UK horse market (for example) £50 matched as £100 matched because it calculates money matched on both sides of the ladders.

So then you look at the absolute difference between normalised money matched vs. how much the queue degraded on both sides. Whichever comparison has an absolute difference of 0 (or pseudo 0) then that's where the money went.

The below code is a small snippet of my function to give you an idea what i am talking about. There are 4 variations:Back (price didn't change),Back (price changed), Lay (price didn't change) and Lay (price changed).

iNormalisedAmount = (iCurrentAmount - iOldAmount) / 2

'Compare existing queue money with amount increase
iBackAmountDiff = iOldBackAmount - iNormalisedAmount
iLayAmountDiff = iOldLayAmount - iNormalisedAmount

iMatchedDirection(0) = Abs(iOldBackAmount - iNormalisedAmount)
iMatchedDirection(1) = Abs(iBackAmountDiff - Me.Cells(10, 7))

iMatchedDirection(2) = Abs(iOldLayAmount - iNormalisedAmount)
iMatchedDirection(3) = Abs(iLayAmountDiff - Me.Cells(10, 8))

'Find the direction matched
iClosestMatch = Application.WorksheetFunction.Small(iMatchedDirection, 1)

'allow for small variation from normalistion process.
If iClosestMatch <= 1 Then

If iClosestMatch = iMatchedDirection(0) Or iClosestMatch = iMatchedDirection(1) Then
'Show as back activity increase
ElseIf iClosestMatch = iMatchedDirection(2) Or iClosestMatch = iMatchedDirection(3) Then
'Show as lay activity increase
End If
End If

User avatar
Posts: 163
Joined: Sat Jul 30, 2016 8:29 pm

Thu Aug 31, 2017 3:12 pm

Ok i may have a 100% solution for this, but I would need to do some API research. I was looking at something unrelated today when i came across a topic on a programming forum whereby peeps were talking about extracting data from other application objects. I'll need to look into this, but if possible, I could extract the data from the ladder which means i can show the matched bets in excel just the same way its shown in BA.

Posts: 71
Joined: Thu Oct 06, 2016 12:04 pm

Mon Sep 04, 2017 10:55 pm

Hi Peter,

I for one would be very interested!

Best regards,

User avatar
Posts: 163
Joined: Sat Jul 30, 2016 8:29 pm

Sun Sep 10, 2017 12:19 am

This is a bit tricky.
Using WinSpy++ I was able to get the window handle for the ladder and the objects within it.
After converting the handle from hex to decimal, I was able to retrieve string lengths from the ladder using the SendMessage function, however, when using the same function to grab the actual text, Excel would crash.
I'll play with it some more.

User avatar
Posts: 163
Joined: Sat Jul 30, 2016 8:29 pm

Sun Sep 10, 2017 12:23 am

Ok it seems the crashing is related to buffer memory allocation when hooking into external app. Quite tricky to solve, although VirtualAllocEx function seems the answer. Ill have to come back to this another time.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: topfour and 2 guests