MarketDepth

Please post any questions regarding the program here.

Moderator: 2020vision

MarketDepth

Postby alrodopial » Tue Feb 14, 2012 12:00 pm

I also asked it elsewere but Garry may not have seen it

Can the MarketDepth return the amount available to back/lay at Sp?
Something similar to MarketDepth().prices().backAmountAvailable

If so, how is done or if not, are there any plans to add it ?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby GaryRussell » Tue Feb 14, 2012 3:18 pm

There are two properties available, but may not be quite what you had in mind. They are all that is available from Betfair though.

MarketDepth().prices().totalBSPBackAmountAvailable
MarketDepth().prices().totalBSPLayAmountAvailable

Here is the description of these properties from Betfair's API documentation.

Total BSP Back available amount
The BSP available to back amount. Pre-reconcilation, this field is zero for all prices except 1.01 (for Market on Close bets) and at the limit price for any Limit on Close bets. Post-reconcilation, this field is zero for all prices

Total BSP Lay available amount
The BSP available to lay amount. Pre-reconcilation, this field is zero for all prices except 1000 (for Market on Close bets) and at the limit price for any Limit on Close bets. Post-reconcilation, this field is zero for all prices.

Please make sure you install the latest Beta version from the following link to use these properties. You will have to uninstall and re-install for it to update the COM dll.
http://www.gruss-software.co.uk/Betting ... _Beta2.msi
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby alrodopial » Tue Feb 14, 2012 6:49 pm

Thanks Gary
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby alrodopial » Fri Feb 17, 2012 12:20 pm

The totalBSPLayAmountAvailable is not working.
It returns 0 for all the prices (odds)

I used the GetMarketDepthExample file and I only changed in the code the
backAmountAvailable with totalBSPBackAmountAvailable
and
layAmountAvailable with totalBSPLayAmountAvailable

The totalBSPBackAmountAvailable is working fine but not the totalBSPLayAmountAvailable
The same happened when I changed the Async file

The changed code is
Code: Select all
For j = 0 To UBound(prices)
                                 If prices(j).totalBSPBackAmountAvailable > 0 Then
                                    If prices(j).odds > bestBackPrice Then
                                        bestBackPrice = prices(j).odds
                                        backAmount = prices(j).totalBSPBackAmountAvailable
                                    End If
                                 End If
                                 If prices(j).totalBSPLayAmountAvailable > 0 Then
                                    If prices(j).odds < bestLayPrice Then
                                        bestLayPrice = prices(j).odds
                                        layAmount = prices(j).totalBSPLayAmountAvailable
                                    End If
                                 End If
                            Next


The object 'prices' you create contains the amounts for the backSP odds so I guess it also contains the amounts for the laySP odds.

Can you check it Gary?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby alrodopial » Sun Feb 19, 2012 5:37 pm

I may be doing something wrong but the
totalBSPLayAmountAvailable is always returning zero.

Can you fix it Gary?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby osknows » Sun Feb 19, 2012 7:07 pm

I think these statements reveal what's happening

Total BSP Back available amount
"Pre-reconcilation, this field is zero for all prices except 1.01"

Total BSP Lay available amount
"Pre-reconcilation, this field is zero for all prices except 1000"

If you're using the market depth code example, it only outputs the best 10 back and lay odds and may not reach the prices for 1.01 and 1000.

I think to get Total BSP Back available amount the price will be in prices(0).totalBSPBackAmountAvailable and to get Total BSP Lay available amount it will be in prices(UBound(prices)).totalBSPLayAmountAvailable

I may be wrong though...
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby alrodopial » Sun Feb 19, 2012 7:55 pm

Thanks for the answer os but this is not the case.

I want all the prices pre off and eg for the lay prices (where the problem exists) they are usually only available amounts at odds of 1000.
The given property should have returned at least this amount at these odds.
There is an if statment before ,that gives only the prices with amounts

Code: Select all
If prices(j).totalBSPLayAmountAvailable > 0 Then
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby GaryRussell » Mon Feb 20, 2012 9:42 am

I will investigate and get back to you.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby alrodopial » Wed Feb 22, 2012 9:24 pm

Any news about it Gary?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby GaryRussell » Thu Feb 23, 2012 12:31 pm

Your code works here. I did make a change just before I informed you about these new properties to totalBSPLayAmountAvailable because it wasn't working. Did you by any chance assume that because you already had the version you didn't need to download it again? Try uninstalling and re-installing from http://www.gruss-software.co.uk/Betting ... _Beta2.msi
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby flogger » Thu Feb 23, 2012 4:18 pm

Thanks. I'll try this step at once I get home. Image
Two For The Money Image
flogger
 
Posts: 41
Joined: Wed Sep 28, 2011 9:28 pm


Return to Help

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 39 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.