Remove this ad
avatar

spamgalorepls

rookie botter

Posts: 6 Member Since: August 9, 2013

Lead

August 27, 2013 09:52:41

Tags : :

Hi I'm very new to all this and just starting to learn a few basic things. I am following this very good tutorial: 
http://forum.bdp.betfair.com/showthread.php?t=112
 I am having trouble finding the correct call that would retrieve me

all markets as GetAllMarkets would, but with all the details that GetMarket would
The idea is have a list of filtered markets let's say all tennis "Match Odds" markets,  and be able to have all the .marketID, .marketName, startTime, for each market, and selectionID for every selection
and then to place some bets on these filtered results.
Any advice would be welcome.

Quote    Reply   
Remove this ad
Remove this ad
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#1 [url]

August 30, 2013 14:45:23

It's not possible to get all of that information in one call using API6. You have to use the 2 functions you have mentioned. If you are just starting out, then I'd suggest you look at betfair's "new" JSON API (named API-NG) as you will have to convert to it in a year or so anyway. Unfortunately, there's not much help available for the API-NG as it's still very new and not many people have adopted it yet.

If you're a complete newbie to programming, then I'd suggest you go and learn at least the basics, otherwise you will have a VERY steep learning curve and WILL give up before you get anywhere.

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

spamgalorepls

rookie botter

Posts: 6 Member Since:August 9, 2013

#2 [url]

August 30, 2013 16:59:58

Thanks for the answer. The new api is out of the question at the moment. You are right that I need to learn the basics, I have been bumping my head against what an "array" is, and what a "for loop" is.. The problem is that simply learning to do "for loops" and "arrays" is not quite enough for programming a bot, and on the other hand reading a 300 page book on VB.net will not get much closer to that goal either.. With my current level of knowledge I feel that simply opening VB Studion and  trying commands blindly and hope for the best, or using trial and error, is just not a good way to learn.
The tutorial that I am using is great but that thread is inactive, so if you have other suggestions as to what I should be learning from here on... I'll give it a try. TY.

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#3 [url]

August 30, 2013 18:45:53

I always recommend Python nowadays, particularly to newbies. It's such an easy to use language and much less verbose than Java, .Net, etc. Code execution is a little bit slower but we're talking microseconds which is a fair trade-off when you consider development time is approx 5x faster. Besides all that, our bots spend about 95% of their time waiting for data to travel across the internet so execution speed is rarely a priority.My suggestions are normally:1. Learn Python: http://diybetfairbots.lefora.com/2013/03/11/python-for-newbies/#post0
EDIT: URL is now http://diybetfairbots.lefora.com/topic/12458941/Python-for-Newbies
2. Make sure you fully understand ALL of the videos mentioned above
3. THEN look at Betfair. If you use my API library, you can get help from this forum and/or me.If you decide to go the Python route, choose one of the "production" stable versions. At this time I'd suggest http://www.python.org/download/releases/2.7.5/

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Last Edited By: birchy December 9, 2014 00:56:00. Edited 1 time.

Quote    Reply   
avatar

spamgalorepls

rookie botter

Posts: 6 Member Since:August 9, 2013

#4 [url]

September 6, 2013 18:26:53


I spent the last 10 days doing what you suggested, and I can proudly say I managed to understand much of the code from your simple_bot (great coding BTW). I spent many hours only trying to figure out how "getting markets and filtering them and them spit them back into markets" part worked.
Anyhow, after understanding the code I was able to make some changes so that it does the basic actions that I had in mind.  ( I had help from a friend who is familiar with Python so I didn't have to spam this forum asking for help)
The next step would be to have it running for longer periods of time, so I am looking for a way to know exactly how many requests per second is it using.. do you have any any idea about how to do that?
Because for example, if check_strategy finds 1000 markets, will it need 1000 get_market calls every second?
If I will have it running while I'm actually trading, and using about 10-15 requests per second for my manual trading purposes, I need to know how many requests per second it's using, so I won't pass the 20 R/S limit.
Again, thanks for the great advices.

Quote    Reply   
Remove this ad
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#5 [url]

September 6, 2013 20:28:02




Impressive work there mate....not many people are willing to stick at it. You're probably seeing the benefits of Python now? Easy isn't it...

Don't forget to read the comments in my API library (api.py) for some hints. Also refer to the API6 manual as that will explain what each function does.

If you're using the Free API, then you have limits of approx 60 calls per minute...BUT...note that is PER FUNCTION, so with some crafty coding, you can do things like alternate between get_market_prices() and get_complete_market_prices() to double your refresh rate to 120 per minute. Note also that some functions (e.g. GetAllMarkets, GetAllEventTypes, etc) have no limits. Section 5 HERE shows which functions may incur data request charges.

If you are paying the full access subscription, setting rps = 19 should be a safe refresh rate. Obviously if you run 2 bots then you'll need to divide that into 15/4, 10/9, 9.5/9.5, etc as you see fit. For the free api, you'll need to use rps = 1 for most functions.


www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

spamgalorepls

rookie botter

Posts: 6 Member Since:August 9, 2013

#6 [url]

September 14, 2013 15:53:51


Thanks for the kind words and sadly I haven't made more progress as I've been busy trading etc.. 
I am not planning on using two bots at the moment, it's just that while the bot is running, I'm trading manually using GeeksToy, and it says that I can use 20 RPS with this application (it has a smart way of "splitting" the the refreshes  between opened markets so that the total number of RPS the application uses doesn't go over the limit that you set)
I will come back with more questions later on .. as I'm sure I will get stuck somewhere.
TY again!

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#7 [url]

September 14, 2013 16:55:27

Yeah, that's the advantage of using a commercial app such as AGT...you pay a monthly subscription but it buys you a "full access" API via their Vendors licence. The full access API is £200 a month, so the software vendors rely on having enough customers to cover this cost.

The main reasons for choosing to write your own bot should be:

1. Strategy Implementation: you are not able to automate your strategy using a commercial software

2. Cost: your strategy does not require refresh speeds greater than 60 per minute, allowing you to use the Free API

3. Trust: you do not trust the software vendor. It has been rumoured in the past that some software vendors were adding dodgy code such as strategy logging and "phone home" functions into their software. Others are just downright rude and arrogant when it comes to customer support.

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

pic

bot addict

Posts: 63 Member Since:July 28, 2011

#8 [url]

September 16, 2013 06:25:51

I think that Stefan of bfexplorer is subscribed to this forum. I wonder if he has something to say.

Quote    Reply   
Remove this ad
Add Reply

Quick Reply

bbcode help