Programming/Coding on Betfair

User avatar
George Bets
Posts: 6
Joined: Tue Jul 23, 2019 5:16 pm
Location: UK

Quite an interesting topic this. I regularly consider using the API as well, but never actually took this step.

All my strategies are run in Python, and this Python program communicates with the Excel sheets from BetAngel. Although this works for a limited number of markets at the same time, it is not an ideal situation. Especially if I want my trading system to be fast.

This topic makes me think about the API again. I know the it will eventually be the best decision, but it takes time to develop everything from scratch.
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

Euler wrote:
Thu Nov 14, 2019 4:02 pm
I was going to learn Python to help my kids and encourage them into coding. What is the best IDE for it, in the informed wisdom of the forum?

As in, I want something that they could get on with, having never coded before.
Peter
Check out the udemy course on the first post of the thread; very good and cheap (£13)
Ive started to sublime text on their recommendation; not sure how long Ill be able to use it without registering though..
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

LinusP wrote:
Thu Nov 14, 2019 7:17 am
I was lucky that I started learning when the new API was being rolled out..................
Bloody Hell Liam that is impressive :D
No wonder my profits have gone down over the years :D
Inspirational though as to what can be achieved and thanks for sharing the code
Regards
Peter
User avatar
johnsheppard
Posts: 283
Joined: Mon Feb 04, 2019 6:00 am
Location: Cairns Australia

ShaunWhite wrote:
Thu Nov 14, 2019 4:27 pm
No UI, and I monitor progress & status etc using text logs which get pulled into Excel and viewed via RDP. If I did any scrapping or had a web app for monitoring it might be be more complex, but I don't, so it isn't.
IMO, this the way to do it...at least in Microsoft world...simple is best...otherwise you spend your life engineering instead of making money...

My own app is partly the way it is because I came to trading last...I started out thinking I could make an edge from staking plans and abusing online casinos, then started automating matched betting, and a little bit of arbing before I realised there's no way I can scale that stuff......that's why I have a UI...and it's useful, but has overheads...

But I presume this is the path many go through when they are raised by parents to be risk averse non gamblers...
User avatar
mcgoo
Posts: 898
Joined: Thu Jul 18, 2013 12:30 pm

LinusP wrote:
Thu Nov 14, 2019 7:17 am
In my option in python is the best language to learn as a beginner, there are so many brilliant open source libraries available, requests / pandas / scipy / Django. It allows you to do a lot but with minimal experience, this of course comes at a cost due to it being a high level language it is never going to be as quick as C.

I was lucky that I started learning when the new API was being rolled out, I had 2/3 strategies running on BA that I migrated across to python in a month (from zero programming experience) I then soon realized that the open source wrappers available were a load of crap and not maintained so wrote my own. I have then just kept on top of changes and was one of the first to develop streaming which opened up a lot of doors!



This is my web app which I use to monitor things whilst lying on the beach ;)

55740446-C6B3-4AF1-9A2E-D008C8A869BD.png
Damn that's impressive.Congrats. :ugeek: You are what I want to be when I grow up :lol: ..maybe in the next life :)
Seriously well done...inspirational stuff
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

What are you all waiting for? :D

In my view the markets combined with the betfair API (streaming) have never been so good for automation, get started! Worst case is you learn the basics in programming and walk into a new job, I work PT for a consultancy (helps with the mortgage ;) ) and we find it extremely difficult to hire people with applied technical skills like trading / automation teaches you.

Edit: if anyone wants their app key authorised let me know and feel free to join the slack group if you want specific python API help (over 300 people now including some very big players)

https://github.com/liampauling/betfair
SweetLyrics
Posts: 207
Joined: Sat Jun 16, 2018 7:57 pm

Hi Simon,

Maybe I can add some input here, having started a software development MSc conversion course a couple of months ago.

A lot of the people on my course had no prior programming experience. They are intelligent people, with everyone on the course having a 2:1 or a first (except me - I managed to get in with a 2:2, but I digress! :lol: ). However, many are humanities graduates, and having maths ability wasn't a prerequisite for joining the course. In 12 months' time, everyone on the course should have enough programming ability to get a junior programming job (although that is kind of like passing your driving test - you are still very much a beginner at that point). So, yeah, it can be done.

And if you have a mate who knows Java (or whatever language you're learning) who doesn't mind giving you occasional help, then that can ease the journey, but it's not necessary in my opinion. If you study from a book and do the exercises in it, you'll get there (and the compiler will give you a lovely red cross every time you make a silly error, to keep you focused and on track!).

The positives:

- It's a great skill to have.

- It can be very rewarding (especially when you find a creative solution or crack a problem that you thought was beyond your abilities).

The negatives:

- It can be a lonely and frustrating journey at times (much like becoming a trader). There have been times when I've been plagued with self-doubt and wondering if this course was for me. As with any new skill, you're going to suck before you're any good, and that doesn't sit well with the ego.

- To get any good at programming, you need to practice, practice, practice. That requires a level of self-discipline. You won't get good by buying a programming book. Only work will make you good.

So if you are a bit of a procrastinator or dislike the prospect of doing something that can be emotionally draining and where success isn't guaranteed, then maybe programming isn't for you. However, I have no regrets about the journey I've embarked upon - quite the opposite - and I intend to see if through.

Good luck, whatever you decide to do.
User avatar
johnsheppard
Posts: 283
Joined: Mon Feb 04, 2019 6:00 am
Location: Cairns Australia

I have no idea how they measure the popularity of a language but this is interesting to watch;
https://www.youtube.com/watch?v=7EifKIF ... e=youtu.be

It shows the changing popularity over the years in a chart...python is at the top recently.... but lol so is PHP a lot of the way...gah...I'd kill myself if I had to use that on daily basis...

Found at;
https://www.reddit.com/r/csharp/comment ... 2004_2019/

The comments are biased cause its a csharp reddit... :)
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

PeterLe wrote:
Thu Nov 14, 2019 6:53 pm
Euler wrote:
Thu Nov 14, 2019 4:02 pm
I was going to learn Python to help my kids and encourage them into coding. What is the best IDE for it, in the informed wisdom of the forum?

As in, I want something that they could get on with, having never coded before.
Peter
Check out the udemy course on the first post of the thread; very good and cheap (£13)
Ive started to sublime text on their recommendation; not sure how long Ill be able to use it without registering though..
Have you done/doing that course, Peter? How did or are you finding it , also is it this one https://www.udemy.com/course/the-modern ... -bootcamp/ as this one is £19.99 so dunno if it's the same one but guessing it is. Think it's time I stopped procrastinating and finally switched from php :(

Never done one of these online courses before can you go back and to modules and how log do you have to access them, thanks
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Went back to look to buy it and they'd dropped the price to £12 :o Little to lose at that price so bought it, just have to find the time to actually do it now.
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

spreadbetting wrote:
Tue Nov 19, 2019 12:47 pm
Have you done/doing that course, Peter? .....[/quote]
Hi SB,
I'm probably about half way through the 30 hour course..
I'm just doing an hour or so each morning (as that's the best time for me in terms of learning)
I'm not sure why, but Ive found this easier to learn than C#? It just seems more logical to me.

Yes you can go back over the lessons as and when you want. In fact, I think Ill use it more of a reference in the future, so if i get stuck on how to do something in the code, I can just go back to that section. Im off to London Thursday/Friday, so Ill offline the course and do a few hours on the train.
It also helps when you have an idea as to what you want to do in the future...ie as an example , reading in the tick data from the API to store in a DB, I can see how the list function/method will be useful. (maybe there will be a better way, but I haven't got that far yet! :D

I cant wait to have a go with Liam's programs.
Just one question I wanted to ask please (to anyone): Are there any issues to creating the program on my mac and then subsequently using it on my PC ?
Still very much a beginner, but enjoying it the new experience
Regards
Peter

PS SB - Dont forget to join the slack community I can see how it will be a great help in the future (by the way Liam, what about having a 'Beginners' Channel within the slack app?)
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

There are slight nuances with python depending on os especially when you get closer to the metal but when you start it’s likely to be just directories that may cause issues, os.path is your friend here. Running your program in containers (docker) can prevent this but can make things fiddly, basically don’t worry about it as the program will tell you when something is wrong.

A few on the slack group are looking to do another meetup (pub :D ) if anyone here is keen?
User avatar
ruthlessimon
Posts: 2094
Joined: Wed Mar 23, 2016 3:54 pm

SweetLyrics wrote:
Mon Nov 18, 2019 10:52 pm
Maybe I can add some input here, having started a software development MSc conversion course a couple of months ago.
I have to say, it shows insane dedication taking such a step - fair play :)
SweetLyrics
Posts: 207
Joined: Sat Jun 16, 2018 7:57 pm

Thank you.

It might seem risky - a year of my life and a whole lot of money - but the realistic alternative (monotonous jobs like call centre work for years to come) is a whole lot scarier. :)
ruthlessimon wrote:
Tue Nov 19, 2019 8:13 pm
SweetLyrics wrote:
Mon Nov 18, 2019 10:52 pm
Maybe I can add some input here, having started a software development MSc conversion course a couple of months ago.
I have to say, it shows insane dedication taking such a step - fair play :)
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

PeterLe wrote:
Tue Nov 19, 2019 7:02 pm
spreadbetting wrote:
Tue Nov 19, 2019 12:47 pm
Have you done/doing that course, Peter? .....
Hi SB,
I'm probably about half way through the 30 hour course..
I'm just doing an hour or so each morning (as that's the best time for me in terms of learning)
I'm not sure why, but Ive found this easier to learn than C#? It just seems more logical to me.

Yes you can go back over the lessons as and when you want. In fact, I think Ill use it more of a reference in the future, so if i get stuck on how to do something in the code, I can just go back to that section. Im off to London Thursday/Friday, so Ill offline the course and do a few hours on the train.
It also helps when you have an idea as to what you want to do in the future...ie as an example , reading in the tick data from the API to store in a DB, I can see how the list function/method will be useful. (maybe there will be a better way, but I haven't got that far yet! :D

I cant wait to have a go with Liam's programs.
Just one question I wanted to ask please (to anyone): Are there any issues to creating the program on my mac and then subsequently using it on my PC ?
Still very much a beginner, but enjoying it the new experience
Regards
Peter

PS SB - Dont forget to join the slack community I can see how it will be a great help in the future (by the way Liam, what about having a 'Beginners' Channel within the slack app?)
[/quote]


Thanks , Peter.

Reckon an hour or so a day is the way forward. Much better to try and structure the learning than cram it in and get bored and give up like I usually do when I've thought about switching my bots to a new code in the past. Wasn't aware I could download lessons offline, that'll come in handy for when I have to travel on the train even if only going back over old things
Post Reply

Return to “Betfair Exchange API”