Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Tuesday, 30 July 2013

Montyless Python


It's certainly been a while since I've posted and I'm sure if anyone is actually still reading this blog you were most likely assuming my disappearance as a cowardice retreat from the exchange markets. I know I always did when noticing similar disappearances, but now I'm thinking perhaps those prior assumptions could very well have been premature.

Although this blog was initially set up for my personal development, I feel it has since evolved to a brief online record of my progress, and going all quiet certainly does not reflect recent events. Each month is becoming increasingly more financially rewarding and I feel I have only recently started to rake in the real fruits of my labour. I'd like to think if there are any struggling hopefuls reading this out there, they may take some inspiration from my latest chapter.

So last post was 19th September 2011... and things were moving in the right direction for the next few months, however the limitations of that setup were becoming more apparent as I became really specific with my botting needs. I eventually made the decision about 6 months after that post to drop the Windows MFPro route and get my hands dirty with some real programming. It seemed the only logical solution as I was at a stage where the increased customisability was required, in addition to the warmly welcomed stability and all round efficiency of the bot. Through research I made a few good contacts offering valuable advice, with one chap in particular who has asked me not to identify him (and of course I will respect that), however this guidance back then was invaluable in giving me a kick start in the right direction. Understandably having to learn a whole new programming language felt daunting at first, this is not for anyone looking for quick returns, it took me a year to confidently make my own functional scripts, but I can say without a doubt it's definitely worth the effort if you're in this for the long haul.

The general operation is now run via the free API on a 24/7 Linux platform using Python scripts to trigger the betting strategies. My first script was a very simple generic tactic that my mysterious friend helped me shape. Looking back at it now it was never going to be a big earner but the main thing at that point was to get a bot functional in this new environment, and then push on from there. Once I learnt the language a bit better I gradually added more functionality until I was confident enough to write and run entirely new scripts to reflect my ideas. I am currently running four bots daily and am working on two new strategies.

I will have to leave it there for now and will post again soon about another big part of my process, statistical analysis. I'm a big believer in stats and run all my bots on a ROT basis. Nothing gets past the testing stage if the basic thresholds are not met. I'll talk about that in more detail next time, be sure to check back if you're interested.

Wednesday, 24 November 2010

Thank you

Would like to say thank you for all the email / forum responses in regards to my last post. Although I may of come across as hopelessly stalemated, I have had some correspondence with a few really helpful guys. It's to be expected really, needing to sift through a number of time wasters before meeting someone useful. Do not think it's particularly appropriate to mention all names but you all know who you are, so thank you once again to all who have offered support.

It seems the consensus in regards to my botting needs is to learn how to program the bot myself rather than rely on anyone else. Problem with this route is it will takes much longer before seeing any results, but in regards to the longterm it gives me many more options and the flexibility to adapt. Having spoken to a couple of guys on the forums VBA doesn't seem all that daunting, although ultimately C# appears to be the language to pursue. I suppose if and when I feel I am being limited by Excel & VBA that would be the time to look at switching to C#. As a start though I'm looking at the Excel integration route. One plus with this route is being able to use the vendor API subscription, as I can see the limitations with the free API restricting the possibilities somewhat.

Also think I am developing a serious case of roboguilt, that is for every waking moment I'm not otherwise occupied, I should be working on this damn bot! Any cures for roboguilt, you know the email address! 

Sunday, 21 November 2010

Botting Help

A quick post seeking some advice. As you may have picked up from previous posts I'm looking to get involved in the Betfair botting world. However regrettably out of the six potential programmers I have been in contact with, none have come through for me. It seems going quiet rather than replying and saying you can/can't do something is in fashion at the moment - and this is from email addresses I have already had some correspondence with (not enough to give anything important away mind).

Anyway, I am asking anyone who is reading this, if you have VBA or Excel programming skills and are actually serious, or if you know of anyone with these skills, please get in contact with me either by commenting here or emailing me directly on ambergambler007(at)yahoo(dot)co(dot)uk. It will be a spreadsheet based bot triggered either via Gruss or Bet Angel - as long as it can perform the required functions.

I'm pretty confident one of my trading styles is mechanical enough be be botted, and potentially one or two others. I just need to get this ball rolling and would really appreciate any advice whatsoever at the moment.

Hopefully get some progress on this soon!

Thursday, 11 November 2010

Good to be back

Well it certainly has been a while, looking back the last full day of trading before this month was 16th February!

As mentioned in my last post I have now resumed trading UK horse racing markets, and the past week or so I've gotten involved in quite a few markets, mainly getting back into the swing of things. I must say it hasn't taken too long to pick up where I left off, and it seems what I had learnt has been well cemented. The only issue was concentration levels and stamina so to speak, understandably I can't expect to be in the same condition I was before straight away. In terms of motivation, which was my main issue, I'm feeling as motivated as ever to do this again.

I have also been in contact with a few people in regards to making a bot. This is an ongoing process and will take a while before it's ready, I hope to have this up and running within the next few months if it materialises. It will based on a systematic bookmaking approach that I will be testing initially with Gruss via Excel. If testing goes well I'll look into getting it coded properly and perhaps run off a remote server.

API Software
As some of you will already know my main manual trading application before I stopped was The Toy, and although it lacked a few features I found useful with Bet Angel I managed to match my performance, perhaps even exceed it slightly upto when I stopped. I still felt with the advanced charting and overview The Toy would of been even better, and these were planned for a future release. I'm happy to say that after being involved in some testing of the latest Alpha & Beta versions, they are as promising as ever. My next post will be a review so make sure you're back for that one. Unbelievably the Toy is still free!

As mentioned above I also subscribed to Gruss, and have found it to be quite decent so far. The main reason being for the Excel features, however I traded a few markets manually and it responds very well. For £6 a month this really is a bargain considering how solid the software is and all the potential options you get with Excel integration.

Happy trading everyone, be back soon with more.

Wednesday, 3 February 2010

February quite contrary

Horse Racing
Unit stake: £5-10
Session P&L: £10.84
Average market P&L: £0.84


Can finally put January behind me, it's been a frustrating month with such little opportunity, firstly by me needing to settle into a new job and simply not having the time to trade, followed by the effects of the extreme weather on the cards, and then finally the API failing on almost a daily basis. The latter point still looks like it has not been fully resolved yet by Betfair, but today I simply had to go for it as I found myself with a rare whole afternoon available. Had my backups all ready just in case I needed to close out suddenly, thankfully everything seemed to be running well. Today held another personal test as since 19th December I have only traded 2 days prerace, and it has been nagging me as to whether my progress' momentum would suffer. The change of software has also had its impact and although I felt uncomfortable at first I feel better for it now. I don't seem to have lost much in regards to reading the markets from the break, and if anything I felt more patient today then before. I did notice a few bad habits creeping in, in fact they almost all made a brief appearance at some point. Gladly I feel like I'm spotting and controlling them faster than before which can only be a good thing. I started with £5 stakes to ease my way in for the first 3 markets and used £10 for the remaining 10. Although no losing races a couple of the small greens above represent poorly traded races, I lost much of my green due to some poor decisions, but I suppose its all part of the game. Should also mention that there will be no January review for lack of activity.

Am hoping to have some time again tomorrow and will definitely be trading if that's the case. Hope today faired well for the rest of you.

Saturday, 31 October 2009

Racing weekend

Had a little go on the Aussie racing this morning and the liquidity was really good on the big races. I had no idea what to expect from these markets and started out with the impression they would be similar to the UK ones. This was a mistake that actually ended up costing me as I had a lay order stuck in a poor liquidity race that was not going in running and the market suspended. I lost about £6 on that one race. Lesson learnt and after speaking to Peter and Andy on the BA forum they gave me some much appreciated guidance on which races were worthwhile and on connection settings. The loss didn't really bother me at all as I knew it was something out of my control and would not happen again now  that I know which races to be extra careful in. I actually felt really confident I could make a fair chunk of it back, and didn't feel like increasing stakes or chasing it. This was a great feeling and it signified for me that I had truly accepted the loss and had just moved on calmly - a skill I have been battling to summon at will for quite some time. I stuck to the higher liquidity races and managed to keep profiting and reduce some of that earlier loss. Was really handy having someone to talk to inbetween the races, it helped ground myself more than anything. 




After some sleep I got up at about 1pm and following a little snack I was back on my PC again to catch some of these UK markets. I  think my confidence has reached a good level these past couple of days. Although I'm very careful of not being overconfident and careless. I went through a darker time recently and could not on occasions find the energy or motivation to trade. In almost stark contrast I now cannot get enough of it. I have this hunger for market experience and each and every market I trade is proving to be very enjoyable (doesn't feel like work at all). It really is a great feeling and although I know there will be many more ups and downs I think the attitude I've got at the moment is spot on for my development. It's hard to tell when your training yourself and this is where being part of the forum / blog community really helps. So I'd also like to take this opportunity to say thank you to everyone who has offered advice or comments, they have all contributed good or bad to where I am today. 


Deep down I now have this belief that despite what happens in each individual market I have an edge to profit in the long run, and that is a great feeling, one I must say I did not have before. I don't fear the markets as I used to and approach them much more positively than before. 






The operating system debacle
I've been really impressed with the OS changes, the dilemma I have now is which one do I prefer! Without a doubt Vista comes last but between XP and 7 I'm not so sure which one is better for my trading.  XP is lighting fast and looks really old school after I stripped it down to the bare minimum. However 7 is equally fast and looks / feels impressive. The main issue I have though is that XP only recognizes 4 of my 8GBs of RAM. For this reason alone I thought I should lose XP and just simply dual boot 7, keeping one for trading. It's hard to tell whether having 4 or 8 GBs ia actually making any difference though, and if anything XP still looks faster despite recognising less RAM. I will keep experimenting with them both for now and can only expect 7 to get slower as it gets more cluttered. Haven't got around to installing Linux yet but I will do as soon as I find some time. 


My trading screen is feeling more comfortable, I have made a slight addition of thebettingsite.co.uk just below my ladders. This did come in handy today and it gave me a more objective view as to where punters and traders money is likely to go. Here is a picture of the screen layout, notice the old school WinXP/2000 look! 




Staking
I think I have reached a point now where I can start increasing stakes gradually with both the racing and football, and that 10% of my bank is adequate for trading purposes. I'm still a little shy of my 20 pound racing bank after the Aussie racing incident, so when I hit 20 after each session it will be adjusted accordingly. Doing it race by race would be better but it does makes things unnecessarily complicated, particularly if I'm trading a busy card. 


Won't be trading tomorrow as I'm due to be working. My schedule at work has now changed again but it's not so bad as it gives me random weekdays off where I look forward to trading more UK racing markets.  

Monday, 28 September 2009

Weekly check-up

I have 6 recent trading sessions to report. On the racing I decided to simplify the staking and use the minimum £2 and for the football £4. The first was an evening session on Friday 18th.




I had a really good session profiting an all 9 markets, 7 racing and 2 football. I felt much more in control and reacted quickly when the price moved against me. I recall thinking that I needed to remember the state of mind I was in, as it felt comfortable and I seemed to be making the right choices faster without much hesitation.  I also traded without any auto stop losses and opted to close out of all trades myself.  I did scratch noticeably more trades than usual.




I next traded on Wednesday 23rd, where I also managed to have another clean sweep on the 11 markets, 6 racing and 5 football. Again I opted for no auto stop loss and it worked out well. No major incidents I can recall, it felt more like a routine, one I would very much like to get used to.





Moving onto Thursday 24th where I traded 8 markets. I made a real hash of it on the second race where I was trying to monitor 3 positions on different runners at the same time, and they all rapidly and simultaneously moved against me. I tried to close out on all three as quickly as I could but they all kept moving and by the time I closed the third position the book was showing a red £1.63 with about a min until they were off. I took the loss and decided to just keep at it as I had quite a few more markets available. I was grateful for the 30 minute break inbetween the evening races on this occasion, as it gave me plenty of time to refocus. Profited on all of the remaining markets, and with a couple of good trades on the football I managed to make an overall profit by the end of the session.



Friday 25th was short, I only managed to trade just over an hour whilst  killing some time before I went out. Profitted on all 5 racing markets which was a nice result once again.

I was quite looking forward to Saturday as I knew I would have an opportunity to trade higher liquidity markets with Ascot being on the TV. I didn't actually watch the racing as I forgot to switch over to the channel! I'm so used to listening to music now whilst I trade that following it on TV did not occur to me. Should really have given it a go as I am curious to make use of any new opportunities. Am planing on having Sky installed in February/March when I move flat. The reason I haven't got pictures already is that there are too many trees surrounding my building preventing the dish from receiving a clear signal. If all goes to plan I will probably need a few more months before I'm using significantly larger stakes anyway, and I'm happy now knowing that there will not be any reception issues in the new area.




Saturday was another good day where I managed to profit on all 21 markets, 20 racing and only 1 on football. My preference was always racing whenever there was a clash and there were many on Saturday as you can imagine. I also used my new rule of 2 hours max trading on a full card (between 13:55-15:55). I then had my minimum 1 hour break and traded for another couple more hours until 19:45 where I decided to call it a day. I enjoyed the more liquid markets more than I thought I would. I have read mixed traders opinions and wasn't quite sure what to expect. Granted this was not one of the biggest festivals but still the liquidity was noticeably increased, particularly in comparison to the AW evening racing meetings I have been trading mostly recently. In general I found that the trends were more defined and that larger orders passed through the market without making a huge impact. I prefered this as it made identifying the patterns much clearer. This has motivated me to try and trade one of the big festival like Cheltenham or Aintree.

I did experience a little bit of lag on a few occasions, which I can imagine is a direct result of increased weekend traffic, but nothing serious enough to put me off.




I decided to give Sunday a go after a nice brunch and Hamilton looked to have the GP in the bag. Really wanted to make the most of the Ascot opportunity as I'm not too sure when I will have a chance to trade higher liquid racing markets again.

The racing went well considering I was using £2 stakes. I traded for just over the 2 hour mark as I felt focussed and wanted to try and finish the card if possible. Another clean sweap and overall I traded 30 markets. 15 racing and 15 football. There were a couple of occasions where things were noticeably slower than usual. I did see later that Leon made a post about this. There are some figures displayed at the bottom of the Bet Angel software, not sure what these should read when the API is good/bad, perhaps somebody could fill me in on this if anyone reading this knows, would be much appreciated. I did sit through it until things seemed better, and just carried on trading when bets were being submitted at an acceptable pace again. Did not really put me off, whenever this happens I now just take a short break and by the time I'm back things are usaully much better and as a plus I feel refreshed.

My prematch football trading has also been going very well and I decided to increase my stakes to £5, although I often had 2 scalps open at a time, so effectively it was like using a £10 stake . I think this is a good move as it is giving me a taste of larger stakes on a stable market. This will ease the transition when the time comes to up my stakes in the racing. Most of the trading was prematch apart from a couple of matches which went in-play for about 5 minutes before I got matched. I feel uncomfortable when this happens as the risk of a first minute goal could cause a huge dent in my P&L. I've mentioned it before and I will need to ensure I close in the first few seconds at the latest. I think I have a decent enough sample size to see that removing this risk at the expense of a few small red P&L figures is definitely worth it. I will expect to see many more small red figures on my P&L now as my new rule is to aim and close out at KO.

Racing Trading Style
Despite all my efforts to date I am still noticing a bias towards my old style of trading. This style is back first and scalp orientated. It is evidently working well but I feel I need to consciously push myself to lay first or go for more than a 1-3 tick profit. I'd say roughly speaking we're talking about 80% of my trades are initiated with a back and 90% are 1-3 ticks, with the majority of this being 1 tick scalps. Even when I see an obvious drifing opportuity I am more inclined to back one of the other favourites who are likely to come in then just simply lay the drifter. I think the removal of closing in parts has allowed me to slip into my old bias, but as it stands I feel lmiting my risk is my priority until I have adequate market experience. I'm at a stage where I am still learning on almost every market I trade. The incremental closures is a good idea and I will re-introduce this when I can break down my closures, but for now I think I am going to push myself to lay more and hold onto promising positions longer. I might even trade a few races with a strict rule only allowing me to lay first. I'll pobably missout on many opportunities but this should help me focus on laying opportunities. If anyone has any other ideas on how to tackle this I'm all ears.

I have of course been experimenting with my trading screen again and am starting to feel much more comfotable with it:



I am now looking at both screens more equally and do not sit as close to the monitors as I used to, which allows me to view as much information as possible (I noticed form my videos a bad habit where I was looking at the ladder far too much). I now undock the charting screen and place it next to the ladder. The market overview has moved to the far left with some handy information at the top. I then under pin the guardian and unmatched bets screens which can be easily accessed when necessary, with a longer term candle stick chart for the 3 favourites. Having short term 1 tick charts and longterm 10 min candlesticks is helping me get a good feel for the market at a glance, particularly with the overview being right next to the ladders. This is the set up I used for the weekend and it is unlikely to be refined much further unless I get another screen. I would actually like to see the odds displayed from the thebettingsite.racingpost.co.uk on a seperate screen but I dont feel an upgrade of graphics card and an extra monitor is warranted just for that. Definitely an idea to consider maybe for next year when profits can pay for it. Would certainly be a nice little reward to work towards.

Right I better get back to work!  Will update in about a week or so. Stay lucky.

Sunday, 6 September 2009

Reflections





Much improved results again for Saturday. My new default stake is now £4 and I use a weighting system to mirror how strongly I feel about the trade. For instance £2 for a new idea or speculative trade, £4 for most trades and £6 for trades I feel strongly about (more swing orientated). I also use the closing in parts method I highlighted in my previous post whenever possible. At this stage I will not increase stakes again above £6 until I feel it is warranted. I felt the markets were a bit sluggish on quite a few occasions, but the more I trade the more I notice this seems to be a weekend thing, most likely due to the increase in people logged in at these times. I was tempted to pack it in on a couple of occasions, but am glad that I didn't in the end as I had a good day.

The video analysis although about as intersting as watching paint dry is really making a huge difference. I now breakdown every race and make notes on each one in regards to the price movements, my trading performance and additional notes on how the market should of ideally been traded. I then highlight key areas of my performance for a quick summary with all other races for that session. I intend to keep these brief notes to cross reference later when I analyse similar traded races in the future. This should make me trade them better having analysed the errors the first time, and if not I will highlight the errors again, making them stand out as repeating errors.

My discipline is much improved however I still need to kick myself every so often as the bad habits are still very much there, and I suspect will remain there until I have many more hours of good trading experiences under my belt. It's a shame I do not have more time to spend trading but as I analyse everything now, this means that roughly for every hour spent trading I need about 2 hours for analysis. Although this might seem like a tad overkill for some, it is evidently accelerating my learning process and I feel that by simply trading for the 3 hours, I would improve at a much slower rate whilst repeating many of the errors without addressing them properly.

I keep needing to remind myself that patience is a virtue. Breaking it down if I trade one day a week for a whole year that would make about 52 days. If I was a full time trader, assuming I was trading 5 days a week, this equates to only about 10 weeks or if you include a 2 month annual holiday approximately a quarter of a year. Now I gather that people who crack this game trade for an average of 1-2 years fulltime, so relatively speaking at my rate (assuming all analysis is completed each week) I'm looking at 4-8 years partime!

Realistically speaking I feel with accelerated learning and good discipline this can be reduced considerably but I do need to keep reminding myself to look at the bigger picture and maintain my patience. I've just started this marathon. Natuarally we all want to push through and master our skills quickly but I feel going through these motions now as effectively as possbile will ultimately get me there faster. The more I trade the more I realise the secret to success is that there is no secret, and it really is as simple as the harder you work the more profitable you will become.

Should also note that I did finally experiment with using 3 ladders towards the end of the session, and wished that I had done it earlier. It made trading much easier, particularly to nip in and out of trades on the 2nd and 3rd favs. I found that on a couple of markets I actually made more on doing this then just sticking to the fav.

Thursday, 13 August 2009

Trading Review 11/08/09




Stakes for all back/lays £2

I was almost exclusively scalping for 1, 2 or 3 ticks on the favourite with a couple of exceptions.

All races upto Lingfield 15:30 were not traded well with a couple taken in play to get a tick or two. I was feeling rusty and took a while to warm up. I got away with those races however the aforementioned race produced a huge relative loss due to the fact the race was again taken in play (with double staking tactics not working pre-race). After punishing myself by cleaning the toilet I sat down and traded very well for almost every other race until the 19:40 Muss where I did take another trade in play. This time I got away with it managing to scratch.

Felt very silly and confused, as if I was fighting an almighty force determined to indiscipline me. I then traded the remaining races well knowing that I will be doing all the dishes once the racing had finished.

Looking at the races where I traded badly:
At the 15:30 Ling I was in a -£0.11p position after a couple of poor entrances, looking at it for a few seconds I was hoping it would move up, the price quickly steamed leaving me at about -£0.50. Here I had another opportunity to red out, instead I increased my stakes in an attempt to scalp my way out of the deficit. Price did not go my way and I ended up with a larger red at the off.

In hindsight it is obvious where the mistakes were made. Should of redded out at -£0.11, but to have done this I would have had to have been very quick. There is no excuse though for not redding out at -£0.50. The opportunity was longer and I should of taken it. If I have had I would have been in profit for the day easy.

At the 19:40 Muss I had a similar experience, although the chances to red out were not so clear cut. My entrance points were poor and I should have killed the bad trades early. The race went in play cancelling my closures. I quickly placed an order in running and was matched in seconds for a -£0.05. I think the worst red pre-race was -£0.50. If I had taken this, even with the -£0.50 from the 15:30 I would have still been in profit for the day.

All the other races were traded well. I have taken great encouragement from today as I managed to keep disciplined for long periods and identified and accepted my errors. The next step is to maintain the discipline for the whole session. This will be tough but I’m sure I can pull it off with a little bit of positive psychology and reconditioning. I also felt more and more comfortable reading the markets the more I traded, which was a relief as I was feeling rusty when I started.

I think identifying the negative/undisciplined thoughts early and having a method to get rid of them quick whilst staying focused is key. There are breathing and other relaxation techniques that I have read about which I will be using in my next session to try and achieve this.

Other observations include the comfort with the graphs the longer I was trading. I appear to have them positioned in a way which is much easier to setup and read.

Betfair graph with 10sec refresh – top
Advanced candle stick chart with 90 data points - last traded price 10 secs – middle
Market overview with all runners under 20.00 – bottom
Trading on enhanced ladder with 1 tick intervals and colours adjusted accordingly.



I did use stop losses for a bit but developed a style from the middle of the session onwards where I preferred to manage the positions manually. I will stick to this as it is ultimately what I want to do. Also the stop loses do cut you out early sometimes when the market is making mini moves. Psychologically I do not feel the stop losses are doing much for me, and I am getting better and faster at closing at the right times (with the two highlighted races above being the exceptions to this).

Site was noticeably slower for last 2 or 3 races. In the last race I gave up about 2 mins before the off as the lag was really bad. Not sure why this happened, there are a few possible explanations (including my ISP connections, poor PC performance and Betfair response times). It does make scalping almost impossible. It is better not to trade at all then to try under these conditions.

Points to remember for next session:
- Regular breaks when I feel hot and my concentration is fading
- Relaxation techniques for when I feel emotion creeping in
- Look for multiple signs to justify entrance and exits
- Be confident with decisions as they are justified
- Warm up by reading this review and watching a couple of vids before trading
- Never go inplay intentionally
- Identify negative thoughts early – say them aloud if necessary
- Always punish these negative actions accordingly
- Do not trade in anger, fear or greed.
- Remember the bigger picture – longterm profits are only achieved with consistent performance over a large sample size.
- Always try to stay positive no matter what has happened in the last race/trade
Completely free Betfair trading software..

Other software I have found useful so fa..

Soccer Mystic - Betfair trading software